Skip to content

Commit

Permalink
test: Fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenDV committed Jul 13, 2024
1 parent c00d110 commit e3d47d9
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var messages = new List<ChatCompletionRequestMessage>
"You are a helpful weather assistant.".AsSystemMessage(),
"What is the current temperature in Dubai, UAE in Celsius?".AsUserMessage(),
};
var model = ChatModels.Gpt35Turbo.Id;
var model = CreateChatCompletionRequestModel.Gpt35Turbo;
var result = await api.Chat.CreateChatCompletionAsync(
messages,
model: model,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</ItemGroup>

<PropertyGroup Label="Nuget">
<Version>3.0.0</Version>
<Version>3.0.1</Version>
<GeneratePackageOnBuild Condition=" '$(Configuration)' == 'Release' ">true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Authors>tryAGI and contributors</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Linq;
using System.Threading.Tasks;
using OpenAI;
using OpenAI.Constants;

namespace H.Ipc.Generator.IntegrationTests;

Expand All @@ -19,7 +18,7 @@ public async Task SimpleMethod()
"You are a helpful weather assistant.".AsSystemMessage(),
"What is the current temperature in Dubai, UAE in Celsius?".AsUserMessage(),
};
var model = ChatModels.Gpt35Turbo.Id;
var model = CreateChatCompletionRequestModel.Gpt35Turbo;

try
{
Expand Down
6 changes: 2 additions & 4 deletions src/tests/OpenAI.IntegrationTests/Tests.Chat.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using OpenAI.Constants;

namespace OpenAI.IntegrationTests;

public partial class Tests
Expand All @@ -14,7 +12,7 @@ public async Task CreateChatCompletion()
"You are a helpful weather assistant.".AsSystemMessage(),
"What's the weather like today?".AsUserMessage(),
},
model: ChatModels.Gpt35Turbo.Id,
model: CreateChatCompletionRequestModel.Gpt35Turbo,
user: "tryAGI.OpenAI.IntegrationTests.Tests.CreateChatCompletion");
response.Choices.ElementAt(0).Message.Content.Should().NotBeEmpty();

Expand All @@ -31,7 +29,7 @@ public async Task CreateChatCompletionAsStreamAsync()
"You are a helpful weather assistant.".AsSystemMessage(),
"What's the weather like today?".AsUserMessage(),
},
model: ChatModels.Gpt35Turbo.Id,
model: CreateChatCompletionRequestModel.Gpt35Turbo,
user: "tryAGI.OpenAI.IntegrationTests.Tests.CreateChatCompletion");

await foreach (var response in enumerable)
Expand Down
4 changes: 1 addition & 3 deletions src/tests/OpenAI.IntegrationTests/Tests.Embeddings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using OpenAI.Constants;

namespace OpenAI.IntegrationTests;

public partial class Tests
Expand All @@ -10,7 +8,7 @@ public async Task CreateEmbedding()
var api = GetAuthorizedApi();
var response = await api.Embeddings.CreateEmbeddingAsync(
input: "Hello, world",
model: EmbeddingModels.Version3Small.Id,
model: CreateEmbeddingRequestModel.TextEmbedding3Small,
user: "tryAGI.OpenAI.IntegrationTests.Tests.CreateEmbedding");
response.Data.ElementAt(0).Embedding1.Should().NotBeEmpty();

Expand Down
6 changes: 2 additions & 4 deletions src/tests/OpenAI.IntegrationTests/Tests.Moderation.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using OpenAI.Constants;

namespace OpenAI.IntegrationTests;

public partial class Tests
Expand All @@ -10,7 +8,7 @@ public async Task CreateModeration()
var api = GetAuthorizedApi();
var response = await api.Moderations.CreateModerationAsync(
input: "Hello, world",
model: ModerationModels.Latest.Id);
model: CreateModerationRequestModel.TextModerationLatest);

response.Results.First().Flagged.Should().BeFalse();
}
Expand All @@ -21,7 +19,7 @@ public async Task CreateModeration_Flagged()
var api = GetAuthorizedApi();
var response = await api.Moderations.CreateModerationAsync(
input: "Fuck you",
model: ModerationModels.Latest.Id);
model: CreateModerationRequestModel.TextModerationLatest);
response.Results.First().Flagged.Should().BeTrue();
}
}

0 comments on commit e3d47d9

Please sign in to comment.