openai/openai-dotnet

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
OpenAI_2.3.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

src/Custom/Assistants/Assistant.cs

35lines · modecode

1using System.ClientModel;
2using System.ClientModel.Primitives;
3using System.Diagnostics.CodeAnalysis;
4using System.Text.Json;
5
6namespace OpenAI.Assistants;
7
8[CodeGenType("AssistantObject")]
9public partial class Assistant
10{
11 private const string AssistantValue = "assistant";
12
13 // CUSTOM: Made internal.
14 /// <summary> The object type, which is always `assistant`. </summary>
15 [CodeGenMember("Object")]
16 internal string Object { get; } = AssistantValue;
17
18 /// <inheritdoc cref="AssistantResponseFormat"/>
19 public AssistantResponseFormat ResponseFormat { get; }
20
21 /// <summary>
22 /// 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.
23 ///
24 /// We generally recommend altering this or temperature but not both.
25 /// </summary>
26 [CodeGenMember("TopP")]
27 public float? NucleusSamplingFactor { get; }
28
29 internal static Assistant FromClientResult(ClientResult result)
30 {
31 using PipelineResponse response = result.GetRawResponse();
32 using JsonDocument document = JsonDocument.Parse(response.Content);
33 return DeserializeAssistant(document.RootElement, ModelSerializationExtensions.WireOptions);
34 }
35}
36