openai/openai-dotnet

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
copilot/customize-openairesponsescontext-attribute

Branches

Tags

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

Clone

HTTPS

Download ZIP

OpenAI/src/Custom/Assistants/AssistantCreationOptions.cs

49lines · modecode

1using Microsoft.TypeSpec.Generator.Customizations;
2using OpenAI.Chat;
3using System.ClientModel;
4using System.Collections.Generic;
5
6namespace OpenAI.Assistants;
7
8/// <summary>
9/// Represents additional options available when creating a new <see cref="Assistant"/>.
10/// </summary>
11[CodeGenType("CreateAssistantRequest")]
12[CodeGenVisibility(nameof(AssistantCreationOptions), CodeGenVisibility.Public)]
13[CodeGenSuppress(nameof(AssistantCreationOptions), typeof(string))]
14public partial class AssistantCreationOptions
15{
16 // CUSTOM: visibility hidden to promote required property to method parameter
17 internal string Model { get; set; }
18
19 /// <summary>
20 /// <para>
21 /// A list of tool enabled on the assistant.
22 /// </para>
23 /// There can be a maximum of 128 tools per assistant. Tools can be of types `code_interpreter`, `file_search`, or `function`.
24 /// </summary>
25 [CodeGenMember("Tools")]
26 public IList<ToolDefinition> Tools { get; }
27
28 /// <inheritdoc cref="ToolResources"/>
29 [CodeGenMember("ToolResources")]
30 public ToolResources ToolResources { get; set; }
31
32 /// <inheritdoc cref="AssistantResponseFormat"/>
33 [CodeGenMember("ResponseFormat")]
34 public AssistantResponseFormat ResponseFormat { get; set; }
35
36 /// <summary>
37 /// 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.
38 ///
39 /// We generally recommend altering this or temperature but not both.
40 /// </summary>
41 [CodeGenMember("TopP")]
42 public float? NucleusSamplingFactor { get; set; }
43
44 // CUSTOM: Made internal.
45 [CodeGenMember("ReasoningEffort")]
46 internal AssistantReasoningEffortLevel? ReasoningEffortLevel { get; set; }
47
48 internal BinaryContent ToBinaryContent() => BinaryContent.Create(this, ModelSerializationExtensions.WireOptions);
49}
50