Skip to content

Commit

Permalink
com.openai.unity 8.5.4 (#336)
Browse files Browse the repository at this point in the history
- Update ChatRequest to support o3 series reasoning models
  • Loading branch information
StephenHodgson authored Jan 31, 2025
1 parent 29b31b2 commit 19d1f02
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
9 changes: 2 additions & 7 deletions Runtime/Chat/ChatRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public ChatRequest(
/// <param name="reasoningEffort">
/// Constrains the effort of reasoning for <see href="https://platform.openai.com/docs/guides/reasoning">Reasoning Models</see>.<br/>
/// Currently supported values are: Low, Medium, High. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning response.<br/>
/// <b>o1 models only!</b>
/// <b>Reasoning models only!</b>
/// </param>
/// <param name="user">
/// A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse.
Expand Down Expand Up @@ -190,11 +190,6 @@ public ChatRequest(

if (reasoningEffort.HasValue)
{
if (!Model.Contains("o1"))
{
throw new ArgumentException("Only o1 series models support reasoning effort", nameof(reasoningEffort));
}

ReasoningEffort = reasoningEffort.Value;
}

Expand Down Expand Up @@ -268,7 +263,7 @@ public ChatRequest(
/// Currently supported values are: Low, Medium, High. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning response.
/// </summary>
/// <remarks>
/// <b>o1 models only!</b>
/// <b>Reasoning models only!</b>
/// </remarks>
[Preserve]
[JsonProperty("reasoning_effort", DefaultValueHandling = DefaultValueHandling.Ignore)]
Expand Down
2 changes: 1 addition & 1 deletion Runtime/Common/ReasoningEffort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace OpenAI
/// Currently supported values are: Low, Medium, High. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning response.
/// </summary>
/// <remarks>
/// <b>o1 models only!</b>
/// <b>Reasoning models only!</b>
/// </remarks>
public enum ReasoningEffort
{
Expand Down
4 changes: 3 additions & 1 deletion Runtime/Models/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ internal Model(

public static Model O1Mini { get; } = new("o1-mini", "openai");

public static Model O3Mini { get; } = new("o3-mini", "openai");

public static Model GPT4oRealtime { get; } = new("gpt-4o-realtime-preview", "openai");

/// <summary>
/// GPT-4o (“o” for omni) is our most advanced model.
/// GPT-4o ("o" for "omni") is our most advanced model.
/// It is multimodal (accepting text or image inputs and outputting text),
/// and it has the same high intelligence as GPT-4 Turbo but is much more efficient.
/// It generates text 2x faster and is 50% cheaper.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"displayName": "OpenAI",
"description": "A OpenAI package for the Unity Game Engine to use GPT-4, GPT-3.5, GPT-3 and Dall-E though their RESTful API (currently in beta).\n\nIndependently developed, this is not an official library and I am not affiliated with OpenAI.\n\nAn OpenAI API account is required.",
"keywords": [],
"version": "8.5.3",
"version": "8.5.4",
"unity": "2021.3",
"documentationUrl": "https://github.com/RageAgainstThePixel/com.openai.unity#documentation",
"changelogUrl": "https://github.com/RageAgainstThePixel/com.openai.unity/releases",
Expand Down

0 comments on commit 19d1f02

Please sign in to comment.