Skip to content

Commit

Permalink
Added missing files
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlieDigital committed Jul 23, 2024
1 parent 1692ada commit 0dc69f2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
16 changes: 14 additions & 2 deletions generator/PromptTemplateBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,24 @@ public virtual async Task<string> ExecuteAsync(
Kernel kernel,
string? serviceId = null,
CancellationToken cancellation = default
) {
var (result, _) = await ExecuteWithJsonAsync<T>(kernel, serviceId, cancellation);

return result;
}
#nullable disable

#nullable enable
public virtual async Task<(T? Result, string Json)> ExecuteWithJsonAsync<T>(
Kernel kernel,
string? serviceId = null,
CancellationToken cancellation = default
) {
var json = await ExecuteAsync(kernel, serviceId, cancellation);

json = json.Trim().Replace("```json", "").Replace("```")
json = json.Trim().Replace("```json", "").Replace("```", "");

return JsonSerializer.Deserialize<T>(json, SerializerOptions);
return (JsonSerializer.Deserialize<T>(json, SerializerOptions), json);
}
#nullable disable
}
Expand Down
6 changes: 3 additions & 3 deletions generator/SKPromptGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
<PackageReleaseNotes>https://github.com/CharlieDigital/SKPromptGenerator/releases</PackageReleaseNotes>
<RepositoryType>git</RepositoryType>
<SignAssembly>False</SignAssembly>
<AssemblyVersion>0.4.1</AssemblyVersion>
<FileVersion>0.4.1</FileVersion>
<Version>0.4.1</Version>
<AssemblyVersion>0.4.2</AssemblyVersion>
<FileVersion>0.4.2</FileVersion>
<Version>0.4.2</Version>
<NeutralLanguage>en</NeutralLanguage>
<DevelopmentDependency>true</DevelopmentDependency>
<SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking>
Expand Down

0 comments on commit 0dc69f2

Please sign in to comment.