generated from RageAgainstThePixel/upm-template
-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fixed ResponseObjectFormat deserialization when set to auto - Added RankingOptions to FileSearchOptions - Fixed potential memory leaks when uploading files to various endpoints - Added timestamp values to BaseResponse to calculate rate limits
- Loading branch information
1 parent
260d6dd
commit e6c5e97
Showing
17 changed files
with
313 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using Newtonsoft.Json; | ||
using System; | ||
using UnityEngine.Scripting; | ||
|
||
namespace OpenAI | ||
{ | ||
/// <summary> | ||
/// The ranking options for the file search. | ||
/// <see href="https://platform.openai.com/docs/assistants/tools/file-search/customizing-file-search-settings"/> | ||
/// </summary> | ||
[Preserve] | ||
public sealed class RankingOptions | ||
{ | ||
/// <summary> | ||
/// Constructor. | ||
/// </summary> | ||
/// <param name="ranker"> | ||
/// The ranker to use for the file search. | ||
/// If not specified will use the `auto` ranker. | ||
/// </param> | ||
/// <param name="scoreThreshold"> | ||
/// The score threshold for the file search. | ||
/// All values must be a floating point number between 0 and 1. | ||
/// </param> | ||
/// <exception cref="ArgumentOutOfRangeException"></exception> | ||
[JsonConstructor] | ||
public RankingOptions( | ||
[JsonProperty("ranker")] string ranker = "auto", | ||
[JsonProperty("score_threshold")] float scoreThreshold = 0f) | ||
{ | ||
Ranker = ranker; | ||
ScoreThreshold = scoreThreshold switch | ||
{ | ||
< 0 => throw new ArgumentOutOfRangeException(nameof(scoreThreshold), "Score threshold must be greater than or equal to 0."), | ||
> 1 => throw new ArgumentOutOfRangeException(nameof(scoreThreshold), "Score threshold must be less than or equal to 1."), | ||
_ => scoreThreshold | ||
}; | ||
} | ||
|
||
/// <summary> | ||
/// The ranker to use for the file search. | ||
/// </summary> | ||
[Preserve] | ||
[JsonProperty("ranker")] | ||
public string Ranker { get; } | ||
|
||
/// <summary> | ||
/// The score threshold for the file search. | ||
/// </summary> | ||
[Preserve] | ||
[JsonProperty("score_threshold", DefaultValueHandling = DefaultValueHandling.Include)] | ||
public float ScoreThreshold { get; } | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.