Skip to content

Commit

Permalink
Move PowerParseJson to SemanticValidation
Browse files Browse the repository at this point in the history
  • Loading branch information
mehrandvd committed Dec 28, 2023
1 parent 6c02084 commit 5e5df20
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 147 deletions.
100 changes: 0 additions & 100 deletions src/skUnit.Tests/OpenAiUtilTests/OpenAiUtilTests.cs

This file was deleted.

8 changes: 4 additions & 4 deletions src/skUnit/Scenarios/Parsers/Assertions/JsonCheckAssertion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Threading.Tasks;
using skUnit.Utils;
using SemanticValidation.Utils;

namespace skUnit.Scenarios.Parsers.Assertions
{
Expand All @@ -25,7 +25,7 @@ public JsonCheckAssertion SetJsonAssertText(string jsonAssertText)

JsonCheckText = (jsonAssertText ?? "");

var json = OpenAiUtil.ParseJson<JsonObject>(JsonCheckText);
var json = SemanticUtils.PowerParseJson<JsonObject>(JsonCheckText);

JsonCheck = json ?? throw new InvalidOperationException($"""
Can not parse json:
Expand All @@ -44,8 +44,8 @@ public JsonCheckAssertion SetJsonAssertText(string jsonAssertText)
/// <exception cref="SemanticAssertException"></exception>
public async Task Assert(Semantic semantic, string input)
{
var answerJson = OpenAiUtil.ParseJson<JsonObject>(input)
?? throw new InvalidOperationException($"""
var answerJson = SemanticUtils.PowerParseJson<JsonObject>(input)
?? throw new InvalidOperationException($"""
Can not parse answer to json:
{input}
""");
Expand Down
42 changes: 0 additions & 42 deletions src/skUnit/Utils/OpenAiUtil.cs

This file was deleted.

2 changes: 1 addition & 1 deletion src/skUnit/skUnit.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<ItemGroup>
<PackageReference Include="Markdig" Version="0.34.0" />
<PackageReference Include="Microsoft.SemanticKernel" Version="1.0.1" />
<PackageReference Include="SemanticValidation" Version="0.11.0-beta" />
<PackageReference Include="SemanticValidation" Version="0.12.0-beta" />
</ItemGroup>

<ItemGroup>
Expand Down

0 comments on commit 5e5df20

Please sign in to comment.