Skip to content

Commit ffe9b12

Browse files
authored
Update API version and model references (#160)
2 parents 5f5bcdd + ab8d289 commit ffe9b12

File tree

13 files changed

+33
-29
lines changed

13 files changed

+33
-29
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,9 @@ builder.Services.AddChatGpt(options =>
5959
- 2024-02-15-preview
6060
- 2024-03-01-preview
6161
- 2024-04-01-preview
62-
- 2024-05-01-preview (default)
62+
- 2024-05-01-preview
6363
- 2024-02-01
64+
- 2024-06-01 (default)
6465
- _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").
6566

6667
### DefaultModel and DefaultEmbeddingModel
@@ -78,6 +79,7 @@ Currently available models are:
7879
- gpt-4-32k
7980
- gpt-4-turbo
8081
- gpt-4o
82+
- gpt-4o-mini
8183

8284
They have fixed names, available in the [OpenAIChatGptModels.cs file](https://github.com/marcominerva/ChatGptNet/blob/master/src/ChatGptNet/Models/OpenAIChatGptModels.cs).
8385

@@ -143,7 +145,7 @@ The configuration can be automatically read from [IConfiguration](https://learn.
143145
"ApiKey": "", // Required
144146
//"Organization": "", // Optional, used only by OpenAI
145147
"ResourceName": "", // Required when using Azure OpenAI Service
146-
"ApiVersion": "2023-08-01-preview", // Optional, used only by Azure OpenAI Service (default: 2023-08-01-preview)
148+
"ApiVersion": "2024-06-01", // Optional, used only by Azure OpenAI Service (default: 2024-06-01)
147149
"AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory
148150
149151
"DefaultModel": "my-model",

samples/ChatGptApi/ChatGptApi.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.6" />
11-
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.6.0" />
12-
<PackageReference Include="Polly.Extensions" Version="8.4.0" />
10+
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.7" />
11+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.7.0" />
1312
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
1413
<PackageReference Include="TinyHelpers.AspNetCore" Version="3.1.6" />
1514
</ItemGroup>

samples/ChatGptApi/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"ApiKey": "", // Required
55
//"Organization": "", // Optional, used only by OpenAI
66
"ResourceName": "", // Required when using Azure OpenAI Service
7-
"ApiVersion": "2024-05-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-05-01-preview)
7+
"ApiVersion": "2024-06-01", // Optional, used only by Azure OpenAI Service (default: 2024-06-01)
88
"AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory
99

1010
"DefaultModel": "my-model",

samples/ChatGptBlazor.Wasm/ChatGptBlazor.Wasm.csproj

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="Markdig" Version="0.37.0" />
12-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.6" />
13-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.6" PrivateAssets="all" />
14-
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.6.0" />
15-
<PackageReference Include="Polly.Extensions" Version="8.4.0" />
12+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.7" />
13+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.7" PrivateAssets="all" />
14+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.7.0" />
1615
</ItemGroup>
1716

1817
<ItemGroup>

samples/ChatGptConsole/ChatGptConsole.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
12-
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.6.0" />
13-
<PackageReference Include="Polly.Extensions" Version="8.4.0" />
12+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.7.0" />
1413
</ItemGroup>
1514

1615
<ItemGroup>

samples/ChatGptConsole/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"ApiKey": "", // Required
55
//"Organization": "", // Optional, used only by OpenAI
66
"ResourceName": "", // Required when using Azure OpenAI Service
7-
"ApiVersion": "2024-05-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-05-01-preview)
7+
"ApiVersion": "2024-06-01", // Optional, used only by Azure OpenAI Service (default: 2024-06-01)
88
"AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory
99

1010
"DefaultModel": "my-model",

samples/ChatGptFunctionCallingConsole/ChatGptFunctionCallingConsole.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
12-
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.6.0" />
13-
<PackageReference Include="Polly.Extensions" Version="8.4.0" />
12+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.7.0" />
1413
</ItemGroup>
1514

1615
<ItemGroup>

samples/ChatGptFunctionCallingConsole/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"ApiKey": "", // Required
55
//"Organization": "", // Optional, used only by OpenAI
66
"ResourceName": "", // Required when using Azure OpenAI Service
7-
"ApiVersion": "2024-05-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-05-01-preview)
7+
"ApiVersion": "2024-06-01", // Optional, used only by Azure OpenAI Service (default: 2024-06-01)
88
"AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory
99

1010
"DefaultModel": "my-model",

samples/ChatGptStreamConsole/ChatGptStreamConsole.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99

1010
<ItemGroup>
1111
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
12-
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.6.0" />
13-
<PackageReference Include="Polly.Extensions" Version="8.4.0" />
12+
<PackageReference Include="Microsoft.Extensions.Http.Resilience" Version="8.7.0" />
1413
</ItemGroup>
1514

1615
<ItemGroup>

samples/ChatGptStreamConsole/appsettings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"ApiKey": "", // Required
55
//"Organization": "", // Optional, used only by OpenAI
66
"ResourceName": "", // Required when using Azure OpenAI Service
7-
"ApiVersion": "2024-05-01-preview", // Optional, used only by Azure OpenAI Service (default: 2024-05-01-preview)
7+
"ApiVersion": "2024-06-01", // Optional, used only by Azure OpenAI Service (default: 2024-06-01)
88
"AuthenticationType": "ApiKey", // Optional, used only by Azure OpenAI Service. Allowed values: ApiKey (default) or ActiveDirectory
99

1010
"DefaultModel": "my-model",

src/ChatGptNet/ChatGptNet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
4343
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="8.0.0" />
44-
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
44+
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.2" />
4545
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
4646
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
4747
</ItemGroup>

src/ChatGptNet/Models/OpenAIChatGptModels.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ public static class OpenAIChatGptModels
1717
/// <remarks>
1818
/// This model supports 4.096 tokens. See <see href="https://platform.openai.com/docs/models/gpt-3-5">GPT-3.5</see> for more information.
1919
/// </remarks>
20-
/// <seealso cref="Gpt35_Turbo_16k"/>
2120
public const string Gpt35_Turbo = "gpt-3.5-turbo";
2221

2322
/// <summary>
@@ -26,7 +25,6 @@ public static class OpenAIChatGptModels
2625
/// <remarks>
2726
/// This model supports 16.384 tokens. See <see href="https://platform.openai.com/docs/models/gpt-3-5">GPT-3.5</see> for more information.
2827
/// </remarks>
29-
/// <seealso cref="Gpt35_Turbo"/>
3028
public const string Gpt35_Turbo_16k = "gpt-3.5-turbo-16k";
3129

3230
/// <summary>
@@ -35,7 +33,6 @@ public static class OpenAIChatGptModels
3533
/// <remarks>
3634
/// This model supports 8.192 tokens. See <see href="https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4">GPT-4</see> for more information.
3735
/// </remarks>
38-
/// <seealso cref="Gpt4_32k"/>
3936
public const string Gpt4 = "gpt-4";
4037

4138
/// <summary>
@@ -44,7 +41,6 @@ public static class OpenAIChatGptModels
4441
/// <remarks>
4542
/// This model supports 32.768 tokens. See <see href="https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4">GPT-4</see> for more information.
4643
/// </remarks>
47-
/// <seealso cref="Gpt4"/>
4844
public const string Gpt4_32k = "gpt-4-32k";
4945

5046
/// <summary>
@@ -54,16 +50,23 @@ public static class OpenAIChatGptModels
5450
/// This model supports 128.000 tokens and returns a maximum of 4.096 outpout tokens.
5551
/// See <see href="https://platform.openai.com/docs/models/gpt-4-turbo-and-gpt-4">GPT-4</see> for more information.
5652
/// </remarks>
57-
/// <seealso cref="Gpt4"/>
5853
public const string Gpt4_Turbo = "gpt-4-turbo";
5954

6055
/// <summary>
61-
/// The most advanced, multimodal flagship model that’s cheaper and faster than <see cref="Gpt4_Turbo"/>.
56+
/// The most advanced, multimodal flagship model that is cheaper and faster than <see cref="Gpt4_Turbo"/>.
6257
/// </summary>
6358
/// <remarks>
6459
/// This model supports 128.000 tokens and returns a maximum of 4.096 outpout tokens.
6560
/// See <see href="https://platform.openai.com/docs/models/gpt-4o">GPT-4</see> for more information.
6661
/// </remarks>
67-
/// <seealso cref="Gpt4_Turbo"/>
6862
public const string Gpt4_o = "gpt-4o";
63+
64+
/// <summary>
65+
/// An affordable and intelligent small model for fast, lightweight tasks. GPT-4o mini is cheaper and more capable than <see cref="Gpt35_Turbo"/>.
66+
/// </summary>
67+
/// <remarks>
68+
/// This model supports 128.000 tokens and returns a maximum of 4.096 outpout tokens.
69+
/// See <see href="https://platform.openai.com/docs/models/gpt-4o-mini">GPT-4</see> for more information.
70+
/// </remarks>
71+
public const string Gpt4_o_mini = "gpt-4o-mini";
6972
}

src/ChatGptNet/ServiceConfigurations/AzureChatGptServiceConfiguration.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ internal class AzureChatGptServiceConfiguration : ChatGptServiceConfiguration
1010
/// <summary>
1111
/// The default API version for Azure OpenAI service.
1212
/// </summary>
13-
public const string DefaultApiVersion = "2024-05-01-preview";
13+
public const string DefaultApiVersion = "2024-06-01";
1414

1515
/// <summary>
1616
/// Gets or sets the name of the Azure OpenAI Resource.
1717
/// </summary>
1818
public string? ResourceName { get; set; }
1919

2020
/// <summary>
21-
/// Gets or sets the API version of the Azure OpenAI service (Default: 2024-05-01-preview).
21+
/// Gets or sets the API version of the Azure OpenAI service (Default: 2024-06-01).
2222
/// </summary>
2323
/// <remarks>
2424
/// Currently supported versions are:
@@ -55,6 +55,10 @@ internal class AzureChatGptServiceConfiguration : ChatGptServiceConfiguration
5555
/// <term>2023-02-01</term>
5656
/// <description><see href="https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-02-01/inference.json">Swagger spec</see></description>
5757
/// </item>
58+
/// <item>
59+
/// <term>2024-06-01</term>
60+
/// <description><see href="https://github.com/Azure/azure-rest-api-specs/blob/main/specification/cognitiveservices/data-plane/AzureOpenAI/inference/stable/2024-06-01/inference.json">Swagger spec</see></description>
61+
/// </item>
5862
/// </list>
5963
/// </remarks>
6064
public string ApiVersion { get; set; } = DefaultApiVersion;

0 commit comments

Comments
 (0)