Skip to content

Commit

Permalink
Add new models and update token properties
Browse files Browse the repository at this point in the history
Updated README.md to list new models (`o1-preview` and `o1-mini`) and revised configuration examples to use `MaxCompletionTokens`. Updated appsettings.json to reflect the new `MaxCompletionTokens` property in configuration examples. Added constants for new models in OpenAIChatGptModels.cs with descriptions and token support details.
  • Loading branch information
marcominerva committed Nov 6, 2024
1 parent 4f29b1e commit 1806ba5
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ builder.Services.AddChatGpt(options =>
options.DefaultParameters = new ChatGptParameters
{
MaxTokens = 800,
//MaxCompletionTokens = 800, // o1 series models support this property instead of MaxTokens
Temperature = 0.7
};
});
Expand Down Expand Up @@ -85,6 +86,8 @@ Currently available models are:
- gpt-4-turbo
- gpt-4o
- gpt-4o-mini
- o1-preview
- o1-mini

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

Expand Down Expand Up @@ -163,6 +166,7 @@ The configuration can be automatically read from [IConfiguration](https://learn.
// "Temperature": 0.8,
// "TopP": 1,
// "MaxTokens": 500,
// "MaxCompletionTokens": null, // o1 series models support this property instead of MaxTokens
// "PresencePenalty": 0,
// "FrequencyPenalty": 0,
// "ResponseFormat": { "Type": "text" }, // Allowed values for Type: text (default) or json_object
Expand Down
2 changes: 1 addition & 1 deletion samples/ChatGptConsole/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// "Temperature": 0.8,
// "TopP": 1,
// "MaxTokens": 500,
// "MaxCompletionTokens": null, // o1 series models supports this property instead of MaxTokens
// "MaxCompletionTokens": null, // o1 series models support this property instead of MaxTokens
// "PresencePenalty": 0,
// "FrequencyPenalty": 0,
// "ResponseFormat": { "Type": "text" }, // Allowed values for Type: text (default) or json_object
Expand Down
2 changes: 1 addition & 1 deletion samples/ChatGptFunctionCallingConsole/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// "Temperature": 0.8,
// "TopP": 1,
// "MaxTokens": 500,
// "MaxCompletionTokens": null, // o1 series models supports this property instead of MaxTokens
// "MaxCompletionTokens": null, // o1 series models support this property instead of MaxTokens
// "PresencePenalty": 0,
// "FrequencyPenalty": 0,
// "ResponseFormat": { "Type": "text" }, // Allowed values for Type: text (default) or json_object
Expand Down
1 change: 1 addition & 0 deletions samples/ChatGptStreamConsole/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// "Temperature": 0.8,
// "TopP": 1,
// "MaxTokens": 500,
// "MaxCompletionTokens": null, // o1 series models support this property instead of MaxTokens
// "PresencePenalty": 0,
// "FrequencyPenalty": 0,
// "ResponseFormat": { "Type": "text" }, // Allowed values for Type: text (default) or json_object
Expand Down
18 changes: 18 additions & 0 deletions src/ChatGptNet/Models/OpenAIChatGptModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,22 @@ public static class OpenAIChatGptModels
/// See <see href="https://platform.openai.com/docs/models/gpt-4o-mini">GPT-4</see> for more information.
/// </remarks>
public const string Gpt4_o_mini = "gpt-4o-mini";

/// <summary>
/// Reasoning model designed to solve hard problems across domains.
/// </summary>
/// <remarks>
/// This model supports 128.000 tokens and returns a maximum of 32.768 outpout tokens.
/// See <see href="https://platform.openai.com/docs/models#o1">o1-preview and o1-mini</see> for more information.
/// </remarks>
public const string O1_preview = "o1-preview";

/// <summary>
/// Faster and cheaper reasoning model particularly good at coding, math, and science.
/// </summary>
/// <remarks>
/// This model supports 128.000 tokens and returns a maximum of 32.768 outpout tokens.
/// See <see href="https://platform.openai.com/docs/models#o1">o1-preview and o1-mini</see> for more information.
/// </remarks>
public const string O1_mini = "o1-mini";
}

0 comments on commit 1806ba5

Please sign in to comment.