Skip to content

Commit b66aad7

Browse files
com.openai.unity 8.2.5 (#296)
- Fixed ResponseObjectFormat deserialization when maxNumberOfResults is null
1 parent d1c6367 commit b66aad7

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

OpenAI/Packages/com.openai.unity/Runtime/Common/FileSearchOptions.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ public sealed class FileSearchOptions
1212
[Preserve]
1313
[JsonConstructor]
1414
public FileSearchOptions(
15-
[JsonProperty("max_num_results")] int maxNumberOfResults,
15+
[JsonProperty("max_num_results")] int? maxNumberOfResults,
1616
[JsonProperty("ranking_options")] RankingOptions rankingOptions = null)
1717
{
1818
MaxNumberOfResults = maxNumberOfResults switch
1919
{
20+
null => null,
2021
< 1 => throw new ArgumentOutOfRangeException(nameof(maxNumberOfResults), "Max number of results must be greater than 0."),
2122
> 50 => throw new ArgumentOutOfRangeException(nameof(maxNumberOfResults), "Max number of results must be less than 50."),
2223
_ => maxNumberOfResults
@@ -25,11 +26,11 @@ public FileSearchOptions(
2526
}
2627

2728
[Preserve]
28-
[JsonProperty("max_num_results")]
29-
public int MaxNumberOfResults { get; }
29+
[JsonProperty("max_num_results", DefaultValueHandling = DefaultValueHandling.Ignore)]
30+
public int? MaxNumberOfResults { get; }
3031

3132
[Preserve]
32-
[JsonProperty("ranking_options")]
33+
[JsonProperty("ranking_options", DefaultValueHandling = DefaultValueHandling.Ignore)]
3334
public RankingOptions RankingOptions { get; }
3435
}
3536
}

OpenAI/Packages/com.openai.unity/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "OpenAI",
44
"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.",
55
"keywords": [],
6-
"version": "8.2.4",
6+
"version": "8.2.5",
77
"unity": "2021.3",
88
"documentationUrl": "https://github.com/RageAgainstThePixel/com.openai.unity#documentation",
99
"changelogUrl": "https://github.com/RageAgainstThePixel/com.openai.unity/releases",

OpenAI/Packages/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"com.unity.ide.visualstudio": "2.0.22",
55
"com.unity.textmeshpro": "3.0.9",
66
"com.unity.ugui": "1.0.0",
7-
"com.utilities.buildpipeline": "1.4.1"
7+
"com.utilities.buildpipeline": "1.5.0"
88
},
99
"scopedRegistries": [
1010
{

0 commit comments

Comments
 (0)