From 9f126aabc0eb692d95b67992ed9f5f91f7a682dc Mon Sep 17 00:00:00 2001 From: HavenDV Date: Tue, 6 Aug 2024 12:31:54 +0400 Subject: [PATCH] feat: Added ChatClient LatestSmartModel/LatestFastModel constants. --- src/libs/OpenAI/ChatClient.AsStream.cs | 8 -------- src/libs/OpenAI/ChatClient.LatestModelConstants.cs | 14 ++++++++++++++ ... JsonSerializerContextTypes.AdditionalTypes.cs} | 5 +++++ 3 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 src/libs/OpenAI/ChatClient.LatestModelConstants.cs rename src/libs/OpenAI/{SourceGenerationContext.AdditionalTypes.cs => JsonSerializerContextTypes.AdditionalTypes.cs} (60%) diff --git a/src/libs/OpenAI/ChatClient.AsStream.cs b/src/libs/OpenAI/ChatClient.AsStream.cs index c449d2ed..1f640e49 100644 --- a/src/libs/OpenAI/ChatClient.AsStream.cs +++ b/src/libs/OpenAI/ChatClient.AsStream.cs @@ -165,12 +165,4 @@ public partial class ChatClient } } } - - public sealed partial class JsonSerializerContextTypes - { - /// - /// - /// - public CreateChatCompletionStreamResponse? CreateChatCompletionStreamResponse { get; set; } - } } diff --git a/src/libs/OpenAI/ChatClient.LatestModelConstants.cs b/src/libs/OpenAI/ChatClient.LatestModelConstants.cs new file mode 100644 index 00000000..ee37e502 --- /dev/null +++ b/src/libs/OpenAI/ChatClient.LatestModelConstants.cs @@ -0,0 +1,14 @@ +namespace OpenAI; + +public partial class ChatClient +{ + /// + /// Always points to the latest smart model. + /// + public const CreateChatCompletionRequestModel LatestSmartModel = CreateChatCompletionRequestModel.Gpt4o; + + /// + /// Always points to the latest fast model. + /// + public const CreateChatCompletionRequestModel LatestFastModel = CreateChatCompletionRequestModel.Gpt4oMini; +} \ No newline at end of file diff --git a/src/libs/OpenAI/SourceGenerationContext.AdditionalTypes.cs b/src/libs/OpenAI/JsonSerializerContextTypes.AdditionalTypes.cs similarity index 60% rename from src/libs/OpenAI/SourceGenerationContext.AdditionalTypes.cs rename to src/libs/OpenAI/JsonSerializerContextTypes.AdditionalTypes.cs index c1461ff3..b4974d12 100644 --- a/src/libs/OpenAI/SourceGenerationContext.AdditionalTypes.cs +++ b/src/libs/OpenAI/JsonSerializerContextTypes.AdditionalTypes.cs @@ -6,4 +6,9 @@ public sealed partial class JsonSerializerContextTypes /// To fix issue with LogitBias. /// public Dictionary? StringDoubleDictionary { get; set; } + + /// + /// + /// + public CreateChatCompletionStreamResponse? CreateChatCompletionStreamResponse { get; set; } } \ No newline at end of file