openai/openai-dotnet

Public

mirrored from https://github.com/openai/openai-dotnetAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
OpenAI_2.1.0

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/Custom/Assistants/AssistantCreationOptions.cs

56lines · modecode

1using System.Collections.Generic;
2using System.Diagnostics.CodeAnalysis;
3
4namespace OpenAI.Assistants;
5
6/// <summary>
7/// Represents additional options available when creating a new <see cref="Assistant"/>.
8/// </summary>
9[Experimental("OPENAI001")]
10[CodeGenModel("CreateAssistantRequest")]
11[CodeGenSuppress(nameof(AssistantCreationOptions), typeof(string))]
12public partial class AssistantCreationOptions
13{
14 // CUSTOM: visibility hidden to promote required property to method parameter
15 internal string Model { get; set; }
16
17 /// <summary>
18 /// <para>
19 /// A list of tool enabled on the assistant.
20 /// </para>
21 /// There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
22 /// </summary>
23 [CodeGenMember("Tools")]
24 public IList<ToolDefinition> Tools { get; } = new ChangeTrackingList<ToolDefinition>();
25
26 /// <inheritdoc cref="ToolResources"/>
27 [CodeGenMember("ToolResources")]
28 public ToolResources ToolResources { get; set; }
29
30 /// <inheritdoc cref="AssistantResponseFormat"/>
31 [CodeGenMember("ResponseFormat")]
32 public AssistantResponseFormat ResponseFormat { get; set; }
33
34 /// <summary>
35 /// An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered.
36 ///
37 /// We generally recommend altering this or temperature but not both.
38 /// </summary>
39 [CodeGenMember("TopP")]
40 public float? NucleusSamplingFactor { get; set; }
41
42 internal AssistantCreationOptions(InternalCreateAssistantRequestModel model)
43 : this()
44 {
45 Model = model.ToString();
46 }
47
48 /// <summary>
49 /// Creates a new instance of <see cref="AssistantCreationOptions"/>.
50 /// </summary>
51 public AssistantCreationOptions()
52 {
53 Metadata = new ChangeTrackingDictionary<string, string>();
54 Tools = new ChangeTrackingList<ToolDefinition>();
55 }
56}