diff --git a/README.md b/README.md index d49dbab..aa49ccc 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,9 @@ builder.Services.AddChatGpt(options => - 2024-02-15-preview - 2024-03-01-preview - 2024-04-01-preview - - 2024-05-01-preview (default) + - 2024-05-01-preview - 2024-02-01 + - 2024-06-01 (default) - _AuthenticationType_: it specifies if the key is an actual API Key or an [Azure Active Directory token](https://learn.microsoft.com/azure/cognitive-services/openai/how-to/managed-identity) (optional, default: "ApiKey"). ### DefaultModel and DefaultEmbeddingModel @@ -78,6 +79,7 @@ Currently available models are: - gpt-4-32k - gpt-4-turbo - gpt-4o +- gpt-4o-mini They have fixed names, available in the [OpenAIChatGptModels.cs file](https://github.com/marcominerva/ChatGptNet/blob/master/src/ChatGptNet/Models/OpenAIChatGptModels.cs). @@ -143,7 +145,7 @@ The configuration can be automatically read from [IConfiguration](https://learn. "ApiKey": "", // Required //"Organization": "", // Optional, used only by OpenAI "ResourceName": "", // Required when using Azure OpenAI Service - "ApiVersion": "2023-08-01-preview", // Optional, used only by Azure OpenAI Service (default: 2023-08-01-preview) + "ApiVersion": "2024-06-01", // Optional, used only by Azure OpenAI Service (default: 2024-06-01) "AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory "DefaultModel": "my-model", diff --git a/samples/ChatGptApi/ChatGptApi.csproj b/samples/ChatGptApi/ChatGptApi.csproj index 66b87eb..1f9b360 100644 --- a/samples/ChatGptApi/ChatGptApi.csproj +++ b/samples/ChatGptApi/ChatGptApi.csproj @@ -7,9 +7,8 @@ - - - + + diff --git a/samples/ChatGptApi/appsettings.json b/samples/ChatGptApi/appsettings.json index a652b62..c20b513 100644 --- a/samples/ChatGptApi/appsettings.json +++ b/samples/ChatGptApi/appsettings.json @@ -4,7 +4,7 @@ "ApiKey": "", // Required //"Organization": "", // Optional, used only by OpenAI "ResourceName": "", // Required when using Azure OpenAI Service - "ApiVersion": "2024-05-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-05-01-preview) + "ApiVersion": "2024-06-01", // Optional, used only by Azure OpenAI Service (default: 2024-06-01) "AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory "DefaultModel": "my-model", diff --git a/samples/ChatGptBlazor.Wasm/ChatGptBlazor.Wasm.csproj b/samples/ChatGptBlazor.Wasm/ChatGptBlazor.Wasm.csproj index 0ec58e2..dfa2676 100644 --- a/samples/ChatGptBlazor.Wasm/ChatGptBlazor.Wasm.csproj +++ b/samples/ChatGptBlazor.Wasm/ChatGptBlazor.Wasm.csproj @@ -9,10 +9,9 @@ - - - - + + + diff --git a/samples/ChatGptConsole/ChatGptConsole.csproj b/samples/ChatGptConsole/ChatGptConsole.csproj index 3453c18..a936d5e 100644 --- a/samples/ChatGptConsole/ChatGptConsole.csproj +++ b/samples/ChatGptConsole/ChatGptConsole.csproj @@ -9,8 +9,7 @@ - - + diff --git a/samples/ChatGptConsole/appsettings.json b/samples/ChatGptConsole/appsettings.json index 8391a2b..90c7dd9 100644 --- a/samples/ChatGptConsole/appsettings.json +++ b/samples/ChatGptConsole/appsettings.json @@ -4,7 +4,7 @@ "ApiKey": "", // Required //"Organization": "", // Optional, used only by OpenAI "ResourceName": "", // Required when using Azure OpenAI Service - "ApiVersion": "2024-05-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-05-01-preview) + "ApiVersion": "2024-06-01", // Optional, used only by Azure OpenAI Service (default: 2024-06-01) "AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory "DefaultModel": "my-model", diff --git a/samples/ChatGptFunctionCallingConsole/ChatGptFunctionCallingConsole.csproj b/samples/ChatGptFunctionCallingConsole/ChatGptFunctionCallingConsole.csproj index 833960e..783914d 100644 --- a/samples/ChatGptFunctionCallingConsole/ChatGptFunctionCallingConsole.csproj +++ b/samples/ChatGptFunctionCallingConsole/ChatGptFunctionCallingConsole.csproj @@ -9,8 +9,7 @@ - - + diff --git a/samples/ChatGptFunctionCallingConsole/appsettings.json b/samples/ChatGptFunctionCallingConsole/appsettings.json index 5b3db33..7a59190 100644 --- a/samples/ChatGptFunctionCallingConsole/appsettings.json +++ b/samples/ChatGptFunctionCallingConsole/appsettings.json @@ -4,7 +4,7 @@ "ApiKey": "", // Required //"Organization": "", // Optional, used only by OpenAI "ResourceName": "", // Required when using Azure OpenAI Service - "ApiVersion": "2024-05-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-05-01-preview) + "ApiVersion": "2024-06-01", // Optional, used only by Azure OpenAI Service (default: 2024-06-01) "AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory "DefaultModel": "my-model", diff --git a/samples/ChatGptStreamConsole/ChatGptStreamConsole.csproj b/samples/ChatGptStreamConsole/ChatGptStreamConsole.csproj index dc946e0..1300043 100644 --- a/samples/ChatGptStreamConsole/ChatGptStreamConsole.csproj +++ b/samples/ChatGptStreamConsole/ChatGptStreamConsole.csproj @@ -9,8 +9,7 @@ - - + diff --git a/samples/ChatGptStreamConsole/appsettings.json b/samples/ChatGptStreamConsole/appsettings.json index f0a0095..5d4df27 100644 --- a/samples/ChatGptStreamConsole/appsettings.json +++ b/samples/ChatGptStreamConsole/appsettings.json @@ -4,7 +4,7 @@ "ApiKey": "", // Required //"Organization": "", // Optional, used only by OpenAI "ResourceName": "", // Required when using Azure OpenAI Service - "ApiVersion": "2024-05-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-05-01-preview) + "ApiVersion": "2024-06-01", // Optional, used only by Azure OpenAI Service (default: 2024-06-01) "AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory "DefaultModel": "my-model", diff --git a/src/ChatGptNet/ChatGptNet.csproj b/src/ChatGptNet/ChatGptNet.csproj index b2189f0..29a6435 100644 --- a/src/ChatGptNet/ChatGptNet.csproj +++ b/src/ChatGptNet/ChatGptNet.csproj @@ -41,7 +41,7 @@ - + diff --git a/src/ChatGptNet/Models/OpenAIChatGptModels.cs b/src/ChatGptNet/Models/OpenAIChatGptModels.cs index 25cec6f..0bc2878 100644 --- a/src/ChatGptNet/Models/OpenAIChatGptModels.cs +++ b/src/ChatGptNet/Models/OpenAIChatGptModels.cs @@ -17,7 +17,6 @@ public static class OpenAIChatGptModels /// /// This model supports 4.096 tokens. See GPT-3.5 for more information. /// - /// public const string Gpt35_Turbo = "gpt-3.5-turbo"; /// @@ -26,7 +25,6 @@ public static class OpenAIChatGptModels /// /// This model supports 16.384 tokens. See GPT-3.5 for more information. /// - /// public const string Gpt35_Turbo_16k = "gpt-3.5-turbo-16k"; /// @@ -35,7 +33,6 @@ public static class OpenAIChatGptModels /// /// This model supports 8.192 tokens. See GPT-4 for more information. /// - /// public const string Gpt4 = "gpt-4"; /// @@ -44,7 +41,6 @@ public static class OpenAIChatGptModels /// /// This model supports 32.768 tokens. See GPT-4 for more information. /// - /// public const string Gpt4_32k = "gpt-4-32k"; /// @@ -54,16 +50,23 @@ public static class OpenAIChatGptModels /// This model supports 128.000 tokens and returns a maximum of 4.096 outpout tokens. /// See GPT-4 for more information. /// - /// public const string Gpt4_Turbo = "gpt-4-turbo"; /// - /// The most advanced, multimodal flagship model that’s cheaper and faster than . + /// The most advanced, multimodal flagship model that is cheaper and faster than . /// /// /// This model supports 128.000 tokens and returns a maximum of 4.096 outpout tokens. /// See GPT-4 for more information. /// - /// public const string Gpt4_o = "gpt-4o"; + + /// + /// An affordable and intelligent small model for fast, lightweight tasks. GPT-4o mini is cheaper and more capable than . + /// + /// + /// This model supports 128.000 tokens and returns a maximum of 4.096 outpout tokens. + /// See GPT-4 for more information. + /// + public const string Gpt4_o_mini = "gpt-4o-mini"; } \ No newline at end of file diff --git a/src/ChatGptNet/ServiceConfigurations/AzureChatGptServiceConfiguration.cs b/src/ChatGptNet/ServiceConfigurations/AzureChatGptServiceConfiguration.cs index 3385199..e0b590a 100644 --- a/src/ChatGptNet/ServiceConfigurations/AzureChatGptServiceConfiguration.cs +++ b/src/ChatGptNet/ServiceConfigurations/AzureChatGptServiceConfiguration.cs @@ -10,7 +10,7 @@ internal class AzureChatGptServiceConfiguration : ChatGptServiceConfiguration /// /// The default API version for Azure OpenAI service. /// - public const string DefaultApiVersion = "2024-05-01-preview"; + public const string DefaultApiVersion = "2024-06-01"; /// /// Gets or sets the name of the Azure OpenAI Resource. @@ -18,7 +18,7 @@ internal class AzureChatGptServiceConfiguration : ChatGptServiceConfiguration public string? ResourceName { get; set; } /// - /// Gets or sets the API version of the Azure OpenAI service (Default: 2024-05-01-preview). + /// Gets or sets the API version of the Azure OpenAI service (Default: 2024-06-01). /// /// /// Currently supported versions are: @@ -55,6 +55,10 @@ internal class AzureChatGptServiceConfiguration : ChatGptServiceConfiguration /// 2023-02-01 /// Swagger spec /// + /// + /// 2024-06-01 + /// Swagger spec + /// /// /// public string ApiVersion { get; set; } = DefaultApiVersion;