openai/openai-dotnet

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
OpenAI_2.0.0

Branches

Tags

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

Clone

HTTPS

Download ZIP

api/OpenAI.netstandard2.0.cs

2603lines · modecode

1namespace OpenAI {
2 public class OpenAIClient {
3 protected OpenAIClient();
4 public OpenAIClient(ApiKeyCredential credential, OpenAIClientOptions options);
5 public OpenAIClient(ApiKeyCredential credential);
6 protected internal OpenAIClient(ClientPipeline pipeline, OpenAIClientOptions options);
7 public OpenAIClient(string apiKey);
8 public ClientPipeline Pipeline { get; }
9 public virtual AssistantClient GetAssistantClient();
10 public virtual AudioClient GetAudioClient(string model);
11 public virtual BatchClient GetBatchClient();
12 public virtual ChatClient GetChatClient(string model);
13 public virtual EmbeddingClient GetEmbeddingClient(string model);
14 public virtual FineTuningClient GetFineTuningClient();
15 public virtual ImageClient GetImageClient(string model);
16 public virtual ModerationClient GetModerationClient(string model);
17 public virtual OpenAIFileClient GetOpenAIFileClient();
18 public virtual OpenAIModelClient GetOpenAIModelClient();
19 public virtual VectorStoreClient GetVectorStoreClient();
20 }
21 public class OpenAIClientOptions : ClientPipelineOptions {
22 public Uri Endpoint { get; set; }
23 public string OrganizationId { get; set; }
24 public string ProjectId { get; set; }
25 public string UserAgentApplicationId { get; set; }
26 }
27}
28namespace OpenAI.Assistants {
29 public class Assistant : IJsonModel<Assistant>, IPersistableModel<Assistant> {
30 public DateTimeOffset CreatedAt { get; }
31 public string Description { get; }
32 public string Id { get; }
33 public string Instructions { get; }
34 public IReadOnlyDictionary<string, string> Metadata { get; }
35 public string Model { get; }
36 public string Name { get; }
37 public float? NucleusSamplingFactor { get; }
38 public AssistantResponseFormat ResponseFormat { get; }
39 public float? Temperature { get; }
40 public ToolResources ToolResources { get; }
41 public IReadOnlyList<ToolDefinition> Tools { get; }
42 Assistant IJsonModel<Assistant>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
43 void IJsonModel<Assistant>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
44 Assistant IPersistableModel<Assistant>.Create(BinaryData data, ModelReaderWriterOptions options);
45 string IPersistableModel<Assistant>.GetFormatFromOptions(ModelReaderWriterOptions options);
46 BinaryData IPersistableModel<Assistant>.Write(ModelReaderWriterOptions options);
47 }
48 public class AssistantClient {
49 protected AssistantClient();
50 public AssistantClient(ApiKeyCredential credential, OpenAIClientOptions options);
51 public AssistantClient(ApiKeyCredential credential);
52 protected internal AssistantClient(ClientPipeline pipeline, OpenAIClientOptions options);
53 public AssistantClient(string apiKey);
54 public ClientPipeline Pipeline { get; }
55 [EditorBrowsable(EditorBrowsableState.Never)]
56 public virtual ClientResult CancelRun(string threadId, string runId, RequestOptions options);
57 public virtual ClientResult<ThreadRun> CancelRun(string threadId, string runId, CancellationToken cancellationToken = default);
58 [EditorBrowsable(EditorBrowsableState.Never)]
59 public virtual Task<ClientResult> CancelRunAsync(string threadId, string runId, RequestOptions options);
60 public virtual Task<ClientResult<ThreadRun>> CancelRunAsync(string threadId, string runId, CancellationToken cancellationToken = default);
61 [EditorBrowsable(EditorBrowsableState.Never)]
62 public virtual ClientResult CreateAssistant(BinaryContent content, RequestOptions options = null);
63 public virtual ClientResult<Assistant> CreateAssistant(string model, AssistantCreationOptions options = null, CancellationToken cancellationToken = default);
64 [EditorBrowsable(EditorBrowsableState.Never)]
65 public virtual Task<ClientResult> CreateAssistantAsync(BinaryContent content, RequestOptions options = null);
66 public virtual Task<ClientResult<Assistant>> CreateAssistantAsync(string model, AssistantCreationOptions options = null, CancellationToken cancellationToken = default);
67 public virtual ClientResult<ThreadMessage> CreateMessage(string threadId, MessageRole role, IEnumerable<MessageContent> content, MessageCreationOptions options = null, CancellationToken cancellationToken = default);
68 [EditorBrowsable(EditorBrowsableState.Never)]
69 public virtual ClientResult CreateMessage(string threadId, BinaryContent content, RequestOptions options = null);
70 public virtual Task<ClientResult<ThreadMessage>> CreateMessageAsync(string threadId, MessageRole role, IEnumerable<MessageContent> content, MessageCreationOptions options = null, CancellationToken cancellationToken = default);
71 [EditorBrowsable(EditorBrowsableState.Never)]
72 public virtual Task<ClientResult> CreateMessageAsync(string threadId, BinaryContent content, RequestOptions options = null);
73 [EditorBrowsable(EditorBrowsableState.Never)]
74 public virtual ClientResult CreateRun(string threadId, BinaryContent content, RequestOptions options = null);
75 public virtual ClientResult<ThreadRun> CreateRun(string threadId, string assistantId, RunCreationOptions options = null, CancellationToken cancellationToken = default);
76 [EditorBrowsable(EditorBrowsableState.Never)]
77 public virtual Task<ClientResult> CreateRunAsync(string threadId, BinaryContent content, RequestOptions options = null);
78 public virtual Task<ClientResult<ThreadRun>> CreateRunAsync(string threadId, string assistantId, RunCreationOptions options = null, CancellationToken cancellationToken = default);
79 public virtual CollectionResult<StreamingUpdate> CreateRunStreaming(string threadId, string assistantId, RunCreationOptions options = null, CancellationToken cancellationToken = default);
80 public virtual AsyncCollectionResult<StreamingUpdate> CreateRunStreamingAsync(string threadId, string assistantId, RunCreationOptions options = null, CancellationToken cancellationToken = default);
81 public virtual ClientResult<AssistantThread> CreateThread(ThreadCreationOptions options = null, CancellationToken cancellationToken = default);
82 [EditorBrowsable(EditorBrowsableState.Never)]
83 public virtual ClientResult CreateThread(BinaryContent content, RequestOptions options = null);
84 [EditorBrowsable(EditorBrowsableState.Never)]
85 public virtual ClientResult CreateThreadAndRun(BinaryContent content, RequestOptions options = null);
86 public virtual ClientResult<ThreadRun> CreateThreadAndRun(string assistantId, ThreadCreationOptions threadOptions = null, RunCreationOptions runOptions = null, CancellationToken cancellationToken = default);
87 [EditorBrowsable(EditorBrowsableState.Never)]
88 public virtual Task<ClientResult> CreateThreadAndRunAsync(BinaryContent content, RequestOptions options = null);
89 public virtual Task<ClientResult<ThreadRun>> CreateThreadAndRunAsync(string assistantId, ThreadCreationOptions threadOptions = null, RunCreationOptions runOptions = null, CancellationToken cancellationToken = default);
90 public virtual CollectionResult<StreamingUpdate> CreateThreadAndRunStreaming(string assistantId, ThreadCreationOptions threadOptions = null, RunCreationOptions runOptions = null, CancellationToken cancellationToken = default);
91 public virtual AsyncCollectionResult<StreamingUpdate> CreateThreadAndRunStreamingAsync(string assistantId, ThreadCreationOptions threadOptions = null, RunCreationOptions runOptions = null, CancellationToken cancellationToken = default);
92 public virtual Task<ClientResult<AssistantThread>> CreateThreadAsync(ThreadCreationOptions options = null, CancellationToken cancellationToken = default);
93 [EditorBrowsable(EditorBrowsableState.Never)]
94 public virtual Task<ClientResult> CreateThreadAsync(BinaryContent content, RequestOptions options = null);
95 [EditorBrowsable(EditorBrowsableState.Never)]
96 public virtual ClientResult DeleteAssistant(string assistantId, RequestOptions options);
97 public virtual ClientResult<AssistantDeletionResult> DeleteAssistant(string assistantId, CancellationToken cancellationToken = default);
98 [EditorBrowsable(EditorBrowsableState.Never)]
99 public virtual Task<ClientResult> DeleteAssistantAsync(string assistantId, RequestOptions options);
100 public virtual Task<ClientResult<AssistantDeletionResult>> DeleteAssistantAsync(string assistantId, CancellationToken cancellationToken = default);
101 [EditorBrowsable(EditorBrowsableState.Never)]
102 public virtual ClientResult DeleteMessage(string threadId, string messageId, RequestOptions options);
103 public virtual ClientResult<MessageDeletionResult> DeleteMessage(string threadId, string messageId, CancellationToken cancellationToken = default);
104 [EditorBrowsable(EditorBrowsableState.Never)]
105 public virtual Task<ClientResult> DeleteMessageAsync(string threadId, string messageId, RequestOptions options);
106 public virtual Task<ClientResult<MessageDeletionResult>> DeleteMessageAsync(string threadId, string messageId, CancellationToken cancellationToken = default);
107 [EditorBrowsable(EditorBrowsableState.Never)]
108 public virtual ClientResult DeleteThread(string threadId, RequestOptions options);
109 public virtual ClientResult<ThreadDeletionResult> DeleteThread(string threadId, CancellationToken cancellationToken = default);
110 [EditorBrowsable(EditorBrowsableState.Never)]
111 public virtual Task<ClientResult> DeleteThreadAsync(string threadId, RequestOptions options);
112 public virtual Task<ClientResult<ThreadDeletionResult>> DeleteThreadAsync(string threadId, CancellationToken cancellationToken = default);
113 [EditorBrowsable(EditorBrowsableState.Never)]
114 public virtual ClientResult GetAssistant(string assistantId, RequestOptions options);
115 public virtual ClientResult<Assistant> GetAssistant(string assistantId, CancellationToken cancellationToken = default);
116 [EditorBrowsable(EditorBrowsableState.Never)]
117 public virtual Task<ClientResult> GetAssistantAsync(string assistantId, RequestOptions options);
118 public virtual Task<ClientResult<Assistant>> GetAssistantAsync(string assistantId, CancellationToken cancellationToken = default);
119 public virtual CollectionResult<Assistant> GetAssistants(AssistantCollectionOptions options = null, CancellationToken cancellationToken = default);
120 public virtual CollectionResult<Assistant> GetAssistants(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
121 [EditorBrowsable(EditorBrowsableState.Never)]
122 public virtual CollectionResult GetAssistants(int? limit, string order, string after, string before, RequestOptions options);
123 public virtual AsyncCollectionResult<Assistant> GetAssistantsAsync(AssistantCollectionOptions options = null, CancellationToken cancellationToken = default);
124 public virtual AsyncCollectionResult<Assistant> GetAssistantsAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
125 [EditorBrowsable(EditorBrowsableState.Never)]
126 public virtual AsyncCollectionResult GetAssistantsAsync(int? limit, string order, string after, string before, RequestOptions options);
127 [EditorBrowsable(EditorBrowsableState.Never)]
128 public virtual ClientResult GetMessage(string threadId, string messageId, RequestOptions options);
129 public virtual ClientResult<ThreadMessage> GetMessage(string threadId, string messageId, CancellationToken cancellationToken = default);
130 [EditorBrowsable(EditorBrowsableState.Never)]
131 public virtual Task<ClientResult> GetMessageAsync(string threadId, string messageId, RequestOptions options);
132 public virtual Task<ClientResult<ThreadMessage>> GetMessageAsync(string threadId, string messageId, CancellationToken cancellationToken = default);
133 public virtual CollectionResult<ThreadMessage> GetMessages(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
134 public virtual CollectionResult<ThreadMessage> GetMessages(string threadId, MessageCollectionOptions options = null, CancellationToken cancellationToken = default);
135 [EditorBrowsable(EditorBrowsableState.Never)]
136 public virtual CollectionResult GetMessages(string threadId, int? limit, string order, string after, string before, RequestOptions options);
137 public virtual AsyncCollectionResult<ThreadMessage> GetMessagesAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
138 public virtual AsyncCollectionResult<ThreadMessage> GetMessagesAsync(string threadId, MessageCollectionOptions options = null, CancellationToken cancellationToken = default);
139 [EditorBrowsable(EditorBrowsableState.Never)]
140 public virtual AsyncCollectionResult GetMessagesAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options);
141 [EditorBrowsable(EditorBrowsableState.Never)]
142 public virtual ClientResult GetRun(string threadId, string runId, RequestOptions options);
143 public virtual ClientResult<ThreadRun> GetRun(string threadId, string runId, CancellationToken cancellationToken = default);
144 [EditorBrowsable(EditorBrowsableState.Never)]
145 public virtual Task<ClientResult> GetRunAsync(string threadId, string runId, RequestOptions options);
146 public virtual Task<ClientResult<ThreadRun>> GetRunAsync(string threadId, string runId, CancellationToken cancellationToken = default);
147 public virtual CollectionResult<ThreadRun> GetRuns(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
148 public virtual CollectionResult<ThreadRun> GetRuns(string threadId, RunCollectionOptions options = null, CancellationToken cancellationToken = default);
149 [EditorBrowsable(EditorBrowsableState.Never)]
150 public virtual CollectionResult GetRuns(string threadId, int? limit, string order, string after, string before, RequestOptions options);
151 public virtual AsyncCollectionResult<ThreadRun> GetRunsAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
152 public virtual AsyncCollectionResult<ThreadRun> GetRunsAsync(string threadId, RunCollectionOptions options = null, CancellationToken cancellationToken = default);
153 [EditorBrowsable(EditorBrowsableState.Never)]
154 public virtual AsyncCollectionResult GetRunsAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options);
155 [EditorBrowsable(EditorBrowsableState.Never)]
156 public virtual ClientResult GetRunStep(string threadId, string runId, string stepId, RequestOptions options);
157 public virtual ClientResult<RunStep> GetRunStep(string threadId, string runId, string stepId, CancellationToken cancellationToken = default);
158 [EditorBrowsable(EditorBrowsableState.Never)]
159 public virtual Task<ClientResult> GetRunStepAsync(string threadId, string runId, string stepId, RequestOptions options);
160 public virtual Task<ClientResult<RunStep>> GetRunStepAsync(string threadId, string runId, string stepId, CancellationToken cancellationToken = default);
161 public virtual CollectionResult<RunStep> GetRunSteps(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
162 public virtual CollectionResult<RunStep> GetRunSteps(string threadId, string runId, RunStepCollectionOptions options = null, CancellationToken cancellationToken = default);
163 [EditorBrowsable(EditorBrowsableState.Never)]
164 public virtual CollectionResult GetRunSteps(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options);
165 public virtual AsyncCollectionResult<RunStep> GetRunStepsAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
166 public virtual AsyncCollectionResult<RunStep> GetRunStepsAsync(string threadId, string runId, RunStepCollectionOptions options = null, CancellationToken cancellationToken = default);
167 [EditorBrowsable(EditorBrowsableState.Never)]
168 public virtual AsyncCollectionResult GetRunStepsAsync(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options);
169 [EditorBrowsable(EditorBrowsableState.Never)]
170 public virtual ClientResult GetThread(string threadId, RequestOptions options);
171 public virtual ClientResult<AssistantThread> GetThread(string threadId, CancellationToken cancellationToken = default);
172 [EditorBrowsable(EditorBrowsableState.Never)]
173 public virtual Task<ClientResult> GetThreadAsync(string threadId, RequestOptions options);
174 public virtual Task<ClientResult<AssistantThread>> GetThreadAsync(string threadId, CancellationToken cancellationToken = default);
175 public virtual ClientResult<Assistant> ModifyAssistant(string assistantId, AssistantModificationOptions options, CancellationToken cancellationToken = default);
176 [EditorBrowsable(EditorBrowsableState.Never)]
177 public virtual ClientResult ModifyAssistant(string assistantId, BinaryContent content, RequestOptions options = null);
178 public virtual Task<ClientResult<Assistant>> ModifyAssistantAsync(string assistantId, AssistantModificationOptions options, CancellationToken cancellationToken = default);
179 [EditorBrowsable(EditorBrowsableState.Never)]
180 public virtual Task<ClientResult> ModifyAssistantAsync(string assistantId, BinaryContent content, RequestOptions options = null);
181 public virtual ClientResult<ThreadMessage> ModifyMessage(string threadId, string messageId, MessageModificationOptions options, CancellationToken cancellationToken = default);
182 [EditorBrowsable(EditorBrowsableState.Never)]
183 public virtual ClientResult ModifyMessage(string threadId, string messageId, BinaryContent content, RequestOptions options = null);
184 public virtual Task<ClientResult<ThreadMessage>> ModifyMessageAsync(string threadId, string messageId, MessageModificationOptions options, CancellationToken cancellationToken = default);
185 [EditorBrowsable(EditorBrowsableState.Never)]
186 public virtual Task<ClientResult> ModifyMessageAsync(string threadId, string messageId, BinaryContent content, RequestOptions options = null);
187 [EditorBrowsable(EditorBrowsableState.Never)]
188 public virtual ClientResult ModifyRun(string threadId, string runId, BinaryContent content, RequestOptions options = null);
189 [EditorBrowsable(EditorBrowsableState.Never)]
190 public virtual Task<ClientResult> ModifyRunAsync(string threadId, string runId, BinaryContent content, RequestOptions options = null);
191 public virtual ClientResult<AssistantThread> ModifyThread(string threadId, ThreadModificationOptions options, CancellationToken cancellationToken = default);
192 [EditorBrowsable(EditorBrowsableState.Never)]
193 public virtual ClientResult ModifyThread(string threadId, BinaryContent content, RequestOptions options = null);
194 public virtual Task<ClientResult<AssistantThread>> ModifyThreadAsync(string threadId, ThreadModificationOptions options, CancellationToken cancellationToken = default);
195 [EditorBrowsable(EditorBrowsableState.Never)]
196 public virtual Task<ClientResult> ModifyThreadAsync(string threadId, BinaryContent content, RequestOptions options = null);
197 [EditorBrowsable(EditorBrowsableState.Never)]
198 public virtual ClientResult SubmitToolOutputsToRun(string threadId, string runId, BinaryContent content, RequestOptions options = null);
199 public virtual ClientResult<ThreadRun> SubmitToolOutputsToRun(string threadId, string runId, IEnumerable<ToolOutput> toolOutputs, CancellationToken cancellationToken = default);
200 [EditorBrowsable(EditorBrowsableState.Never)]
201 public virtual Task<ClientResult> SubmitToolOutputsToRunAsync(string threadId, string runId, BinaryContent content, RequestOptions options = null);
202 public virtual Task<ClientResult<ThreadRun>> SubmitToolOutputsToRunAsync(string threadId, string runId, IEnumerable<ToolOutput> toolOutputs, CancellationToken cancellationToken = default);
203 public virtual CollectionResult<StreamingUpdate> SubmitToolOutputsToRunStreaming(string threadId, string runId, IEnumerable<ToolOutput> toolOutputs, CancellationToken cancellationToken = default);
204 public virtual AsyncCollectionResult<StreamingUpdate> SubmitToolOutputsToRunStreamingAsync(string threadId, string runId, IEnumerable<ToolOutput> toolOutputs, CancellationToken cancellationToken = default);
205 }
206 public class AssistantCollectionOptions {
207 public string AfterId { get; set; }
208 public string BeforeId { get; set; }
209 public AssistantCollectionOrder? Order { get; set; }
210 public int? PageSizeLimit { get; set; }
211 }
212 public readonly partial struct AssistantCollectionOrder : IEquatable<AssistantCollectionOrder> {
213 private readonly object _dummy;
214 private readonly int _dummyPrimitive;
215 public AssistantCollectionOrder(string value);
216 public static AssistantCollectionOrder Ascending { get; }
217 public static AssistantCollectionOrder Descending { get; }
218 public readonly bool Equals(AssistantCollectionOrder other);
219 [EditorBrowsable(EditorBrowsableState.Never)]
220 public override readonly bool Equals(object obj);
221 [EditorBrowsable(EditorBrowsableState.Never)]
222 public override readonly int GetHashCode();
223 public static bool operator ==(AssistantCollectionOrder left, AssistantCollectionOrder right);
224 public static implicit operator AssistantCollectionOrder(string value);
225 public static bool operator !=(AssistantCollectionOrder left, AssistantCollectionOrder right);
226 public override readonly string ToString();
227 }
228 public class AssistantCreationOptions : IJsonModel<AssistantCreationOptions>, IPersistableModel<AssistantCreationOptions> {
229 public string Description { get; set; }
230 public string Instructions { get; set; }
231 public IDictionary<string, string> Metadata { get; set; }
232 public string Name { get; set; }
233 public float? NucleusSamplingFactor { get; set; }
234 public AssistantResponseFormat ResponseFormat { get; set; }
235 public float? Temperature { get; set; }
236 public ToolResources ToolResources { get; set; }
237 public IList<ToolDefinition> Tools { get; }
238 AssistantCreationOptions IJsonModel<AssistantCreationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
239 void IJsonModel<AssistantCreationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
240 AssistantCreationOptions IPersistableModel<AssistantCreationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
241 string IPersistableModel<AssistantCreationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
242 BinaryData IPersistableModel<AssistantCreationOptions>.Write(ModelReaderWriterOptions options);
243 }
244 public class AssistantDeletionResult : IJsonModel<AssistantDeletionResult>, IPersistableModel<AssistantDeletionResult> {
245 public string AssistantId { get; }
246 public bool Deleted { get; }
247 AssistantDeletionResult IJsonModel<AssistantDeletionResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
248 void IJsonModel<AssistantDeletionResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
249 AssistantDeletionResult IPersistableModel<AssistantDeletionResult>.Create(BinaryData data, ModelReaderWriterOptions options);
250 string IPersistableModel<AssistantDeletionResult>.GetFormatFromOptions(ModelReaderWriterOptions options);
251 BinaryData IPersistableModel<AssistantDeletionResult>.Write(ModelReaderWriterOptions options);
252 }
253 public class AssistantModificationOptions : IJsonModel<AssistantModificationOptions>, IPersistableModel<AssistantModificationOptions> {
254 public IList<ToolDefinition> DefaultTools { get; }
255 public string Description { get; set; }
256 public string Instructions { get; set; }
257 public IDictionary<string, string> Metadata { get; set; }
258 public string Model { get; set; }
259 public string Name { get; set; }
260 public float? NucleusSamplingFactor { get; set; }
261 public AssistantResponseFormat ResponseFormat { get; set; }
262 public float? Temperature { get; set; }
263 public ToolResources ToolResources { get; set; }
264 AssistantModificationOptions IJsonModel<AssistantModificationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
265 void IJsonModel<AssistantModificationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
266 AssistantModificationOptions IPersistableModel<AssistantModificationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
267 string IPersistableModel<AssistantModificationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
268 BinaryData IPersistableModel<AssistantModificationOptions>.Write(ModelReaderWriterOptions options);
269 }
270 public abstract class AssistantResponseFormat : IEquatable<AssistantResponseFormat>, IEquatable<string>, IJsonModel<AssistantResponseFormat>, IPersistableModel<AssistantResponseFormat> {
271 public static AssistantResponseFormat Auto { get; }
272 public static AssistantResponseFormat JsonObject { get; }
273 public static AssistantResponseFormat Text { get; }
274 public static AssistantResponseFormat CreateAutoFormat();
275 public static AssistantResponseFormat CreateJsonObjectFormat();
276 public static AssistantResponseFormat CreateJsonSchemaFormat(string name, BinaryData jsonSchema, string description = null, bool? strictSchemaEnabled = null);
277 public static AssistantResponseFormat CreateTextFormat();
278 [EditorBrowsable(EditorBrowsableState.Never)]
279 public override bool Equals(object obj);
280 [EditorBrowsable(EditorBrowsableState.Never)]
281 public override int GetHashCode();
282 [EditorBrowsable(EditorBrowsableState.Never)]
283 public static bool operator ==(AssistantResponseFormat first, AssistantResponseFormat second);
284 [EditorBrowsable(EditorBrowsableState.Never)]
285 public static implicit operator AssistantResponseFormat(string plainTextFormat);
286 [EditorBrowsable(EditorBrowsableState.Never)]
287 public static bool operator !=(AssistantResponseFormat first, AssistantResponseFormat second);
288 AssistantResponseFormat IJsonModel<AssistantResponseFormat>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
289 void IJsonModel<AssistantResponseFormat>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
290 AssistantResponseFormat IPersistableModel<AssistantResponseFormat>.Create(BinaryData data, ModelReaderWriterOptions options);
291 string IPersistableModel<AssistantResponseFormat>.GetFormatFromOptions(ModelReaderWriterOptions options);
292 BinaryData IPersistableModel<AssistantResponseFormat>.Write(ModelReaderWriterOptions options);
293 [EditorBrowsable(EditorBrowsableState.Never)]
294 bool IEquatable<AssistantResponseFormat>.Equals(AssistantResponseFormat other);
295 [EditorBrowsable(EditorBrowsableState.Never)]
296 bool IEquatable<string>.Equals(string other);
297 public override string ToString();
298 }
299 public class AssistantThread : IJsonModel<AssistantThread>, IPersistableModel<AssistantThread> {
300 public DateTimeOffset CreatedAt { get; }
301 public string Id { get; }
302 public IReadOnlyDictionary<string, string> Metadata { get; }
303 public ToolResources ToolResources { get; }
304 AssistantThread IJsonModel<AssistantThread>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
305 void IJsonModel<AssistantThread>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
306 AssistantThread IPersistableModel<AssistantThread>.Create(BinaryData data, ModelReaderWriterOptions options);
307 string IPersistableModel<AssistantThread>.GetFormatFromOptions(ModelReaderWriterOptions options);
308 BinaryData IPersistableModel<AssistantThread>.Write(ModelReaderWriterOptions options);
309 }
310 public class CodeInterpreterToolDefinition : ToolDefinition, IJsonModel<CodeInterpreterToolDefinition>, IPersistableModel<CodeInterpreterToolDefinition> {
311 CodeInterpreterToolDefinition IJsonModel<CodeInterpreterToolDefinition>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
312 void IJsonModel<CodeInterpreterToolDefinition>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
313 CodeInterpreterToolDefinition IPersistableModel<CodeInterpreterToolDefinition>.Create(BinaryData data, ModelReaderWriterOptions options);
314 string IPersistableModel<CodeInterpreterToolDefinition>.GetFormatFromOptions(ModelReaderWriterOptions options);
315 BinaryData IPersistableModel<CodeInterpreterToolDefinition>.Write(ModelReaderWriterOptions options);
316 }
317 public class CodeInterpreterToolResources : IJsonModel<CodeInterpreterToolResources>, IPersistableModel<CodeInterpreterToolResources> {
318 public IList<string> FileIds { get; }
319 CodeInterpreterToolResources IJsonModel<CodeInterpreterToolResources>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
320 void IJsonModel<CodeInterpreterToolResources>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
321 CodeInterpreterToolResources IPersistableModel<CodeInterpreterToolResources>.Create(BinaryData data, ModelReaderWriterOptions options);
322 string IPersistableModel<CodeInterpreterToolResources>.GetFormatFromOptions(ModelReaderWriterOptions options);
323 BinaryData IPersistableModel<CodeInterpreterToolResources>.Write(ModelReaderWriterOptions options);
324 }
325 public readonly partial struct FileSearchRanker : IEquatable<FileSearchRanker> {
326 private readonly object _dummy;
327 private readonly int _dummyPrimitive;
328 public FileSearchRanker(string value);
329 public static FileSearchRanker Auto { get; }
330 public static FileSearchRanker Default20240821 { get; }
331 public readonly bool Equals(FileSearchRanker other);
332 [EditorBrowsable(EditorBrowsableState.Never)]
333 public override readonly bool Equals(object obj);
334 [EditorBrowsable(EditorBrowsableState.Never)]
335 public override readonly int GetHashCode();
336 public static bool operator ==(FileSearchRanker left, FileSearchRanker right);
337 public static implicit operator FileSearchRanker(string value);
338 public static bool operator !=(FileSearchRanker left, FileSearchRanker right);
339 public override readonly string ToString();
340 }
341 public class FileSearchRankingOptions : IJsonModel<FileSearchRankingOptions>, IPersistableModel<FileSearchRankingOptions> {
342 public FileSearchRankingOptions();
343 public FileSearchRankingOptions(float scoreThreshold);
344 public FileSearchRanker? Ranker { get; set; }
345 public required float ScoreThreshold { get; set; }
346 FileSearchRankingOptions IJsonModel<FileSearchRankingOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
347 void IJsonModel<FileSearchRankingOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
348 FileSearchRankingOptions IPersistableModel<FileSearchRankingOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
349 string IPersistableModel<FileSearchRankingOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
350 BinaryData IPersistableModel<FileSearchRankingOptions>.Write(ModelReaderWriterOptions options);
351 }
352 public class FileSearchToolDefinition : ToolDefinition, IJsonModel<FileSearchToolDefinition>, IPersistableModel<FileSearchToolDefinition> {
353 public int? MaxResults { get; set; }
354 public FileSearchRankingOptions RankingOptions { get; set; }
355 FileSearchToolDefinition IJsonModel<FileSearchToolDefinition>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
356 void IJsonModel<FileSearchToolDefinition>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
357 FileSearchToolDefinition IPersistableModel<FileSearchToolDefinition>.Create(BinaryData data, ModelReaderWriterOptions options);
358 string IPersistableModel<FileSearchToolDefinition>.GetFormatFromOptions(ModelReaderWriterOptions options);
359 BinaryData IPersistableModel<FileSearchToolDefinition>.Write(ModelReaderWriterOptions options);
360 }
361 public class FileSearchToolResources : IJsonModel<FileSearchToolResources>, IPersistableModel<FileSearchToolResources> {
362 public IList<VectorStoreCreationHelper> NewVectorStores { get; }
363 public IList<string> VectorStoreIds { get; }
364 FileSearchToolResources IJsonModel<FileSearchToolResources>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
365 void IJsonModel<FileSearchToolResources>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
366 FileSearchToolResources IPersistableModel<FileSearchToolResources>.Create(BinaryData data, ModelReaderWriterOptions options);
367 string IPersistableModel<FileSearchToolResources>.GetFormatFromOptions(ModelReaderWriterOptions options);
368 BinaryData IPersistableModel<FileSearchToolResources>.Write(ModelReaderWriterOptions options);
369 }
370 public class FunctionToolDefinition : ToolDefinition, IJsonModel<FunctionToolDefinition>, IPersistableModel<FunctionToolDefinition> {
371 public FunctionToolDefinition();
372 public FunctionToolDefinition(string name);
373 public string Description { get; set; }
374 public required string FunctionName { get; set; }
375 public BinaryData Parameters { get; set; }
376 public bool? StrictParameterSchemaEnabled { get; set; }
377 FunctionToolDefinition IJsonModel<FunctionToolDefinition>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
378 void IJsonModel<FunctionToolDefinition>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
379 FunctionToolDefinition IPersistableModel<FunctionToolDefinition>.Create(BinaryData data, ModelReaderWriterOptions options);
380 string IPersistableModel<FunctionToolDefinition>.GetFormatFromOptions(ModelReaderWriterOptions options);
381 BinaryData IPersistableModel<FunctionToolDefinition>.Write(ModelReaderWriterOptions options);
382 }
383 public class MessageCollectionOptions {
384 public string AfterId { get; set; }
385 public string BeforeId { get; set; }
386 public MessageCollectionOrder? Order { get; set; }
387 public int? PageSizeLimit { get; set; }
388 }
389 public readonly partial struct MessageCollectionOrder : IEquatable<MessageCollectionOrder> {
390 private readonly object _dummy;
391 private readonly int _dummyPrimitive;
392 public MessageCollectionOrder(string value);
393 public static MessageCollectionOrder Ascending { get; }
394 public static MessageCollectionOrder Descending { get; }
395 public readonly bool Equals(MessageCollectionOrder other);
396 [EditorBrowsable(EditorBrowsableState.Never)]
397 public override readonly bool Equals(object obj);
398 [EditorBrowsable(EditorBrowsableState.Never)]
399 public override readonly int GetHashCode();
400 public static bool operator ==(MessageCollectionOrder left, MessageCollectionOrder right);
401 public static implicit operator MessageCollectionOrder(string value);
402 public static bool operator !=(MessageCollectionOrder left, MessageCollectionOrder right);
403 public override readonly string ToString();
404 }
405 public abstract class MessageContent : IJsonModel<MessageContent>, IPersistableModel<MessageContent> {
406 public MessageImageDetail? ImageDetail { get; }
407 public string ImageFileId { get; }
408 public Uri ImageUri { get; }
409 public string Refusal { get; }
410 public string Text { get; }
411 public IReadOnlyList<TextAnnotation> TextAnnotations { get; }
412 public static MessageContent FromImageFileId(string imageFileId, MessageImageDetail? detail = null);
413 public static MessageContent FromImageUri(Uri imageUri, MessageImageDetail? detail = null);
414 public static MessageContent FromText(string text);
415 public static implicit operator MessageContent(string value);
416 MessageContent IJsonModel<MessageContent>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
417 void IJsonModel<MessageContent>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
418 MessageContent IPersistableModel<MessageContent>.Create(BinaryData data, ModelReaderWriterOptions options);
419 string IPersistableModel<MessageContent>.GetFormatFromOptions(ModelReaderWriterOptions options);
420 BinaryData IPersistableModel<MessageContent>.Write(ModelReaderWriterOptions options);
421 }
422 public class MessageContentUpdate : StreamingUpdate {
423 public MessageImageDetail? ImageDetail { get; }
424 public string ImageFileId { get; }
425 public string MessageId { get; }
426 public int MessageIndex { get; }
427 public string RefusalUpdate { get; }
428 public MessageRole? Role { get; }
429 public string Text { get; }
430 public TextAnnotationUpdate TextAnnotation { get; }
431 }
432 public class MessageCreationAttachment : IJsonModel<MessageCreationAttachment>, IPersistableModel<MessageCreationAttachment> {
433 public MessageCreationAttachment(string fileId, IEnumerable<ToolDefinition> tools);
434 public string FileId { get; }
435 public IReadOnlyList<ToolDefinition> Tools { get; }
436 MessageCreationAttachment IJsonModel<MessageCreationAttachment>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
437 void IJsonModel<MessageCreationAttachment>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
438 MessageCreationAttachment IPersistableModel<MessageCreationAttachment>.Create(BinaryData data, ModelReaderWriterOptions options);
439 string IPersistableModel<MessageCreationAttachment>.GetFormatFromOptions(ModelReaderWriterOptions options);
440 BinaryData IPersistableModel<MessageCreationAttachment>.Write(ModelReaderWriterOptions options);
441 }
442 public class MessageCreationOptions : IJsonModel<MessageCreationOptions>, IPersistableModel<MessageCreationOptions> {
443 public IList<MessageCreationAttachment> Attachments { get; set; }
444 public IDictionary<string, string> Metadata { get; set; }
445 MessageCreationOptions IJsonModel<MessageCreationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
446 void IJsonModel<MessageCreationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
447 MessageCreationOptions IPersistableModel<MessageCreationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
448 string IPersistableModel<MessageCreationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
449 BinaryData IPersistableModel<MessageCreationOptions>.Write(ModelReaderWriterOptions options);
450 }
451 public class MessageDeletionResult : IJsonModel<MessageDeletionResult>, IPersistableModel<MessageDeletionResult> {
452 public bool Deleted { get; }
453 public string MessageId { get; }
454 MessageDeletionResult IJsonModel<MessageDeletionResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
455 void IJsonModel<MessageDeletionResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
456 MessageDeletionResult IPersistableModel<MessageDeletionResult>.Create(BinaryData data, ModelReaderWriterOptions options);
457 string IPersistableModel<MessageDeletionResult>.GetFormatFromOptions(ModelReaderWriterOptions options);
458 BinaryData IPersistableModel<MessageDeletionResult>.Write(ModelReaderWriterOptions options);
459 }
460 public class MessageFailureDetails : IJsonModel<MessageFailureDetails>, IPersistableModel<MessageFailureDetails> {
461 public MessageFailureReason Reason { get; }
462 MessageFailureDetails IJsonModel<MessageFailureDetails>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
463 void IJsonModel<MessageFailureDetails>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
464 MessageFailureDetails IPersistableModel<MessageFailureDetails>.Create(BinaryData data, ModelReaderWriterOptions options);
465 string IPersistableModel<MessageFailureDetails>.GetFormatFromOptions(ModelReaderWriterOptions options);
466 BinaryData IPersistableModel<MessageFailureDetails>.Write(ModelReaderWriterOptions options);
467 }
468 public readonly partial struct MessageFailureReason : IEquatable<MessageFailureReason> {
469 private readonly object _dummy;
470 private readonly int _dummyPrimitive;
471 public MessageFailureReason(string value);
472 public static MessageFailureReason ContentFilter { get; }
473 public static MessageFailureReason MaxTokens { get; }
474 public static MessageFailureReason RunCancelled { get; }
475 public static MessageFailureReason RunExpired { get; }
476 public static MessageFailureReason RunFailed { get; }
477 public readonly bool Equals(MessageFailureReason other);
478 [EditorBrowsable(EditorBrowsableState.Never)]
479 public override readonly bool Equals(object obj);
480 [EditorBrowsable(EditorBrowsableState.Never)]
481 public override readonly int GetHashCode();
482 public static bool operator ==(MessageFailureReason left, MessageFailureReason right);
483 public static implicit operator MessageFailureReason(string value);
484 public static bool operator !=(MessageFailureReason left, MessageFailureReason right);
485 public override readonly string ToString();
486 }
487 public enum MessageImageDetail {
488 Auto = 0,
489 Low = 1,
490 High = 2
491 }
492 public class MessageModificationOptions : IJsonModel<MessageModificationOptions>, IPersistableModel<MessageModificationOptions> {
493 public IDictionary<string, string> Metadata { get; set; }
494 MessageModificationOptions IJsonModel<MessageModificationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
495 void IJsonModel<MessageModificationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
496 MessageModificationOptions IPersistableModel<MessageModificationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
497 string IPersistableModel<MessageModificationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
498 BinaryData IPersistableModel<MessageModificationOptions>.Write(ModelReaderWriterOptions options);
499 }
500 public enum MessageRole {
501 User = 0,
502 Assistant = 1
503 }
504 public readonly partial struct MessageStatus : IEquatable<MessageStatus> {
505 private readonly object _dummy;
506 private readonly int _dummyPrimitive;
507 public MessageStatus(string value);
508 public static MessageStatus Completed { get; }
509 public static MessageStatus Incomplete { get; }
510 public static MessageStatus InProgress { get; }
511 public readonly bool Equals(MessageStatus other);
512 [EditorBrowsable(EditorBrowsableState.Never)]
513 public override readonly bool Equals(object obj);
514 [EditorBrowsable(EditorBrowsableState.Never)]
515 public override readonly int GetHashCode();
516 public static bool operator ==(MessageStatus left, MessageStatus right);
517 public static implicit operator MessageStatus(string value);
518 public static bool operator !=(MessageStatus left, MessageStatus right);
519 public override readonly string ToString();
520 }
521 public class MessageStatusUpdate : StreamingUpdate<ThreadMessage> {
522 }
523 public abstract class RequiredAction {
524 public string FunctionArguments { get; }
525 public string FunctionName { get; }
526 public string ToolCallId { get; }
527 }
528 public class RequiredActionUpdate : RunUpdate {
529 public string FunctionArguments { get; }
530 public string FunctionName { get; }
531 public string ToolCallId { get; }
532 public ThreadRun GetThreadRun();
533 }
534 public class RunCollectionOptions {
535 public string AfterId { get; set; }
536 public string BeforeId { get; set; }
537 public RunCollectionOrder? Order { get; set; }
538 public int? PageSizeLimit { get; set; }
539 }
540 public readonly partial struct RunCollectionOrder : IEquatable<RunCollectionOrder> {
541 private readonly object _dummy;
542 private readonly int _dummyPrimitive;
543 public RunCollectionOrder(string value);
544 public static RunCollectionOrder Ascending { get; }
545 public static RunCollectionOrder Descending { get; }
546 public readonly bool Equals(RunCollectionOrder other);
547 [EditorBrowsable(EditorBrowsableState.Never)]
548 public override readonly bool Equals(object obj);
549 [EditorBrowsable(EditorBrowsableState.Never)]
550 public override readonly int GetHashCode();
551 public static bool operator ==(RunCollectionOrder left, RunCollectionOrder right);
552 public static implicit operator RunCollectionOrder(string value);
553 public static bool operator !=(RunCollectionOrder left, RunCollectionOrder right);
554 public override readonly string ToString();
555 }
556 public class RunCreationOptions : IJsonModel<RunCreationOptions>, IPersistableModel<RunCreationOptions> {
557 public string AdditionalInstructions { get; set; }
558 public IList<ThreadInitializationMessage> AdditionalMessages { get; }
559 public bool? AllowParallelToolCalls { get; set; }
560 public string InstructionsOverride { get; set; }
561 public int? MaxInputTokenCount { get; set; }
562 public int? MaxOutputTokenCount { get; set; }
563 public IDictionary<string, string> Metadata { get; }
564 public string ModelOverride { get; set; }
565 public float? NucleusSamplingFactor { get; set; }
566 public AssistantResponseFormat ResponseFormat { get; set; }
567 public float? Temperature { get; set; }
568 public ToolConstraint ToolConstraint { get; set; }
569 public IList<ToolDefinition> ToolsOverride { get; }
570 public RunTruncationStrategy TruncationStrategy { get; set; }
571 RunCreationOptions IJsonModel<RunCreationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
572 void IJsonModel<RunCreationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
573 RunCreationOptions IPersistableModel<RunCreationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
574 string IPersistableModel<RunCreationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
575 BinaryData IPersistableModel<RunCreationOptions>.Write(ModelReaderWriterOptions options);
576 }
577 public class RunError : IJsonModel<RunError>, IPersistableModel<RunError> {
578 public RunErrorCode Code { get; }
579 public string Message { get; }
580 RunError IJsonModel<RunError>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
581 void IJsonModel<RunError>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
582 RunError IPersistableModel<RunError>.Create(BinaryData data, ModelReaderWriterOptions options);
583 string IPersistableModel<RunError>.GetFormatFromOptions(ModelReaderWriterOptions options);
584 BinaryData IPersistableModel<RunError>.Write(ModelReaderWriterOptions options);
585 }
586 public readonly partial struct RunErrorCode : IEquatable<RunErrorCode> {
587 private readonly object _dummy;
588 private readonly int _dummyPrimitive;
589 public RunErrorCode(string value);
590 public static RunErrorCode InvalidPrompt { get; }
591 public static RunErrorCode RateLimitExceeded { get; }
592 public static RunErrorCode ServerError { get; }
593 public readonly bool Equals(RunErrorCode other);
594 [EditorBrowsable(EditorBrowsableState.Never)]
595 public override readonly bool Equals(object obj);
596 [EditorBrowsable(EditorBrowsableState.Never)]
597 public override readonly int GetHashCode();
598 public static bool operator ==(RunErrorCode left, RunErrorCode right);
599 public static implicit operator RunErrorCode(string value);
600 public static bool operator !=(RunErrorCode left, RunErrorCode right);
601 public override readonly string ToString();
602 }
603 public class RunIncompleteDetails : IJsonModel<RunIncompleteDetails>, IPersistableModel<RunIncompleteDetails> {
604 public RunIncompleteReason? Reason { get; }
605 RunIncompleteDetails IJsonModel<RunIncompleteDetails>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
606 void IJsonModel<RunIncompleteDetails>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
607 RunIncompleteDetails IPersistableModel<RunIncompleteDetails>.Create(BinaryData data, ModelReaderWriterOptions options);
608 string IPersistableModel<RunIncompleteDetails>.GetFormatFromOptions(ModelReaderWriterOptions options);
609 BinaryData IPersistableModel<RunIncompleteDetails>.Write(ModelReaderWriterOptions options);
610 }
611 public readonly partial struct RunIncompleteReason : IEquatable<RunIncompleteReason> {
612 private readonly object _dummy;
613 private readonly int _dummyPrimitive;
614 public RunIncompleteReason(string value);
615 public static RunIncompleteReason MaxInputTokenCount { get; }
616 public static RunIncompleteReason MaxOutputTokenCount { get; }
617 public readonly bool Equals(RunIncompleteReason other);
618 [EditorBrowsable(EditorBrowsableState.Never)]
619 public override readonly bool Equals(object obj);
620 [EditorBrowsable(EditorBrowsableState.Never)]
621 public override readonly int GetHashCode();
622 public static bool operator ==(RunIncompleteReason left, RunIncompleteReason right);
623 public static implicit operator RunIncompleteReason(string value);
624 public static bool operator !=(RunIncompleteReason left, RunIncompleteReason right);
625 public override readonly string ToString();
626 }
627 public class RunModificationOptions : IJsonModel<RunModificationOptions>, IPersistableModel<RunModificationOptions> {
628 public IDictionary<string, string> Metadata { get; set; }
629 RunModificationOptions IJsonModel<RunModificationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
630 void IJsonModel<RunModificationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
631 RunModificationOptions IPersistableModel<RunModificationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
632 string IPersistableModel<RunModificationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
633 BinaryData IPersistableModel<RunModificationOptions>.Write(ModelReaderWriterOptions options);
634 }
635 public readonly partial struct RunStatus : IEquatable<RunStatus> {
636 private readonly object _dummy;
637 private readonly int _dummyPrimitive;
638 public RunStatus(string value);
639 public static RunStatus Cancelled { get; }
640 public static RunStatus Cancelling { get; }
641 public static RunStatus Completed { get; }
642 public static RunStatus Expired { get; }
643 public static RunStatus Failed { get; }
644 public static RunStatus Incomplete { get; }
645 public static RunStatus InProgress { get; }
646 public bool IsTerminal { get; }
647 public static RunStatus Queued { get; }
648 public static RunStatus RequiresAction { get; }
649 public readonly bool Equals(RunStatus other);
650 [EditorBrowsable(EditorBrowsableState.Never)]
651 public override readonly bool Equals(object obj);
652 [EditorBrowsable(EditorBrowsableState.Never)]
653 public override readonly int GetHashCode();
654 public static bool operator ==(RunStatus left, RunStatus right);
655 public static implicit operator RunStatus(string value);
656 public static bool operator !=(RunStatus left, RunStatus right);
657 public override readonly string ToString();
658 }
659 public class RunStep : IJsonModel<RunStep>, IPersistableModel<RunStep> {
660 public string AssistantId { get; }
661 public DateTimeOffset? CancelledAt { get; }
662 public DateTimeOffset? CompletedAt { get; }
663 public DateTimeOffset CreatedAt { get; }
664 public RunStepDetails Details { get; }
665 public DateTimeOffset? ExpiredAt { get; }
666 public DateTimeOffset? FailedAt { get; }
667 public string Id { get; }
668 public RunStepError LastError { get; }
669 public IReadOnlyDictionary<string, string> Metadata { get; }
670 public string RunId { get; }
671 public RunStepStatus Status { get; }
672 public string ThreadId { get; }
673 public RunStepType Type { get; }
674 public RunStepTokenUsage Usage { get; }
675 RunStep IJsonModel<RunStep>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
676 void IJsonModel<RunStep>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
677 RunStep IPersistableModel<RunStep>.Create(BinaryData data, ModelReaderWriterOptions options);
678 string IPersistableModel<RunStep>.GetFormatFromOptions(ModelReaderWriterOptions options);
679 BinaryData IPersistableModel<RunStep>.Write(ModelReaderWriterOptions options);
680 }
681 public abstract class RunStepCodeInterpreterOutput : IJsonModel<RunStepCodeInterpreterOutput>, IPersistableModel<RunStepCodeInterpreterOutput> {
682 public string ImageFileId { get; }
683 public string Logs { get; }
684 RunStepCodeInterpreterOutput IJsonModel<RunStepCodeInterpreterOutput>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
685 void IJsonModel<RunStepCodeInterpreterOutput>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
686 RunStepCodeInterpreterOutput IPersistableModel<RunStepCodeInterpreterOutput>.Create(BinaryData data, ModelReaderWriterOptions options);
687 string IPersistableModel<RunStepCodeInterpreterOutput>.GetFormatFromOptions(ModelReaderWriterOptions options);
688 BinaryData IPersistableModel<RunStepCodeInterpreterOutput>.Write(ModelReaderWriterOptions options);
689 }
690 public class RunStepCollectionOptions {
691 public string AfterId { get; set; }
692 public string BeforeId { get; set; }
693 public RunStepCollectionOrder? Order { get; set; }
694 public int? PageSizeLimit { get; set; }
695 }
696 public readonly partial struct RunStepCollectionOrder : IEquatable<RunStepCollectionOrder> {
697 private readonly object _dummy;
698 private readonly int _dummyPrimitive;
699 public RunStepCollectionOrder(string value);
700 public static RunStepCollectionOrder Ascending { get; }
701 public static RunStepCollectionOrder Descending { get; }
702 public readonly bool Equals(RunStepCollectionOrder other);
703 [EditorBrowsable(EditorBrowsableState.Never)]
704 public override readonly bool Equals(object obj);
705 [EditorBrowsable(EditorBrowsableState.Never)]
706 public override readonly int GetHashCode();
707 public static bool operator ==(RunStepCollectionOrder left, RunStepCollectionOrder right);
708 public static implicit operator RunStepCollectionOrder(string value);
709 public static bool operator !=(RunStepCollectionOrder left, RunStepCollectionOrder right);
710 public override readonly string ToString();
711 }
712 public abstract class RunStepDetails : IJsonModel<RunStepDetails>, IPersistableModel<RunStepDetails> {
713 public string CreatedMessageId { get; }
714 public IReadOnlyList<RunStepToolCall> ToolCalls { get; }
715 RunStepDetails IJsonModel<RunStepDetails>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
716 void IJsonModel<RunStepDetails>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
717 RunStepDetails IPersistableModel<RunStepDetails>.Create(BinaryData data, ModelReaderWriterOptions options);
718 string IPersistableModel<RunStepDetails>.GetFormatFromOptions(ModelReaderWriterOptions options);
719 BinaryData IPersistableModel<RunStepDetails>.Write(ModelReaderWriterOptions options);
720 }
721 public class RunStepDetailsUpdate : StreamingUpdate {
722 public string CodeInterpreterInput { get; }
723 public IReadOnlyList<RunStepUpdateCodeInterpreterOutput> CodeInterpreterOutputs { get; }
724 public string CreatedMessageId { get; }
725 public string FunctionArguments { get; }
726 public string FunctionName { get; }
727 public string FunctionOutput { get; }
728 public string StepId { get; }
729 public string ToolCallId { get; }
730 public int? ToolCallIndex { get; }
731 }
732 public class RunStepError : IJsonModel<RunStepError>, IPersistableModel<RunStepError> {
733 public RunStepErrorCode Code { get; }
734 public string Message { get; }
735 RunStepError IJsonModel<RunStepError>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
736 void IJsonModel<RunStepError>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
737 RunStepError IPersistableModel<RunStepError>.Create(BinaryData data, ModelReaderWriterOptions options);
738 string IPersistableModel<RunStepError>.GetFormatFromOptions(ModelReaderWriterOptions options);
739 BinaryData IPersistableModel<RunStepError>.Write(ModelReaderWriterOptions options);
740 }
741 public readonly partial struct RunStepErrorCode : IEquatable<RunStepErrorCode> {
742 private readonly object _dummy;
743 private readonly int _dummyPrimitive;
744 public RunStepErrorCode(string value);
745 public static RunStepErrorCode RateLimitExceeded { get; }
746 public static RunStepErrorCode ServerError { get; }
747 public readonly bool Equals(RunStepErrorCode other);
748 [EditorBrowsable(EditorBrowsableState.Never)]
749 public override readonly bool Equals(object obj);
750 [EditorBrowsable(EditorBrowsableState.Never)]
751 public override readonly int GetHashCode();
752 public static bool operator ==(RunStepErrorCode left, RunStepErrorCode right);
753 public static implicit operator RunStepErrorCode(string value);
754 public static bool operator !=(RunStepErrorCode left, RunStepErrorCode right);
755 public override readonly string ToString();
756 }
757 public class RunStepFileSearchResult : IJsonModel<RunStepFileSearchResult>, IPersistableModel<RunStepFileSearchResult> {
758 public string FileId { get; }
759 public string FileName { get; }
760 public float Score { get; }
761 RunStepFileSearchResult IJsonModel<RunStepFileSearchResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
762 void IJsonModel<RunStepFileSearchResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
763 RunStepFileSearchResult IPersistableModel<RunStepFileSearchResult>.Create(BinaryData data, ModelReaderWriterOptions options);
764 string IPersistableModel<RunStepFileSearchResult>.GetFormatFromOptions(ModelReaderWriterOptions options);
765 BinaryData IPersistableModel<RunStepFileSearchResult>.Write(ModelReaderWriterOptions options);
766 }
767 public readonly partial struct RunStepStatus : IEquatable<RunStepStatus> {
768 private readonly object _dummy;
769 private readonly int _dummyPrimitive;
770 public RunStepStatus(string value);
771 public static RunStepStatus Cancelled { get; }
772 public static RunStepStatus Completed { get; }
773 public static RunStepStatus Expired { get; }
774 public static RunStepStatus Failed { get; }
775 public static RunStepStatus InProgress { get; }
776 public readonly bool Equals(RunStepStatus other);
777 [EditorBrowsable(EditorBrowsableState.Never)]
778 public override readonly bool Equals(object obj);
779 [EditorBrowsable(EditorBrowsableState.Never)]
780 public override readonly int GetHashCode();
781 public static bool operator ==(RunStepStatus left, RunStepStatus right);
782 public static implicit operator RunStepStatus(string value);
783 public static bool operator !=(RunStepStatus left, RunStepStatus right);
784 public override readonly string ToString();
785 }
786 public class RunStepTokenUsage : IJsonModel<RunStepTokenUsage>, IPersistableModel<RunStepTokenUsage> {
787 public int InputTokenCount { get; }
788 public int OutputTokenCount { get; }
789 public int TotalTokenCount { get; }
790 RunStepTokenUsage IJsonModel<RunStepTokenUsage>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
791 void IJsonModel<RunStepTokenUsage>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
792 RunStepTokenUsage IPersistableModel<RunStepTokenUsage>.Create(BinaryData data, ModelReaderWriterOptions options);
793 string IPersistableModel<RunStepTokenUsage>.GetFormatFromOptions(ModelReaderWriterOptions options);
794 BinaryData IPersistableModel<RunStepTokenUsage>.Write(ModelReaderWriterOptions options);
795 }
796 public abstract class RunStepToolCall : IJsonModel<RunStepToolCall>, IPersistableModel<RunStepToolCall> {
797 public string CodeInterpreterInput { get; }
798 public IReadOnlyList<RunStepCodeInterpreterOutput> CodeInterpreterOutputs { get; }
799 public FileSearchRanker? FileSearchRanker { get; }
800 public IReadOnlyList<RunStepFileSearchResult> FileSearchResults { get; }
801 public float? FileSearchScoreThreshold { get; }
802 public string FunctionArguments { get; }
803 public string FunctionName { get; }
804 public string FunctionOutput { get; }
805 public string ToolCallId { get; }
806 public RunStepToolCallKind ToolKind { get; }
807 RunStepToolCall IJsonModel<RunStepToolCall>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
808 void IJsonModel<RunStepToolCall>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
809 RunStepToolCall IPersistableModel<RunStepToolCall>.Create(BinaryData data, ModelReaderWriterOptions options);
810 string IPersistableModel<RunStepToolCall>.GetFormatFromOptions(ModelReaderWriterOptions options);
811 BinaryData IPersistableModel<RunStepToolCall>.Write(ModelReaderWriterOptions options);
812 }
813 public enum RunStepToolCallKind {
814 Unknown = 0,
815 CodeInterpreter = 1,
816 FileSearch = 2,
817 Function = 3
818 }
819 public readonly partial struct RunStepType : IEquatable<RunStepType> {
820 private readonly object _dummy;
821 private readonly int _dummyPrimitive;
822 public RunStepType(string value);
823 public static RunStepType MessageCreation { get; }
824 public static RunStepType ToolCalls { get; }
825 public readonly bool Equals(RunStepType other);
826 [EditorBrowsable(EditorBrowsableState.Never)]
827 public override readonly bool Equals(object obj);
828 [EditorBrowsable(EditorBrowsableState.Never)]
829 public override readonly int GetHashCode();
830 public static bool operator ==(RunStepType left, RunStepType right);
831 public static implicit operator RunStepType(string value);
832 public static bool operator !=(RunStepType left, RunStepType right);
833 public override readonly string ToString();
834 }
835 public class RunStepUpdate : StreamingUpdate<RunStep> {
836 }
837 public abstract class RunStepUpdateCodeInterpreterOutput : IJsonModel<RunStepUpdateCodeInterpreterOutput>, IPersistableModel<RunStepUpdateCodeInterpreterOutput> {
838 public string ImageFileId { get; }
839 public string Logs { get; }
840 public int OutputIndex { get; }
841 RunStepUpdateCodeInterpreterOutput IJsonModel<RunStepUpdateCodeInterpreterOutput>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
842 void IJsonModel<RunStepUpdateCodeInterpreterOutput>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
843 RunStepUpdateCodeInterpreterOutput IPersistableModel<RunStepUpdateCodeInterpreterOutput>.Create(BinaryData data, ModelReaderWriterOptions options);
844 string IPersistableModel<RunStepUpdateCodeInterpreterOutput>.GetFormatFromOptions(ModelReaderWriterOptions options);
845 BinaryData IPersistableModel<RunStepUpdateCodeInterpreterOutput>.Write(ModelReaderWriterOptions options);
846 }
847 public class RunTokenUsage : IJsonModel<RunTokenUsage>, IPersistableModel<RunTokenUsage> {
848 public int InputTokenCount { get; }
849 public int OutputTokenCount { get; }
850 public int TotalTokenCount { get; }
851 RunTokenUsage IJsonModel<RunTokenUsage>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
852 void IJsonModel<RunTokenUsage>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
853 RunTokenUsage IPersistableModel<RunTokenUsage>.Create(BinaryData data, ModelReaderWriterOptions options);
854 string IPersistableModel<RunTokenUsage>.GetFormatFromOptions(ModelReaderWriterOptions options);
855 BinaryData IPersistableModel<RunTokenUsage>.Write(ModelReaderWriterOptions options);
856 }
857 public class RunTruncationStrategy : IJsonModel<RunTruncationStrategy>, IPersistableModel<RunTruncationStrategy> {
858 public static RunTruncationStrategy Auto { get; }
859 public int? LastMessages { get; }
860 public static RunTruncationStrategy CreateLastMessagesStrategy(int lastMessageCount);
861 RunTruncationStrategy IJsonModel<RunTruncationStrategy>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
862 void IJsonModel<RunTruncationStrategy>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
863 RunTruncationStrategy IPersistableModel<RunTruncationStrategy>.Create(BinaryData data, ModelReaderWriterOptions options);
864 string IPersistableModel<RunTruncationStrategy>.GetFormatFromOptions(ModelReaderWriterOptions options);
865 BinaryData IPersistableModel<RunTruncationStrategy>.Write(ModelReaderWriterOptions options);
866 }
867 public class RunUpdate : StreamingUpdate<ThreadRun> {
868 }
869 public abstract class StreamingUpdate {
870 public StreamingUpdateReason UpdateKind { get; }
871 }
872 public enum StreamingUpdateReason {
873 Unknown = 0,
874 ThreadCreated = 1,
875 RunCreated = 2,
876 RunQueued = 3,
877 RunInProgress = 4,
878 RunRequiresAction = 5,
879 RunCompleted = 6,
880 RunIncomplete = 7,
881 RunFailed = 8,
882 RunCancelling = 9,
883 RunCancelled = 10,
884 RunExpired = 11,
885 RunStepCreated = 12,
886 RunStepInProgress = 13,
887 RunStepUpdated = 14,
888 RunStepCompleted = 15,
889 RunStepFailed = 16,
890 RunStepCancelled = 17,
891 RunStepExpired = 18,
892 MessageCreated = 19,
893 MessageInProgress = 20,
894 MessageUpdated = 21,
895 MessageCompleted = 22,
896 MessageFailed = 23,
897 Error = 24,
898 Done = 25
899 }
900 public class StreamingUpdate<T> : StreamingUpdate where T : class {
901 public T Value { get; }
902 public static implicit operator T(StreamingUpdate<T> update);
903 }
904 public class TextAnnotation {
905 public int EndIndex { get; }
906 public string InputFileId { get; }
907 public string OutputFileId { get; }
908 public int StartIndex { get; }
909 public string TextToReplace { get; }
910 }
911 public class TextAnnotationUpdate {
912 public int ContentIndex { get; }
913 public int? EndIndex { get; }
914 public string InputFileId { get; }
915 public string OutputFileId { get; }
916 public int? StartIndex { get; }
917 public string TextToReplace { get; }
918 }
919 public class ThreadCreationOptions : IJsonModel<ThreadCreationOptions>, IPersistableModel<ThreadCreationOptions> {
920 public IList<ThreadInitializationMessage> InitialMessages { get; }
921 public IDictionary<string, string> Metadata { get; set; }
922 public ToolResources ToolResources { get; set; }
923 ThreadCreationOptions IJsonModel<ThreadCreationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
924 void IJsonModel<ThreadCreationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
925 ThreadCreationOptions IPersistableModel<ThreadCreationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
926 string IPersistableModel<ThreadCreationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
927 BinaryData IPersistableModel<ThreadCreationOptions>.Write(ModelReaderWriterOptions options);
928 }
929 public class ThreadDeletionResult : IJsonModel<ThreadDeletionResult>, IPersistableModel<ThreadDeletionResult> {
930 public bool Deleted { get; }
931 public string ThreadId { get; }
932 ThreadDeletionResult IJsonModel<ThreadDeletionResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
933 void IJsonModel<ThreadDeletionResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
934 ThreadDeletionResult IPersistableModel<ThreadDeletionResult>.Create(BinaryData data, ModelReaderWriterOptions options);
935 string IPersistableModel<ThreadDeletionResult>.GetFormatFromOptions(ModelReaderWriterOptions options);
936 BinaryData IPersistableModel<ThreadDeletionResult>.Write(ModelReaderWriterOptions options);
937 }
938 public class ThreadInitializationMessage : MessageCreationOptions {
939 public ThreadInitializationMessage(MessageRole role, IEnumerable<MessageContent> content);
940 public static implicit operator ThreadInitializationMessage(string initializationMessage);
941 }
942 public class ThreadMessage : IJsonModel<ThreadMessage>, IPersistableModel<ThreadMessage> {
943 public string AssistantId { get; }
944 public IReadOnlyList<MessageCreationAttachment> Attachments { get; }
945 public DateTimeOffset? CompletedAt { get; }
946 public IReadOnlyList<MessageContent> Content { get; }
947 public DateTimeOffset CreatedAt { get; }
948 public string Id { get; }
949 public DateTimeOffset? IncompleteAt { get; }
950 public MessageFailureDetails IncompleteDetails { get; }
951 public IReadOnlyDictionary<string, string> Metadata { get; }
952 public MessageRole Role { get; }
953 public string RunId { get; }
954 public MessageStatus Status { get; }
955 public string ThreadId { get; }
956 ThreadMessage IJsonModel<ThreadMessage>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
957 void IJsonModel<ThreadMessage>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
958 ThreadMessage IPersistableModel<ThreadMessage>.Create(BinaryData data, ModelReaderWriterOptions options);
959 string IPersistableModel<ThreadMessage>.GetFormatFromOptions(ModelReaderWriterOptions options);
960 BinaryData IPersistableModel<ThreadMessage>.Write(ModelReaderWriterOptions options);
961 }
962 public class ThreadModificationOptions : IJsonModel<ThreadModificationOptions>, IPersistableModel<ThreadModificationOptions> {
963 public IDictionary<string, string> Metadata { get; set; }
964 public ToolResources ToolResources { get; set; }
965 ThreadModificationOptions IJsonModel<ThreadModificationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
966 void IJsonModel<ThreadModificationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
967 ThreadModificationOptions IPersistableModel<ThreadModificationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
968 string IPersistableModel<ThreadModificationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
969 BinaryData IPersistableModel<ThreadModificationOptions>.Write(ModelReaderWriterOptions options);
970 }
971 public class ThreadRun : IJsonModel<ThreadRun>, IPersistableModel<ThreadRun> {
972 public bool? AllowParallelToolCalls { get; }
973 public string AssistantId { get; }
974 public DateTimeOffset? CancelledAt { get; }
975 public DateTimeOffset? CompletedAt { get; }
976 public DateTimeOffset CreatedAt { get; }
977 public DateTimeOffset? ExpiresAt { get; }
978 public DateTimeOffset? FailedAt { get; }
979 public string Id { get; }
980 public RunIncompleteDetails IncompleteDetails { get; }
981 public string Instructions { get; }
982 public RunError LastError { get; }
983 public int? MaxInputTokenCount { get; }
984 public int? MaxOutputTokenCount { get; }
985 public IReadOnlyDictionary<string, string> Metadata { get; }
986 public string Model { get; }
987 public float? NucleusSamplingFactor { get; }
988 public IReadOnlyList<RequiredAction> RequiredActions { get; }
989 public AssistantResponseFormat ResponseFormat { get; }
990 public DateTimeOffset? StartedAt { get; }
991 public RunStatus Status { get; }
992 public float? Temperature { get; }
993 public string ThreadId { get; }
994 public ToolConstraint ToolConstraint { get; }
995 public IReadOnlyList<ToolDefinition> Tools { get; }
996 public RunTruncationStrategy TruncationStrategy { get; }
997 public RunTokenUsage Usage { get; }
998 ThreadRun IJsonModel<ThreadRun>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
999 void IJsonModel<ThreadRun>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1000 ThreadRun IPersistableModel<ThreadRun>.Create(BinaryData data, ModelReaderWriterOptions options);
1001 string IPersistableModel<ThreadRun>.GetFormatFromOptions(ModelReaderWriterOptions options);
1002 BinaryData IPersistableModel<ThreadRun>.Write(ModelReaderWriterOptions options);
1003 }
1004 public class ThreadUpdate : StreamingUpdate<AssistantThread> {
1005 public DateTimeOffset CreatedAt { get; }
1006 public string Id { get; }
1007 public IReadOnlyDictionary<string, string> Metadata { get; }
1008 public ToolResources ToolResources { get; }
1009 }
1010 public class ToolConstraint : IJsonModel<ToolConstraint>, IPersistableModel<ToolConstraint> {
1011 public ToolConstraint(ToolDefinition toolDefinition);
1012 public static ToolConstraint Auto { get; }
1013 public static ToolConstraint None { get; }
1014 public static ToolConstraint Required { get; }
1015 ToolConstraint IJsonModel<ToolConstraint>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1016 void IJsonModel<ToolConstraint>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1017 ToolConstraint IPersistableModel<ToolConstraint>.Create(BinaryData data, ModelReaderWriterOptions options);
1018 string IPersistableModel<ToolConstraint>.GetFormatFromOptions(ModelReaderWriterOptions options);
1019 BinaryData IPersistableModel<ToolConstraint>.Write(ModelReaderWriterOptions options);
1020 }
1021 public abstract class ToolDefinition : IJsonModel<ToolDefinition>, IPersistableModel<ToolDefinition> {
1022 protected ToolDefinition();
1023 protected ToolDefinition(string type);
1024 public static CodeInterpreterToolDefinition CreateCodeInterpreter();
1025 public static FileSearchToolDefinition CreateFileSearch(int? maxResults = null);
1026 public static FunctionToolDefinition CreateFunction(string name, string description = null, BinaryData parameters = null, bool? strictParameterSchemaEnabled = null);
1027 ToolDefinition IJsonModel<ToolDefinition>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1028 void IJsonModel<ToolDefinition>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1029 ToolDefinition IPersistableModel<ToolDefinition>.Create(BinaryData data, ModelReaderWriterOptions options);
1030 string IPersistableModel<ToolDefinition>.GetFormatFromOptions(ModelReaderWriterOptions options);
1031 BinaryData IPersistableModel<ToolDefinition>.Write(ModelReaderWriterOptions options);
1032 }
1033 public class ToolOutput : IJsonModel<ToolOutput>, IPersistableModel<ToolOutput> {
1034 public ToolOutput();
1035 public ToolOutput(string toolCallId, string output);
1036 public string Output { get; set; }
1037 public string ToolCallId { get; set; }
1038 ToolOutput IJsonModel<ToolOutput>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1039 void IJsonModel<ToolOutput>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1040 ToolOutput IPersistableModel<ToolOutput>.Create(BinaryData data, ModelReaderWriterOptions options);
1041 string IPersistableModel<ToolOutput>.GetFormatFromOptions(ModelReaderWriterOptions options);
1042 BinaryData IPersistableModel<ToolOutput>.Write(ModelReaderWriterOptions options);
1043 }
1044 public class ToolResources : IJsonModel<ToolResources>, IPersistableModel<ToolResources> {
1045 public CodeInterpreterToolResources CodeInterpreter { get; set; }
1046 public FileSearchToolResources FileSearch { get; set; }
1047 ToolResources IJsonModel<ToolResources>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1048 void IJsonModel<ToolResources>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1049 ToolResources IPersistableModel<ToolResources>.Create(BinaryData data, ModelReaderWriterOptions options);
1050 string IPersistableModel<ToolResources>.GetFormatFromOptions(ModelReaderWriterOptions options);
1051 BinaryData IPersistableModel<ToolResources>.Write(ModelReaderWriterOptions options);
1052 }
1053 public class VectorStoreCreationHelper : IJsonModel<VectorStoreCreationHelper>, IPersistableModel<VectorStoreCreationHelper> {
1054 public VectorStoreCreationHelper();
1055 public VectorStoreCreationHelper(IEnumerable<OpenAIFile> files);
1056 public VectorStoreCreationHelper(IEnumerable<string> fileIds);
1057 public FileChunkingStrategy ChunkingStrategy { get; set; }
1058 public IList<string> FileIds { get; }
1059 public IDictionary<string, string> Metadata { get; }
1060 VectorStoreCreationHelper IJsonModel<VectorStoreCreationHelper>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1061 void IJsonModel<VectorStoreCreationHelper>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1062 VectorStoreCreationHelper IPersistableModel<VectorStoreCreationHelper>.Create(BinaryData data, ModelReaderWriterOptions options);
1063 string IPersistableModel<VectorStoreCreationHelper>.GetFormatFromOptions(ModelReaderWriterOptions options);
1064 BinaryData IPersistableModel<VectorStoreCreationHelper>.Write(ModelReaderWriterOptions options);
1065 }
1066}
1067namespace OpenAI.Audio {
1068 public class AudioClient {
1069 protected AudioClient();
1070 protected internal AudioClient(ClientPipeline pipeline, string model, OpenAIClientOptions options);
1071 public AudioClient(string model, ApiKeyCredential credential, OpenAIClientOptions options);
1072 public AudioClient(string model, ApiKeyCredential credential);
1073 public AudioClient(string model, string apiKey);
1074 public ClientPipeline Pipeline { get; }
1075 [EditorBrowsable(EditorBrowsableState.Never)]
1076 public virtual ClientResult GenerateSpeech(BinaryContent content, RequestOptions options = null);
1077 public virtual ClientResult<BinaryData> GenerateSpeech(string text, GeneratedSpeechVoice voice, SpeechGenerationOptions options = null, CancellationToken cancellationToken = default);
1078 [EditorBrowsable(EditorBrowsableState.Never)]
1079 public virtual Task<ClientResult> GenerateSpeechAsync(BinaryContent content, RequestOptions options = null);
1080 public virtual Task<ClientResult<BinaryData>> GenerateSpeechAsync(string text, GeneratedSpeechVoice voice, SpeechGenerationOptions options = null, CancellationToken cancellationToken = default);
1081 [EditorBrowsable(EditorBrowsableState.Never)]
1082 public virtual ClientResult TranscribeAudio(BinaryContent content, string contentType, RequestOptions options = null);
1083 public virtual ClientResult<AudioTranscription> TranscribeAudio(Stream audio, string audioFilename, AudioTranscriptionOptions options = null, CancellationToken cancellationToken = default);
1084 public virtual ClientResult<AudioTranscription> TranscribeAudio(string audioFilePath, AudioTranscriptionOptions options = null);
1085 [EditorBrowsable(EditorBrowsableState.Never)]
1086 public virtual Task<ClientResult> TranscribeAudioAsync(BinaryContent content, string contentType, RequestOptions options = null);
1087 public virtual Task<ClientResult<AudioTranscription>> TranscribeAudioAsync(Stream audio, string audioFilename, AudioTranscriptionOptions options = null, CancellationToken cancellationToken = default);
1088 public virtual Task<ClientResult<AudioTranscription>> TranscribeAudioAsync(string audioFilePath, AudioTranscriptionOptions options = null);
1089 public virtual ClientResult TranslateAudio(BinaryContent content, string contentType, RequestOptions options = null);
1090 public virtual ClientResult<AudioTranslation> TranslateAudio(Stream audio, string audioFilename, AudioTranslationOptions options = null, CancellationToken cancellationToken = default);
1091 public virtual ClientResult<AudioTranslation> TranslateAudio(string audioFilePath, AudioTranslationOptions options = null);
1092 public virtual Task<ClientResult> TranslateAudioAsync(BinaryContent content, string contentType, RequestOptions options = null);
1093 public virtual Task<ClientResult<AudioTranslation>> TranslateAudioAsync(Stream audio, string audioFilename, AudioTranslationOptions options = null, CancellationToken cancellationToken = default);
1094 public virtual Task<ClientResult<AudioTranslation>> TranslateAudioAsync(string audioFilePath, AudioTranslationOptions options = null);
1095 }
1096 [Flags]
1097 public enum AudioTimestampGranularities {
1098 Default = 0,
1099 Word = 1,
1100 Segment = 2
1101 }
1102 public class AudioTranscription : IJsonModel<AudioTranscription>, IPersistableModel<AudioTranscription> {
1103 public TimeSpan? Duration { get; }
1104 public string Language { get; }
1105 public IReadOnlyList<TranscribedSegment> Segments { get; }
1106 public string Text { get; }
1107 public IReadOnlyList<TranscribedWord> Words { get; }
1108 AudioTranscription IJsonModel<AudioTranscription>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1109 void IJsonModel<AudioTranscription>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1110 AudioTranscription IPersistableModel<AudioTranscription>.Create(BinaryData data, ModelReaderWriterOptions options);
1111 string IPersistableModel<AudioTranscription>.GetFormatFromOptions(ModelReaderWriterOptions options);
1112 BinaryData IPersistableModel<AudioTranscription>.Write(ModelReaderWriterOptions options);
1113 }
1114 public readonly partial struct AudioTranscriptionFormat : IEquatable<AudioTranscriptionFormat> {
1115 private readonly object _dummy;
1116 private readonly int _dummyPrimitive;
1117 public AudioTranscriptionFormat(string value);
1118 public static AudioTranscriptionFormat Simple { get; }
1119 public static AudioTranscriptionFormat Srt { get; }
1120 [EditorBrowsable(EditorBrowsableState.Never)]
1121 public static AudioTranscriptionFormat Text { get; }
1122 public static AudioTranscriptionFormat Verbose { get; }
1123 public static AudioTranscriptionFormat Vtt { get; }
1124 public readonly bool Equals(AudioTranscriptionFormat other);
1125 [EditorBrowsable(EditorBrowsableState.Never)]
1126 public override readonly bool Equals(object obj);
1127 [EditorBrowsable(EditorBrowsableState.Never)]
1128 public override readonly int GetHashCode();
1129 public static bool operator ==(AudioTranscriptionFormat left, AudioTranscriptionFormat right);
1130 public static implicit operator AudioTranscriptionFormat(string value);
1131 public static bool operator !=(AudioTranscriptionFormat left, AudioTranscriptionFormat right);
1132 public override readonly string ToString();
1133 }
1134 public class AudioTranscriptionOptions : IJsonModel<AudioTranscriptionOptions>, IPersistableModel<AudioTranscriptionOptions> {
1135 public string Language { get; set; }
1136 public string Prompt { get; set; }
1137 public AudioTranscriptionFormat? ResponseFormat { get; set; }
1138 public float? Temperature { get; set; }
1139 public AudioTimestampGranularities TimestampGranularities { get; set; }
1140 AudioTranscriptionOptions IJsonModel<AudioTranscriptionOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1141 void IJsonModel<AudioTranscriptionOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1142 AudioTranscriptionOptions IPersistableModel<AudioTranscriptionOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
1143 string IPersistableModel<AudioTranscriptionOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
1144 BinaryData IPersistableModel<AudioTranscriptionOptions>.Write(ModelReaderWriterOptions options);
1145 }
1146 public class AudioTranslation : IJsonModel<AudioTranslation>, IPersistableModel<AudioTranslation> {
1147 public TimeSpan? Duration { get; }
1148 public string Language { get; }
1149 public IReadOnlyList<TranscribedSegment> Segments { get; }
1150 public string Text { get; }
1151 AudioTranslation IJsonModel<AudioTranslation>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1152 void IJsonModel<AudioTranslation>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1153 AudioTranslation IPersistableModel<AudioTranslation>.Create(BinaryData data, ModelReaderWriterOptions options);
1154 string IPersistableModel<AudioTranslation>.GetFormatFromOptions(ModelReaderWriterOptions options);
1155 BinaryData IPersistableModel<AudioTranslation>.Write(ModelReaderWriterOptions options);
1156 }
1157 public readonly partial struct AudioTranslationFormat : IEquatable<AudioTranslationFormat> {
1158 private readonly object _dummy;
1159 private readonly int _dummyPrimitive;
1160 public AudioTranslationFormat(string value);
1161 public static AudioTranslationFormat Simple { get; }
1162 public static AudioTranslationFormat Srt { get; }
1163 [EditorBrowsable(EditorBrowsableState.Never)]
1164 public static AudioTranslationFormat Text { get; }
1165 public static AudioTranslationFormat Verbose { get; }
1166 public static AudioTranslationFormat Vtt { get; }
1167 public readonly bool Equals(AudioTranslationFormat other);
1168 [EditorBrowsable(EditorBrowsableState.Never)]
1169 public override readonly bool Equals(object obj);
1170 [EditorBrowsable(EditorBrowsableState.Never)]
1171 public override readonly int GetHashCode();
1172 public static bool operator ==(AudioTranslationFormat left, AudioTranslationFormat right);
1173 public static implicit operator AudioTranslationFormat(string value);
1174 public static bool operator !=(AudioTranslationFormat left, AudioTranslationFormat right);
1175 public override readonly string ToString();
1176 }
1177 public class AudioTranslationOptions : IJsonModel<AudioTranslationOptions>, IPersistableModel<AudioTranslationOptions> {
1178 public string Prompt { get; set; }
1179 public AudioTranslationFormat? ResponseFormat { get; set; }
1180 public float? Temperature { get; set; }
1181 AudioTranslationOptions IJsonModel<AudioTranslationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1182 void IJsonModel<AudioTranslationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1183 AudioTranslationOptions IPersistableModel<AudioTranslationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
1184 string IPersistableModel<AudioTranslationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
1185 BinaryData IPersistableModel<AudioTranslationOptions>.Write(ModelReaderWriterOptions options);
1186 }
1187 public readonly partial struct GeneratedSpeechFormat : IEquatable<GeneratedSpeechFormat> {
1188 private readonly object _dummy;
1189 private readonly int _dummyPrimitive;
1190 public GeneratedSpeechFormat(string value);
1191 public static GeneratedSpeechFormat Aac { get; }
1192 public static GeneratedSpeechFormat Flac { get; }
1193 public static GeneratedSpeechFormat Mp3 { get; }
1194 public static GeneratedSpeechFormat Opus { get; }
1195 public static GeneratedSpeechFormat Pcm { get; }
1196 public static GeneratedSpeechFormat Wav { get; }
1197 public readonly bool Equals(GeneratedSpeechFormat other);
1198 [EditorBrowsable(EditorBrowsableState.Never)]
1199 public override readonly bool Equals(object obj);
1200 [EditorBrowsable(EditorBrowsableState.Never)]
1201 public override readonly int GetHashCode();
1202 public static bool operator ==(GeneratedSpeechFormat left, GeneratedSpeechFormat right);
1203 public static implicit operator GeneratedSpeechFormat(string value);
1204 public static bool operator !=(GeneratedSpeechFormat left, GeneratedSpeechFormat right);
1205 public override readonly string ToString();
1206 }
1207 public readonly partial struct GeneratedSpeechVoice : IEquatable<GeneratedSpeechVoice> {
1208 private readonly object _dummy;
1209 private readonly int _dummyPrimitive;
1210 public GeneratedSpeechVoice(string value);
1211 public static GeneratedSpeechVoice Alloy { get; }
1212 public static GeneratedSpeechVoice Echo { get; }
1213 public static GeneratedSpeechVoice Fable { get; }
1214 public static GeneratedSpeechVoice Nova { get; }
1215 public static GeneratedSpeechVoice Onyx { get; }
1216 public static GeneratedSpeechVoice Shimmer { get; }
1217 public readonly bool Equals(GeneratedSpeechVoice other);
1218 [EditorBrowsable(EditorBrowsableState.Never)]
1219 public override readonly bool Equals(object obj);
1220 [EditorBrowsable(EditorBrowsableState.Never)]
1221 public override readonly int GetHashCode();
1222 public static bool operator ==(GeneratedSpeechVoice left, GeneratedSpeechVoice right);
1223 public static implicit operator GeneratedSpeechVoice(string value);
1224 public static bool operator !=(GeneratedSpeechVoice left, GeneratedSpeechVoice right);
1225 public override readonly string ToString();
1226 }
1227 public static class OpenAIAudioModelFactory {
1228 public static AudioTranscription AudioTranscription(string language = null, TimeSpan? duration = null, string text = null, IEnumerable<TranscribedWord> words = null, IEnumerable<TranscribedSegment> segments = null);
1229 public static AudioTranslation AudioTranslation(string language = null, TimeSpan? duration = null, string text = null, IEnumerable<TranscribedSegment> segments = null);
1230 public static TranscribedSegment TranscribedSegment(int id = 0, int seekOffset = 0, TimeSpan startTime = default, TimeSpan endTime = default, string text = null, ReadOnlyMemory<int> tokenIds = default, float temperature = 0, float averageLogProbability = 0, float compressionRatio = 0, float noSpeechProbability = 0);
1231 public static TranscribedWord TranscribedWord(string word = null, TimeSpan startTime = default, TimeSpan endTime = default);
1232 }
1233 public class SpeechGenerationOptions : IJsonModel<SpeechGenerationOptions>, IPersistableModel<SpeechGenerationOptions> {
1234 public GeneratedSpeechFormat? ResponseFormat { get; set; }
1235 public float? SpeedRatio { get; set; }
1236 SpeechGenerationOptions IJsonModel<SpeechGenerationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1237 void IJsonModel<SpeechGenerationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1238 SpeechGenerationOptions IPersistableModel<SpeechGenerationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
1239 string IPersistableModel<SpeechGenerationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
1240 BinaryData IPersistableModel<SpeechGenerationOptions>.Write(ModelReaderWriterOptions options);
1241 }
1242 public readonly partial struct TranscribedSegment : IJsonModel<TranscribedSegment>, IPersistableModel<TranscribedSegment>, IJsonModel<object>, IPersistableModel<object> {
1243 private readonly object _dummy;
1244 private readonly int _dummyPrimitive;
1245 public float AverageLogProbability { get; }
1246 public float CompressionRatio { get; }
1247 public TimeSpan EndTime { get; }
1248 public int Id { get; }
1249 public float NoSpeechProbability { get; }
1250 public int SeekOffset { get; }
1251 public TimeSpan StartTime { get; }
1252 public float Temperature { get; }
1253 public string Text { get; }
1254 public ReadOnlyMemory<int> TokenIds { get; }
1255 readonly TranscribedSegment IJsonModel<TranscribedSegment>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1256 readonly void IJsonModel<TranscribedSegment>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1257 readonly object IJsonModel<object>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1258 readonly void IJsonModel<object>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1259 readonly TranscribedSegment IPersistableModel<TranscribedSegment>.Create(BinaryData data, ModelReaderWriterOptions options);
1260 readonly string IPersistableModel<TranscribedSegment>.GetFormatFromOptions(ModelReaderWriterOptions options);
1261 readonly BinaryData IPersistableModel<TranscribedSegment>.Write(ModelReaderWriterOptions options);
1262 readonly object IPersistableModel<object>.Create(BinaryData data, ModelReaderWriterOptions options);
1263 readonly string IPersistableModel<object>.GetFormatFromOptions(ModelReaderWriterOptions options);
1264 readonly BinaryData IPersistableModel<object>.Write(ModelReaderWriterOptions options);
1265 }
1266 public readonly partial struct TranscribedWord : IJsonModel<TranscribedWord>, IPersistableModel<TranscribedWord>, IJsonModel<object>, IPersistableModel<object> {
1267 private readonly object _dummy;
1268 private readonly int _dummyPrimitive;
1269 public TimeSpan EndTime { get; }
1270 public TimeSpan StartTime { get; }
1271 public string Word { get; }
1272 readonly TranscribedWord IJsonModel<TranscribedWord>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1273 readonly void IJsonModel<TranscribedWord>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1274 readonly object IJsonModel<object>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1275 readonly void IJsonModel<object>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1276 readonly TranscribedWord IPersistableModel<TranscribedWord>.Create(BinaryData data, ModelReaderWriterOptions options);
1277 readonly string IPersistableModel<TranscribedWord>.GetFormatFromOptions(ModelReaderWriterOptions options);
1278 readonly BinaryData IPersistableModel<TranscribedWord>.Write(ModelReaderWriterOptions options);
1279 readonly object IPersistableModel<object>.Create(BinaryData data, ModelReaderWriterOptions options);
1280 readonly string IPersistableModel<object>.GetFormatFromOptions(ModelReaderWriterOptions options);
1281 readonly BinaryData IPersistableModel<object>.Write(ModelReaderWriterOptions options);
1282 }
1283}
1284namespace OpenAI.Batch {
1285 public class BatchClient {
1286 protected BatchClient();
1287 public BatchClient(ApiKeyCredential credential, OpenAIClientOptions options);
1288 public BatchClient(ApiKeyCredential credential);
1289 protected internal BatchClient(ClientPipeline pipeline, OpenAIClientOptions options);
1290 public BatchClient(string apiKey);
1291 public ClientPipeline Pipeline { get; }
1292 public virtual CreateBatchOperation CreateBatch(BinaryContent content, bool waitUntilCompleted, RequestOptions options = null);
1293 public virtual Task<CreateBatchOperation> CreateBatchAsync(BinaryContent content, bool waitUntilCompleted, RequestOptions options = null);
1294 public virtual CollectionResult GetBatches(string after, int? limit, RequestOptions options);
1295 public virtual AsyncCollectionResult GetBatchesAsync(string after, int? limit, RequestOptions options);
1296 }
1297 public class CreateBatchOperation : OperationResult {
1298 public string BatchId { get; }
1299 public override ContinuationToken? RehydrationToken { get; protected set; }
1300 public virtual ClientResult Cancel(RequestOptions? options);
1301 public virtual Task<ClientResult> CancelAsync(RequestOptions? options);
1302 public virtual ClientResult GetBatch(RequestOptions? options);
1303 public virtual Task<ClientResult> GetBatchAsync(RequestOptions? options);
1304 public static CreateBatchOperation Rehydrate(BatchClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default);
1305 public static Task<CreateBatchOperation> RehydrateAsync(BatchClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default);
1306 public override ClientResult UpdateStatus(RequestOptions? options = null);
1307 public override ValueTask<ClientResult> UpdateStatusAsync(RequestOptions? options = null);
1308 }
1309}
1310namespace OpenAI.Chat {
1311 public class AssistantChatMessage : ChatMessage, IJsonModel<AssistantChatMessage>, IPersistableModel<AssistantChatMessage> {
1312 public AssistantChatMessage(ChatCompletion chatCompletion);
1313 [Obsolete("This constructor is obsolete. Please use the constructor that takes an IEnumerable<ChatToolCall> parameter instead.")]
1314 public AssistantChatMessage(ChatFunctionCall functionCall);
1315 public AssistantChatMessage(params ChatMessageContentPart[] contentParts);
1316 public AssistantChatMessage(IEnumerable<ChatMessageContentPart> contentParts);
1317 public AssistantChatMessage(IEnumerable<ChatToolCall> toolCalls);
1318 public AssistantChatMessage(string content);
1319 [Obsolete("This property is obsolete. Please use ToolCalls instead.")]
1320 public ChatFunctionCall FunctionCall { get; set; }
1321 public string ParticipantName { get; set; }
1322 public string Refusal { get; set; }
1323 public IList<ChatToolCall> ToolCalls { get; }
1324 AssistantChatMessage IJsonModel<AssistantChatMessage>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1325 void IJsonModel<AssistantChatMessage>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1326 AssistantChatMessage IPersistableModel<AssistantChatMessage>.Create(BinaryData data, ModelReaderWriterOptions options);
1327 string IPersistableModel<AssistantChatMessage>.GetFormatFromOptions(ModelReaderWriterOptions options);
1328 BinaryData IPersistableModel<AssistantChatMessage>.Write(ModelReaderWriterOptions options);
1329 }
1330 public class ChatClient {
1331 protected ChatClient();
1332 protected internal ChatClient(ClientPipeline pipeline, string model, OpenAIClientOptions options);
1333 public ChatClient(string model, ApiKeyCredential credential, OpenAIClientOptions options);
1334 public ChatClient(string model, ApiKeyCredential credential);
1335 public ChatClient(string model, string apiKey);
1336 public ClientPipeline Pipeline { get; }
1337 public virtual ClientResult<ChatCompletion> CompleteChat(params ChatMessage[] messages);
1338 [EditorBrowsable(EditorBrowsableState.Never)]
1339 public virtual ClientResult CompleteChat(BinaryContent content, RequestOptions options = null);
1340 public virtual ClientResult<ChatCompletion> CompleteChat(IEnumerable<ChatMessage> messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default);
1341 public virtual Task<ClientResult<ChatCompletion>> CompleteChatAsync(params ChatMessage[] messages);
1342 [EditorBrowsable(EditorBrowsableState.Never)]
1343 public virtual Task<ClientResult> CompleteChatAsync(BinaryContent content, RequestOptions options = null);
1344 public virtual Task<ClientResult<ChatCompletion>> CompleteChatAsync(IEnumerable<ChatMessage> messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default);
1345 public virtual CollectionResult<StreamingChatCompletionUpdate> CompleteChatStreaming(params ChatMessage[] messages);
1346 public virtual CollectionResult<StreamingChatCompletionUpdate> CompleteChatStreaming(IEnumerable<ChatMessage> messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default);
1347 public virtual AsyncCollectionResult<StreamingChatCompletionUpdate> CompleteChatStreamingAsync(params ChatMessage[] messages);
1348 public virtual AsyncCollectionResult<StreamingChatCompletionUpdate> CompleteChatStreamingAsync(IEnumerable<ChatMessage> messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default);
1349 }
1350 public class ChatCompletion : IJsonModel<ChatCompletion>, IPersistableModel<ChatCompletion> {
1351 public ChatMessageContent Content { get; }
1352 public IReadOnlyList<ChatTokenLogProbabilityDetails> ContentTokenLogProbabilities { get; }
1353 public DateTimeOffset CreatedAt { get; }
1354 public ChatFinishReason FinishReason { get; }
1355 [Obsolete("This property is obsolete. Please use ToolCalls instead.")]
1356 public ChatFunctionCall FunctionCall { get; }
1357 public string Id { get; }
1358 public string Model { get; }
1359 public string Refusal { get; }
1360 public IReadOnlyList<ChatTokenLogProbabilityDetails> RefusalTokenLogProbabilities { get; }
1361 public ChatMessageRole Role { get; }
1362 public string SystemFingerprint { get; }
1363 public IReadOnlyList<ChatToolCall> ToolCalls { get; }
1364 public ChatTokenUsage Usage { get; }
1365 ChatCompletion IJsonModel<ChatCompletion>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1366 void IJsonModel<ChatCompletion>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1367 ChatCompletion IPersistableModel<ChatCompletion>.Create(BinaryData data, ModelReaderWriterOptions options);
1368 string IPersistableModel<ChatCompletion>.GetFormatFromOptions(ModelReaderWriterOptions options);
1369 BinaryData IPersistableModel<ChatCompletion>.Write(ModelReaderWriterOptions options);
1370 }
1371 public class ChatCompletionOptions : IJsonModel<ChatCompletionOptions>, IPersistableModel<ChatCompletionOptions> {
1372 public bool? AllowParallelToolCalls { get; set; }
1373 public string EndUserId { get; set; }
1374 public float? FrequencyPenalty { get; set; }
1375 [Obsolete("This property is obsolete. Please use ToolChoice instead.")]
1376 public ChatFunctionChoice FunctionChoice { get; set; }
1377 [Obsolete("This property is obsolete. Please use Tools instead.")]
1378 public IList<ChatFunction> Functions { get; }
1379 public bool? IncludeLogProbabilities { get; set; }
1380 public IDictionary<int, int> LogitBiases { get; }
1381 public int? MaxOutputTokenCount { get; set; }
1382 public float? PresencePenalty { get; set; }
1383 public ChatResponseFormat ResponseFormat { get; set; }
1384 public long? Seed { get; set; }
1385 public IList<string> StopSequences { get; }
1386 public float? Temperature { get; set; }
1387 public ChatToolChoice ToolChoice { get; set; }
1388 public IList<ChatTool> Tools { get; }
1389 public int? TopLogProbabilityCount { get; set; }
1390 public float? TopP { get; set; }
1391 ChatCompletionOptions IJsonModel<ChatCompletionOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1392 void IJsonModel<ChatCompletionOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1393 ChatCompletionOptions IPersistableModel<ChatCompletionOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
1394 string IPersistableModel<ChatCompletionOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
1395 BinaryData IPersistableModel<ChatCompletionOptions>.Write(ModelReaderWriterOptions options);
1396 }
1397 public enum ChatFinishReason {
1398 Stop = 0,
1399 Length = 1,
1400 ContentFilter = 2,
1401 ToolCalls = 3,
1402 FunctionCall = 4
1403 }
1404 [Obsolete("This class is obsolete. Please use ChatTool instead.")]
1405 public class ChatFunction : IJsonModel<ChatFunction>, IPersistableModel<ChatFunction> {
1406 public ChatFunction(string functionName);
1407 public string FunctionDescription { get; set; }
1408 public string FunctionName { get; }
1409 public BinaryData FunctionParameters { get; set; }
1410 ChatFunction IJsonModel<ChatFunction>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1411 void IJsonModel<ChatFunction>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1412 ChatFunction IPersistableModel<ChatFunction>.Create(BinaryData data, ModelReaderWriterOptions options);
1413 string IPersistableModel<ChatFunction>.GetFormatFromOptions(ModelReaderWriterOptions options);
1414 BinaryData IPersistableModel<ChatFunction>.Write(ModelReaderWriterOptions options);
1415 }
1416 [Obsolete("This class is obsolete. Please use ChatToolCall instead.")]
1417 public class ChatFunctionCall : IJsonModel<ChatFunctionCall>, IPersistableModel<ChatFunctionCall> {
1418 public ChatFunctionCall(string functionName, BinaryData functionArguments);
1419 public BinaryData FunctionArguments { get; }
1420 public string FunctionName { get; }
1421 ChatFunctionCall IJsonModel<ChatFunctionCall>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1422 void IJsonModel<ChatFunctionCall>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1423 ChatFunctionCall IPersistableModel<ChatFunctionCall>.Create(BinaryData data, ModelReaderWriterOptions options);
1424 string IPersistableModel<ChatFunctionCall>.GetFormatFromOptions(ModelReaderWriterOptions options);
1425 BinaryData IPersistableModel<ChatFunctionCall>.Write(ModelReaderWriterOptions options);
1426 }
1427 [Obsolete("This class is obsolete. Please use ChatToolChoice instead.")]
1428 public class ChatFunctionChoice : IJsonModel<ChatFunctionChoice>, IPersistableModel<ChatFunctionChoice> {
1429 public static ChatFunctionChoice CreateAutoChoice();
1430 public static ChatFunctionChoice CreateNamedChoice(string functionName);
1431 public static ChatFunctionChoice CreateNoneChoice();
1432 ChatFunctionChoice IJsonModel<ChatFunctionChoice>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1433 void IJsonModel<ChatFunctionChoice>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1434 ChatFunctionChoice IPersistableModel<ChatFunctionChoice>.Create(BinaryData data, ModelReaderWriterOptions options);
1435 string IPersistableModel<ChatFunctionChoice>.GetFormatFromOptions(ModelReaderWriterOptions options);
1436 BinaryData IPersistableModel<ChatFunctionChoice>.Write(ModelReaderWriterOptions options);
1437 }
1438 public readonly partial struct ChatImageDetailLevel : IEquatable<ChatImageDetailLevel> {
1439 private readonly object _dummy;
1440 private readonly int _dummyPrimitive;
1441 public ChatImageDetailLevel(string value);
1442 public static ChatImageDetailLevel Auto { get; }
1443 public static ChatImageDetailLevel High { get; }
1444 public static ChatImageDetailLevel Low { get; }
1445 public readonly bool Equals(ChatImageDetailLevel other);
1446 [EditorBrowsable(EditorBrowsableState.Never)]
1447 public override readonly bool Equals(object obj);
1448 [EditorBrowsable(EditorBrowsableState.Never)]
1449 public override readonly int GetHashCode();
1450 public static bool operator ==(ChatImageDetailLevel left, ChatImageDetailLevel right);
1451 public static implicit operator ChatImageDetailLevel(string value);
1452 public static bool operator !=(ChatImageDetailLevel left, ChatImageDetailLevel right);
1453 public override readonly string ToString();
1454 }
1455 public class ChatMessage : IJsonModel<ChatMessage>, IPersistableModel<ChatMessage> {
1456 public ChatMessageContent Content { get; }
1457 public static AssistantChatMessage CreateAssistantMessage(ChatCompletion chatCompletion);
1458 public static AssistantChatMessage CreateAssistantMessage(ChatFunctionCall functionCall);
1459 public static AssistantChatMessage CreateAssistantMessage(params ChatMessageContentPart[] contentParts);
1460 public static AssistantChatMessage CreateAssistantMessage(IEnumerable<ChatMessageContentPart> contentParts);
1461 public static AssistantChatMessage CreateAssistantMessage(IEnumerable<ChatToolCall> toolCalls);
1462 public static AssistantChatMessage CreateAssistantMessage(string content);
1463 [Obsolete("This method is obsolete. Please use CreateToolMessage instead.")]
1464 public static FunctionChatMessage CreateFunctionMessage(string functionName, string content);
1465 public static SystemChatMessage CreateSystemMessage(params ChatMessageContentPart[] contentParts);
1466 public static SystemChatMessage CreateSystemMessage(IEnumerable<ChatMessageContentPart> contentParts);
1467 public static SystemChatMessage CreateSystemMessage(string content);
1468 public static ToolChatMessage CreateToolMessage(string toolCallId, params ChatMessageContentPart[] contentParts);
1469 public static ToolChatMessage CreateToolMessage(string toolCallId, IEnumerable<ChatMessageContentPart> contentParts);
1470 public static ToolChatMessage CreateToolMessage(string toolCallId, string content);
1471 public static UserChatMessage CreateUserMessage(params ChatMessageContentPart[] contentParts);
1472 public static UserChatMessage CreateUserMessage(IEnumerable<ChatMessageContentPart> contentParts);
1473 public static UserChatMessage CreateUserMessage(string content);
1474 public static implicit operator ChatMessage(string content);
1475 ChatMessage IJsonModel<ChatMessage>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1476 void IJsonModel<ChatMessage>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1477 ChatMessage IPersistableModel<ChatMessage>.Create(BinaryData data, ModelReaderWriterOptions options);
1478 string IPersistableModel<ChatMessage>.GetFormatFromOptions(ModelReaderWriterOptions options);
1479 BinaryData IPersistableModel<ChatMessage>.Write(ModelReaderWriterOptions options);
1480 }
1481 public class ChatMessageContent : ObjectModel.Collection<ChatMessageContentPart> {
1482 public ChatMessageContent();
1483 public ChatMessageContent(params ChatMessageContentPart[] contentParts);
1484 public ChatMessageContent(IEnumerable<ChatMessageContentPart> contentParts);
1485 public ChatMessageContent(string content);
1486 }
1487 public class ChatMessageContentPart : IJsonModel<ChatMessageContentPart>, IPersistableModel<ChatMessageContentPart> {
1488 public BinaryData ImageBytes { get; }
1489 public string ImageBytesMediaType { get; }
1490 public ChatImageDetailLevel? ImageDetailLevel { get; }
1491 public Uri ImageUri { get; }
1492 public ChatMessageContentPartKind Kind { get; }
1493 public string Refusal { get; }
1494 public string Text { get; }
1495 public static ChatMessageContentPart CreateImagePart(BinaryData imageBytes, string imageBytesMediaType, ChatImageDetailLevel? imageDetailLevel = null);
1496 public static ChatMessageContentPart CreateImagePart(Uri imageUri, ChatImageDetailLevel? imageDetailLevel = null);
1497 public static ChatMessageContentPart CreateRefusalPart(string refusal);
1498 public static ChatMessageContentPart CreateTextPart(string text);
1499 public static implicit operator ChatMessageContentPart(string text);
1500 ChatMessageContentPart IJsonModel<ChatMessageContentPart>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1501 void IJsonModel<ChatMessageContentPart>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1502 ChatMessageContentPart IPersistableModel<ChatMessageContentPart>.Create(BinaryData data, ModelReaderWriterOptions options);
1503 string IPersistableModel<ChatMessageContentPart>.GetFormatFromOptions(ModelReaderWriterOptions options);
1504 BinaryData IPersistableModel<ChatMessageContentPart>.Write(ModelReaderWriterOptions options);
1505 }
1506 public enum ChatMessageContentPartKind {
1507 Text = 0,
1508 Refusal = 1,
1509 Image = 2
1510 }
1511 public enum ChatMessageRole {
1512 System = 0,
1513 User = 1,
1514 Assistant = 2,
1515 Tool = 3,
1516 Function = 4
1517 }
1518 public class ChatOutputTokenUsageDetails : IJsonModel<ChatOutputTokenUsageDetails>, IPersistableModel<ChatOutputTokenUsageDetails> {
1519 public int ReasoningTokenCount { get; }
1520 ChatOutputTokenUsageDetails IJsonModel<ChatOutputTokenUsageDetails>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1521 void IJsonModel<ChatOutputTokenUsageDetails>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1522 ChatOutputTokenUsageDetails IPersistableModel<ChatOutputTokenUsageDetails>.Create(BinaryData data, ModelReaderWriterOptions options);
1523 string IPersistableModel<ChatOutputTokenUsageDetails>.GetFormatFromOptions(ModelReaderWriterOptions options);
1524 BinaryData IPersistableModel<ChatOutputTokenUsageDetails>.Write(ModelReaderWriterOptions options);
1525 }
1526 public class ChatResponseFormat : IJsonModel<ChatResponseFormat>, IPersistableModel<ChatResponseFormat> {
1527 public static ChatResponseFormat CreateJsonObjectFormat();
1528 public static ChatResponseFormat CreateJsonSchemaFormat(string jsonSchemaFormatName, BinaryData jsonSchema, string jsonSchemaFormatDescription = null, bool? jsonSchemaIsStrict = null);
1529 public static ChatResponseFormat CreateTextFormat();
1530 ChatResponseFormat IJsonModel<ChatResponseFormat>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1531 void IJsonModel<ChatResponseFormat>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1532 ChatResponseFormat IPersistableModel<ChatResponseFormat>.Create(BinaryData data, ModelReaderWriterOptions options);
1533 string IPersistableModel<ChatResponseFormat>.GetFormatFromOptions(ModelReaderWriterOptions options);
1534 BinaryData IPersistableModel<ChatResponseFormat>.Write(ModelReaderWriterOptions options);
1535 }
1536 public class ChatTokenLogProbabilityDetails : IJsonModel<ChatTokenLogProbabilityDetails>, IPersistableModel<ChatTokenLogProbabilityDetails> {
1537 public float LogProbability { get; }
1538 public string Token { get; }
1539 public IReadOnlyList<ChatTokenTopLogProbabilityDetails> TopLogProbabilities { get; }
1540 public ReadOnlyMemory<byte>? Utf8Bytes { get; }
1541 ChatTokenLogProbabilityDetails IJsonModel<ChatTokenLogProbabilityDetails>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1542 void IJsonModel<ChatTokenLogProbabilityDetails>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1543 ChatTokenLogProbabilityDetails IPersistableModel<ChatTokenLogProbabilityDetails>.Create(BinaryData data, ModelReaderWriterOptions options);
1544 string IPersistableModel<ChatTokenLogProbabilityDetails>.GetFormatFromOptions(ModelReaderWriterOptions options);
1545 BinaryData IPersistableModel<ChatTokenLogProbabilityDetails>.Write(ModelReaderWriterOptions options);
1546 }
1547 public class ChatTokenTopLogProbabilityDetails : IJsonModel<ChatTokenTopLogProbabilityDetails>, IPersistableModel<ChatTokenTopLogProbabilityDetails> {
1548 public float LogProbability { get; }
1549 public string Token { get; }
1550 public ReadOnlyMemory<byte>? Utf8Bytes { get; }
1551 ChatTokenTopLogProbabilityDetails IJsonModel<ChatTokenTopLogProbabilityDetails>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1552 void IJsonModel<ChatTokenTopLogProbabilityDetails>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1553 ChatTokenTopLogProbabilityDetails IPersistableModel<ChatTokenTopLogProbabilityDetails>.Create(BinaryData data, ModelReaderWriterOptions options);
1554 string IPersistableModel<ChatTokenTopLogProbabilityDetails>.GetFormatFromOptions(ModelReaderWriterOptions options);
1555 BinaryData IPersistableModel<ChatTokenTopLogProbabilityDetails>.Write(ModelReaderWriterOptions options);
1556 }
1557 public class ChatTokenUsage : IJsonModel<ChatTokenUsage>, IPersistableModel<ChatTokenUsage> {
1558 public int InputTokenCount { get; }
1559 public int OutputTokenCount { get; }
1560 public ChatOutputTokenUsageDetails OutputTokenDetails { get; }
1561 public int TotalTokenCount { get; }
1562 ChatTokenUsage IJsonModel<ChatTokenUsage>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1563 void IJsonModel<ChatTokenUsage>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1564 ChatTokenUsage IPersistableModel<ChatTokenUsage>.Create(BinaryData data, ModelReaderWriterOptions options);
1565 string IPersistableModel<ChatTokenUsage>.GetFormatFromOptions(ModelReaderWriterOptions options);
1566 BinaryData IPersistableModel<ChatTokenUsage>.Write(ModelReaderWriterOptions options);
1567 }
1568 public class ChatTool : IJsonModel<ChatTool>, IPersistableModel<ChatTool> {
1569 public string FunctionDescription { get; }
1570 public string FunctionName { get; }
1571 public BinaryData FunctionParameters { get; }
1572 public bool? FunctionSchemaIsStrict { get; }
1573 public ChatToolKind Kind { get; }
1574 public static ChatTool CreateFunctionTool(string functionName, string functionDescription = null, BinaryData functionParameters = null, bool? functionSchemaIsStrict = null);
1575 ChatTool IJsonModel<ChatTool>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1576 void IJsonModel<ChatTool>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1577 ChatTool IPersistableModel<ChatTool>.Create(BinaryData data, ModelReaderWriterOptions options);
1578 string IPersistableModel<ChatTool>.GetFormatFromOptions(ModelReaderWriterOptions options);
1579 BinaryData IPersistableModel<ChatTool>.Write(ModelReaderWriterOptions options);
1580 }
1581 public class ChatToolCall : IJsonModel<ChatToolCall>, IPersistableModel<ChatToolCall> {
1582 public BinaryData FunctionArguments { get; }
1583 public string FunctionName { get; }
1584 public string Id { get; set; }
1585 public ChatToolCallKind Kind { get; }
1586 public static ChatToolCall CreateFunctionToolCall(string id, string functionName, BinaryData functionArguments);
1587 ChatToolCall IJsonModel<ChatToolCall>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1588 void IJsonModel<ChatToolCall>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1589 ChatToolCall IPersistableModel<ChatToolCall>.Create(BinaryData data, ModelReaderWriterOptions options);
1590 string IPersistableModel<ChatToolCall>.GetFormatFromOptions(ModelReaderWriterOptions options);
1591 BinaryData IPersistableModel<ChatToolCall>.Write(ModelReaderWriterOptions options);
1592 }
1593 public enum ChatToolCallKind {
1594 Function = 0
1595 }
1596 public class ChatToolChoice : IJsonModel<ChatToolChoice>, IPersistableModel<ChatToolChoice> {
1597 public static ChatToolChoice CreateAutoChoice();
1598 public static ChatToolChoice CreateFunctionChoice(string functionName);
1599 public static ChatToolChoice CreateNoneChoice();
1600 public static ChatToolChoice CreateRequiredChoice();
1601 ChatToolChoice IJsonModel<ChatToolChoice>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1602 void IJsonModel<ChatToolChoice>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1603 ChatToolChoice IPersistableModel<ChatToolChoice>.Create(BinaryData data, ModelReaderWriterOptions options);
1604 string IPersistableModel<ChatToolChoice>.GetFormatFromOptions(ModelReaderWriterOptions options);
1605 BinaryData IPersistableModel<ChatToolChoice>.Write(ModelReaderWriterOptions options);
1606 }
1607 public enum ChatToolKind {
1608 Function = 0
1609 }
1610 [Obsolete("This class is obsolete. Please use ToolChatMessage instead.")]
1611 public class FunctionChatMessage : ChatMessage, IJsonModel<FunctionChatMessage>, IPersistableModel<FunctionChatMessage> {
1612 public FunctionChatMessage(string functionName, string content);
1613 public string FunctionName { get; }
1614 FunctionChatMessage IJsonModel<FunctionChatMessage>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1615 void IJsonModel<FunctionChatMessage>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1616 FunctionChatMessage IPersistableModel<FunctionChatMessage>.Create(BinaryData data, ModelReaderWriterOptions options);
1617 string IPersistableModel<FunctionChatMessage>.GetFormatFromOptions(ModelReaderWriterOptions options);
1618 BinaryData IPersistableModel<FunctionChatMessage>.Write(ModelReaderWriterOptions options);
1619 }
1620 public static class OpenAIChatModelFactory {
1621 public static ChatCompletion ChatCompletion(string id = null, ChatFinishReason finishReason = ChatFinishReason.Stop, ChatMessageContent content = null, string refusal = null, IEnumerable<ChatToolCall> toolCalls = null, ChatMessageRole role = ChatMessageRole.System, ChatFunctionCall functionCall = null, IEnumerable<ChatTokenLogProbabilityDetails> contentTokenLogProbabilities = null, IEnumerable<ChatTokenLogProbabilityDetails> refusalTokenLogProbabilities = null, DateTimeOffset createdAt = default, string model = null, string systemFingerprint = null, ChatTokenUsage usage = null);
1622 public static ChatOutputTokenUsageDetails ChatOutputTokenUsageDetails(int reasoningTokenCount = 0);
1623 public static ChatTokenLogProbabilityDetails ChatTokenLogProbabilityDetails(string token = null, float logProbability = 0, ReadOnlyMemory<byte>? utf8Bytes = null, IEnumerable<ChatTokenTopLogProbabilityDetails> topLogProbabilities = null);
1624 public static ChatTokenTopLogProbabilityDetails ChatTokenTopLogProbabilityDetails(string token = null, float logProbability = 0, ReadOnlyMemory<byte>? utf8Bytes = null);
1625 public static ChatTokenUsage ChatTokenUsage(int outputTokenCount = 0, int inputTokenCount = 0, int totalTokenCount = 0, ChatOutputTokenUsageDetails outputTokenDetails = null);
1626 public static StreamingChatCompletionUpdate StreamingChatCompletionUpdate(string completionId = null, ChatMessageContent contentUpdate = null, StreamingChatFunctionCallUpdate functionCallUpdate = null, IEnumerable<StreamingChatToolCallUpdate> toolCallUpdates = null, ChatMessageRole? role = null, string refusalUpdate = null, IEnumerable<ChatTokenLogProbabilityDetails> contentTokenLogProbabilities = null, IEnumerable<ChatTokenLogProbabilityDetails> refusalTokenLogProbabilities = null, ChatFinishReason? finishReason = null, DateTimeOffset createdAt = default, string model = null, string systemFingerprint = null, ChatTokenUsage usage = null);
1627 [Obsolete("This class is obsolete. Please use StreamingChatToolCallUpdate instead.")]
1628 public static StreamingChatFunctionCallUpdate StreamingChatFunctionCallUpdate(string functionName = null, BinaryData functionArgumentsUpdate = null);
1629 public static StreamingChatToolCallUpdate StreamingChatToolCallUpdate(int index = 0, string toolCallId = null, ChatToolCallKind kind = ChatToolCallKind.Function, string functionName = null, BinaryData functionArgumentsUpdate = null);
1630 }
1631 public class StreamingChatCompletionUpdate : IJsonModel<StreamingChatCompletionUpdate>, IPersistableModel<StreamingChatCompletionUpdate> {
1632 public string CompletionId { get; }
1633 public IReadOnlyList<ChatTokenLogProbabilityDetails> ContentTokenLogProbabilities { get; }
1634 public ChatMessageContent ContentUpdate { get; }
1635 public DateTimeOffset CreatedAt { get; }
1636 public ChatFinishReason? FinishReason { get; }
1637 [Obsolete("This property is obsolete. Please use ToolCallUpdates instead.")]
1638 public StreamingChatFunctionCallUpdate FunctionCallUpdate { get; }
1639 public string Model { get; }
1640 public IReadOnlyList<ChatTokenLogProbabilityDetails> RefusalTokenLogProbabilities { get; }
1641 public string RefusalUpdate { get; }
1642 public ChatMessageRole? Role { get; }
1643 public string SystemFingerprint { get; }
1644 public IReadOnlyList<StreamingChatToolCallUpdate> ToolCallUpdates { get; }
1645 public ChatTokenUsage Usage { get; }
1646 StreamingChatCompletionUpdate IJsonModel<StreamingChatCompletionUpdate>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1647 void IJsonModel<StreamingChatCompletionUpdate>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1648 StreamingChatCompletionUpdate IPersistableModel<StreamingChatCompletionUpdate>.Create(BinaryData data, ModelReaderWriterOptions options);
1649 string IPersistableModel<StreamingChatCompletionUpdate>.GetFormatFromOptions(ModelReaderWriterOptions options);
1650 BinaryData IPersistableModel<StreamingChatCompletionUpdate>.Write(ModelReaderWriterOptions options);
1651 }
1652 [Obsolete("This class is obsolete. Please use StreamingChatToolCallUpdate instead.")]
1653 public class StreamingChatFunctionCallUpdate : IJsonModel<StreamingChatFunctionCallUpdate>, IPersistableModel<StreamingChatFunctionCallUpdate> {
1654 public BinaryData FunctionArgumentsUpdate { get; }
1655 public string FunctionName { get; }
1656 StreamingChatFunctionCallUpdate IJsonModel<StreamingChatFunctionCallUpdate>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1657 void IJsonModel<StreamingChatFunctionCallUpdate>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1658 StreamingChatFunctionCallUpdate IPersistableModel<StreamingChatFunctionCallUpdate>.Create(BinaryData data, ModelReaderWriterOptions options);
1659 string IPersistableModel<StreamingChatFunctionCallUpdate>.GetFormatFromOptions(ModelReaderWriterOptions options);
1660 BinaryData IPersistableModel<StreamingChatFunctionCallUpdate>.Write(ModelReaderWriterOptions options);
1661 }
1662 public class StreamingChatToolCallUpdate : IJsonModel<StreamingChatToolCallUpdate>, IPersistableModel<StreamingChatToolCallUpdate> {
1663 public BinaryData FunctionArgumentsUpdate { get; }
1664 public string FunctionName { get; }
1665 public int Index { get; }
1666 public ChatToolCallKind Kind { get; }
1667 public string ToolCallId { get; }
1668 StreamingChatToolCallUpdate IJsonModel<StreamingChatToolCallUpdate>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1669 void IJsonModel<StreamingChatToolCallUpdate>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1670 StreamingChatToolCallUpdate IPersistableModel<StreamingChatToolCallUpdate>.Create(BinaryData data, ModelReaderWriterOptions options);
1671 string IPersistableModel<StreamingChatToolCallUpdate>.GetFormatFromOptions(ModelReaderWriterOptions options);
1672 BinaryData IPersistableModel<StreamingChatToolCallUpdate>.Write(ModelReaderWriterOptions options);
1673 }
1674 public class SystemChatMessage : ChatMessage, IJsonModel<SystemChatMessage>, IPersistableModel<SystemChatMessage> {
1675 public SystemChatMessage(params ChatMessageContentPart[] contentParts);
1676 public SystemChatMessage(IEnumerable<ChatMessageContentPart> contentParts);
1677 public SystemChatMessage(string content);
1678 public string ParticipantName { get; set; }
1679 SystemChatMessage IJsonModel<SystemChatMessage>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1680 void IJsonModel<SystemChatMessage>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1681 SystemChatMessage IPersistableModel<SystemChatMessage>.Create(BinaryData data, ModelReaderWriterOptions options);
1682 string IPersistableModel<SystemChatMessage>.GetFormatFromOptions(ModelReaderWriterOptions options);
1683 BinaryData IPersistableModel<SystemChatMessage>.Write(ModelReaderWriterOptions options);
1684 }
1685 public class ToolChatMessage : ChatMessage, IJsonModel<ToolChatMessage>, IPersistableModel<ToolChatMessage> {
1686 public ToolChatMessage(string toolCallId, params ChatMessageContentPart[] contentParts);
1687 public ToolChatMessage(string toolCallId, IEnumerable<ChatMessageContentPart> contentParts);
1688 public ToolChatMessage(string toolCallId, string content);
1689 public string ToolCallId { get; }
1690 ToolChatMessage IJsonModel<ToolChatMessage>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1691 void IJsonModel<ToolChatMessage>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1692 ToolChatMessage IPersistableModel<ToolChatMessage>.Create(BinaryData data, ModelReaderWriterOptions options);
1693 string IPersistableModel<ToolChatMessage>.GetFormatFromOptions(ModelReaderWriterOptions options);
1694 BinaryData IPersistableModel<ToolChatMessage>.Write(ModelReaderWriterOptions options);
1695 }
1696 public class UserChatMessage : ChatMessage, IJsonModel<UserChatMessage>, IPersistableModel<UserChatMessage> {
1697 public UserChatMessage(params ChatMessageContentPart[] contentParts);
1698 public UserChatMessage(IEnumerable<ChatMessageContentPart> contentParts);
1699 public UserChatMessage(string content);
1700 public string ParticipantName { get; set; }
1701 UserChatMessage IJsonModel<UserChatMessage>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1702 void IJsonModel<UserChatMessage>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1703 UserChatMessage IPersistableModel<UserChatMessage>.Create(BinaryData data, ModelReaderWriterOptions options);
1704 string IPersistableModel<UserChatMessage>.GetFormatFromOptions(ModelReaderWriterOptions options);
1705 BinaryData IPersistableModel<UserChatMessage>.Write(ModelReaderWriterOptions options);
1706 }
1707}
1708namespace OpenAI.Embeddings {
1709 public class EmbeddingClient {
1710 protected EmbeddingClient();
1711 protected internal EmbeddingClient(ClientPipeline pipeline, string model, OpenAIClientOptions options);
1712 public EmbeddingClient(string model, ApiKeyCredential credential, OpenAIClientOptions options);
1713 public EmbeddingClient(string model, ApiKeyCredential credential);
1714 public EmbeddingClient(string model, string apiKey);
1715 public ClientPipeline Pipeline { get; }
1716 public virtual ClientResult<OpenAIEmbedding> GenerateEmbedding(string input, EmbeddingGenerationOptions options = null, CancellationToken cancellationToken = default);
1717 public virtual Task<ClientResult<OpenAIEmbedding>> GenerateEmbeddingAsync(string input, EmbeddingGenerationOptions options = null, CancellationToken cancellationToken = default);
1718 [EditorBrowsable(EditorBrowsableState.Never)]
1719 public virtual ClientResult GenerateEmbeddings(BinaryContent content, RequestOptions options = null);
1720 public virtual ClientResult<OpenAIEmbeddingCollection> GenerateEmbeddings(IEnumerable<ReadOnlyMemory<int>> inputs, EmbeddingGenerationOptions options = null, CancellationToken cancellationToken = default);
1721 public virtual ClientResult<OpenAIEmbeddingCollection> GenerateEmbeddings(IEnumerable<string> inputs, EmbeddingGenerationOptions options = null, CancellationToken cancellationToken = default);
1722 [EditorBrowsable(EditorBrowsableState.Never)]
1723 public virtual Task<ClientResult> GenerateEmbeddingsAsync(BinaryContent content, RequestOptions options = null);
1724 public virtual Task<ClientResult<OpenAIEmbeddingCollection>> GenerateEmbeddingsAsync(IEnumerable<ReadOnlyMemory<int>> inputs, EmbeddingGenerationOptions options = null, CancellationToken cancellationToken = default);
1725 public virtual Task<ClientResult<OpenAIEmbeddingCollection>> GenerateEmbeddingsAsync(IEnumerable<string> inputs, EmbeddingGenerationOptions options = null, CancellationToken cancellationToken = default);
1726 }
1727 public class EmbeddingGenerationOptions : IJsonModel<EmbeddingGenerationOptions>, IPersistableModel<EmbeddingGenerationOptions> {
1728 public int? Dimensions { get; set; }
1729 public string EndUserId { get; set; }
1730 EmbeddingGenerationOptions IJsonModel<EmbeddingGenerationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1731 void IJsonModel<EmbeddingGenerationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1732 EmbeddingGenerationOptions IPersistableModel<EmbeddingGenerationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
1733 string IPersistableModel<EmbeddingGenerationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
1734 BinaryData IPersistableModel<EmbeddingGenerationOptions>.Write(ModelReaderWriterOptions options);
1735 }
1736 public class EmbeddingTokenUsage : IJsonModel<EmbeddingTokenUsage>, IPersistableModel<EmbeddingTokenUsage> {
1737 public int InputTokenCount { get; }
1738 public int TotalTokenCount { get; }
1739 EmbeddingTokenUsage IJsonModel<EmbeddingTokenUsage>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1740 void IJsonModel<EmbeddingTokenUsage>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1741 EmbeddingTokenUsage IPersistableModel<EmbeddingTokenUsage>.Create(BinaryData data, ModelReaderWriterOptions options);
1742 string IPersistableModel<EmbeddingTokenUsage>.GetFormatFromOptions(ModelReaderWriterOptions options);
1743 BinaryData IPersistableModel<EmbeddingTokenUsage>.Write(ModelReaderWriterOptions options);
1744 }
1745 public class OpenAIEmbedding : IJsonModel<OpenAIEmbedding>, IPersistableModel<OpenAIEmbedding> {
1746 public int Index { get; }
1747 OpenAIEmbedding IJsonModel<OpenAIEmbedding>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1748 void IJsonModel<OpenAIEmbedding>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1749 OpenAIEmbedding IPersistableModel<OpenAIEmbedding>.Create(BinaryData data, ModelReaderWriterOptions options);
1750 string IPersistableModel<OpenAIEmbedding>.GetFormatFromOptions(ModelReaderWriterOptions options);
1751 BinaryData IPersistableModel<OpenAIEmbedding>.Write(ModelReaderWriterOptions options);
1752 public ReadOnlyMemory<float> ToFloats();
1753 }
1754 public class OpenAIEmbeddingCollection : ObjectModel.ReadOnlyCollection<OpenAIEmbedding>, IJsonModel<OpenAIEmbeddingCollection>, IPersistableModel<OpenAIEmbeddingCollection> {
1755 public string Model { get; }
1756 public EmbeddingTokenUsage Usage { get; }
1757 OpenAIEmbeddingCollection IJsonModel<OpenAIEmbeddingCollection>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1758 void IJsonModel<OpenAIEmbeddingCollection>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1759 OpenAIEmbeddingCollection IPersistableModel<OpenAIEmbeddingCollection>.Create(BinaryData data, ModelReaderWriterOptions options);
1760 string IPersistableModel<OpenAIEmbeddingCollection>.GetFormatFromOptions(ModelReaderWriterOptions options);
1761 BinaryData IPersistableModel<OpenAIEmbeddingCollection>.Write(ModelReaderWriterOptions options);
1762 }
1763 public static class OpenAIEmbeddingsModelFactory {
1764 public static EmbeddingTokenUsage EmbeddingTokenUsage(int inputTokenCount = 0, int totalTokenCount = 0);
1765 public static OpenAIEmbedding OpenAIEmbedding(int index = 0, IEnumerable<float> vector = null);
1766 public static OpenAIEmbeddingCollection OpenAIEmbeddingCollection(IEnumerable<OpenAIEmbedding> items = null, string model = null, EmbeddingTokenUsage usage = null);
1767 }
1768}
1769namespace OpenAI.Files {
1770 public class FileDeletionResult : IJsonModel<FileDeletionResult>, IPersistableModel<FileDeletionResult> {
1771 public bool Deleted { get; }
1772 public string FileId { get; }
1773 FileDeletionResult IJsonModel<FileDeletionResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1774 void IJsonModel<FileDeletionResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1775 FileDeletionResult IPersistableModel<FileDeletionResult>.Create(BinaryData data, ModelReaderWriterOptions options);
1776 string IPersistableModel<FileDeletionResult>.GetFormatFromOptions(ModelReaderWriterOptions options);
1777 BinaryData IPersistableModel<FileDeletionResult>.Write(ModelReaderWriterOptions options);
1778 }
1779 public enum FilePurpose {
1780 Assistants = 0,
1781 AssistantsOutput = 1,
1782 Batch = 2,
1783 BatchOutput = 3,
1784 FineTune = 4,
1785 FineTuneResults = 5,
1786 Vision = 6
1787 }
1788 [Obsolete("This struct is obsolete. If this is a fine-tuning training file, it may take some time to process after it has been uploaded. While the file is processing, you can still create a fine-tuning job but it will not start until the file processing has completed.")]
1789 public enum FileStatus {
1790 Uploaded = 0,
1791 Processed = 1,
1792 Error = 2
1793 }
1794 public readonly partial struct FileUploadPurpose : IEquatable<FileUploadPurpose> {
1795 private readonly object _dummy;
1796 private readonly int _dummyPrimitive;
1797 public FileUploadPurpose(string value);
1798 public static FileUploadPurpose Assistants { get; }
1799 public static FileUploadPurpose Batch { get; }
1800 public static FileUploadPurpose FineTune { get; }
1801 public static FileUploadPurpose Vision { get; }
1802 public readonly bool Equals(FileUploadPurpose other);
1803 [EditorBrowsable(EditorBrowsableState.Never)]
1804 public override readonly bool Equals(object obj);
1805 [EditorBrowsable(EditorBrowsableState.Never)]
1806 public override readonly int GetHashCode();
1807 public static bool operator ==(FileUploadPurpose left, FileUploadPurpose right);
1808 public static implicit operator FileUploadPurpose(string value);
1809 public static bool operator !=(FileUploadPurpose left, FileUploadPurpose right);
1810 public override readonly string ToString();
1811 }
1812 public class OpenAIFile : IJsonModel<OpenAIFile>, IPersistableModel<OpenAIFile> {
1813 public DateTimeOffset CreatedAt { get; }
1814 public string Filename { get; }
1815 public string Id { get; }
1816 public FilePurpose Purpose { get; }
1817 public int? SizeInBytes { get; }
1818 [Obsolete("This property is obsolete. If this is a fine-tuning training file, it may take some time to process after it has been uploaded. While the file is processing, you can still create a fine-tuning job but it will not start until the file processing has completed.")]
1819 public FileStatus Status { get; }
1820 [Obsolete("This property is obsolete. For details on why a fine-tuning training file failed validation, see the `error` field on the fine-tuning job.")]
1821 public string StatusDetails { get; }
1822 OpenAIFile IJsonModel<OpenAIFile>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1823 void IJsonModel<OpenAIFile>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1824 OpenAIFile IPersistableModel<OpenAIFile>.Create(BinaryData data, ModelReaderWriterOptions options);
1825 string IPersistableModel<OpenAIFile>.GetFormatFromOptions(ModelReaderWriterOptions options);
1826 BinaryData IPersistableModel<OpenAIFile>.Write(ModelReaderWriterOptions options);
1827 }
1828 public class OpenAIFileClient {
1829 protected OpenAIFileClient();
1830 public OpenAIFileClient(ApiKeyCredential credential, OpenAIClientOptions options);
1831 public OpenAIFileClient(ApiKeyCredential credential);
1832 protected internal OpenAIFileClient(ClientPipeline pipeline, OpenAIClientOptions options);
1833 public OpenAIFileClient(string apiKey);
1834 public ClientPipeline Pipeline { get; }
1835 public virtual ClientResult AddUploadPart(string uploadId, BinaryContent content, string contentType, RequestOptions options = null);
1836 public virtual Task<ClientResult> AddUploadPartAsync(string uploadId, BinaryContent content, string contentType, RequestOptions options = null);
1837 public virtual ClientResult CancelUpload(string uploadId, RequestOptions options = null);
1838 public virtual Task<ClientResult> CancelUploadAsync(string uploadId, RequestOptions options = null);
1839 public virtual ClientResult CompleteUpload(string uploadId, BinaryContent content, RequestOptions options = null);
1840 public virtual Task<ClientResult> CompleteUploadAsync(string uploadId, BinaryContent content, RequestOptions options = null);
1841 public virtual ClientResult CreateUpload(BinaryContent content, RequestOptions options = null);
1842 public virtual Task<ClientResult> CreateUploadAsync(BinaryContent content, RequestOptions options = null);
1843 [EditorBrowsable(EditorBrowsableState.Never)]
1844 public virtual ClientResult DeleteFile(string fileId, RequestOptions options);
1845 public virtual ClientResult<FileDeletionResult> DeleteFile(string fileId, CancellationToken cancellationToken = default);
1846 [EditorBrowsable(EditorBrowsableState.Never)]
1847 public virtual Task<ClientResult> DeleteFileAsync(string fileId, RequestOptions options);
1848 public virtual Task<ClientResult<FileDeletionResult>> DeleteFileAsync(string fileId, CancellationToken cancellationToken = default);
1849 [EditorBrowsable(EditorBrowsableState.Never)]
1850 public virtual ClientResult DownloadFile(string fileId, RequestOptions options);
1851 public virtual ClientResult<BinaryData> DownloadFile(string fileId, CancellationToken cancellationToken = default);
1852 [EditorBrowsable(EditorBrowsableState.Never)]
1853 public virtual Task<ClientResult> DownloadFileAsync(string fileId, RequestOptions options);
1854 public virtual Task<ClientResult<BinaryData>> DownloadFileAsync(string fileId, CancellationToken cancellationToken = default);
1855 [EditorBrowsable(EditorBrowsableState.Never)]
1856 public virtual ClientResult GetFile(string fileId, RequestOptions options);
1857 public virtual ClientResult<OpenAIFile> GetFile(string fileId, CancellationToken cancellationToken = default);
1858 [EditorBrowsable(EditorBrowsableState.Never)]
1859 public virtual Task<ClientResult> GetFileAsync(string fileId, RequestOptions options);
1860 public virtual Task<ClientResult<OpenAIFile>> GetFileAsync(string fileId, CancellationToken cancellationToken = default);
1861 public virtual ClientResult<OpenAIFileCollection> GetFiles(FilePurpose purpose, CancellationToken cancellationToken = default);
1862 [EditorBrowsable(EditorBrowsableState.Never)]
1863 public virtual ClientResult GetFiles(string purpose, RequestOptions options);
1864 public virtual ClientResult<OpenAIFileCollection> GetFiles(CancellationToken cancellationToken = default);
1865 public virtual Task<ClientResult<OpenAIFileCollection>> GetFilesAsync(FilePurpose purpose, CancellationToken cancellationToken = default);
1866 [EditorBrowsable(EditorBrowsableState.Never)]
1867 public virtual Task<ClientResult> GetFilesAsync(string purpose, RequestOptions options);
1868 public virtual Task<ClientResult<OpenAIFileCollection>> GetFilesAsync(CancellationToken cancellationToken = default);
1869 public virtual ClientResult<OpenAIFile> UploadFile(BinaryData file, string filename, FileUploadPurpose purpose);
1870 [EditorBrowsable(EditorBrowsableState.Never)]
1871 public virtual ClientResult UploadFile(BinaryContent content, string contentType, RequestOptions options = null);
1872 public virtual ClientResult<OpenAIFile> UploadFile(Stream file, string filename, FileUploadPurpose purpose, CancellationToken cancellationToken = default);
1873 public virtual ClientResult<OpenAIFile> UploadFile(string filePath, FileUploadPurpose purpose);
1874 public virtual Task<ClientResult<OpenAIFile>> UploadFileAsync(BinaryData file, string filename, FileUploadPurpose purpose);
1875 [EditorBrowsable(EditorBrowsableState.Never)]
1876 public virtual Task<ClientResult> UploadFileAsync(BinaryContent content, string contentType, RequestOptions options = null);
1877 public virtual Task<ClientResult<OpenAIFile>> UploadFileAsync(Stream file, string filename, FileUploadPurpose purpose, CancellationToken cancellationToken = default);
1878 public virtual Task<ClientResult<OpenAIFile>> UploadFileAsync(string filePath, FileUploadPurpose purpose);
1879 }
1880 public class OpenAIFileCollection : ObjectModel.ReadOnlyCollection<OpenAIFile>, IJsonModel<OpenAIFileCollection>, IPersistableModel<OpenAIFileCollection> {
1881 OpenAIFileCollection IJsonModel<OpenAIFileCollection>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1882 void IJsonModel<OpenAIFileCollection>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1883 OpenAIFileCollection IPersistableModel<OpenAIFileCollection>.Create(BinaryData data, ModelReaderWriterOptions options);
1884 string IPersistableModel<OpenAIFileCollection>.GetFormatFromOptions(ModelReaderWriterOptions options);
1885 BinaryData IPersistableModel<OpenAIFileCollection>.Write(ModelReaderWriterOptions options);
1886 }
1887 public static class OpenAIFilesModelFactory {
1888 public static FileDeletionResult FileDeletionResult(string fileId = null, bool deleted = false);
1889 public static OpenAIFileCollection OpenAIFileCollection(IEnumerable<OpenAIFile> items = null);
1890 public static OpenAIFile OpenAIFileInfo(string id = null, int? sizeInBytes = null, DateTimeOffset createdAt = default, string filename = null, FilePurpose purpose = FilePurpose.Assistants, FileStatus status = FileStatus.Uploaded, string statusDetails = null);
1891 }
1892}
1893namespace OpenAI.FineTuning {
1894 public class FineTuningClient {
1895 protected FineTuningClient();
1896 public FineTuningClient(ApiKeyCredential credential, OpenAIClientOptions options);
1897 public FineTuningClient(ApiKeyCredential credential);
1898 protected internal FineTuningClient(ClientPipeline pipeline, OpenAIClientOptions options);
1899 public FineTuningClient(string apiKey);
1900 public ClientPipeline Pipeline { get; }
1901 public virtual FineTuningJobOperation CreateFineTuningJob(BinaryContent content, bool waitUntilCompleted, RequestOptions options = null);
1902 public virtual Task<FineTuningJobOperation> CreateFineTuningJobAsync(BinaryContent content, bool waitUntilCompleted, RequestOptions options = null);
1903 public virtual ClientResult GetJob(string fineTuningJobId, RequestOptions options);
1904 public virtual Task<ClientResult> GetJobAsync(string fineTuningJobId, RequestOptions options);
1905 public virtual CollectionResult GetJobs(string after, int? limit, RequestOptions options);
1906 public virtual AsyncCollectionResult GetJobsAsync(string after, int? limit, RequestOptions options);
1907 }
1908 public class FineTuningJobOperation : OperationResult {
1909 public string JobId { get; }
1910 public override ContinuationToken? RehydrationToken { get; protected set; }
1911 public virtual ClientResult Cancel(RequestOptions? options);
1912 public virtual Task<ClientResult> CancelAsync(RequestOptions? options);
1913 public virtual ClientResult GetJob(RequestOptions? options);
1914 public virtual Task<ClientResult> GetJobAsync(RequestOptions? options);
1915 public virtual CollectionResult GetJobCheckpoints(string? after, int? limit, RequestOptions? options);
1916 public virtual AsyncCollectionResult GetJobCheckpointsAsync(string? after, int? limit, RequestOptions? options);
1917 public virtual CollectionResult GetJobEvents(string? after, int? limit, RequestOptions options);
1918 public virtual AsyncCollectionResult GetJobEventsAsync(string? after, int? limit, RequestOptions options);
1919 public static FineTuningJobOperation Rehydrate(FineTuningClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default);
1920 public static FineTuningJobOperation Rehydrate(FineTuningClient client, string fineTuningJobId, CancellationToken cancellationToken = default);
1921 public static Task<FineTuningJobOperation> RehydrateAsync(FineTuningClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default);
1922 public static Task<FineTuningJobOperation> RehydrateAsync(FineTuningClient client, string fineTuningJobId, CancellationToken cancellationToken = default);
1923 public override ClientResult UpdateStatus(RequestOptions? options = null);
1924 public override ValueTask<ClientResult> UpdateStatusAsync(RequestOptions? options = null);
1925 }
1926}
1927namespace OpenAI.Images {
1928 public class GeneratedImage : IJsonModel<GeneratedImage>, IPersistableModel<GeneratedImage> {
1929 public BinaryData ImageBytes { get; }
1930 public Uri ImageUri { get; }
1931 public string RevisedPrompt { get; }
1932 GeneratedImage IJsonModel<GeneratedImage>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1933 void IJsonModel<GeneratedImage>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1934 GeneratedImage IPersistableModel<GeneratedImage>.Create(BinaryData data, ModelReaderWriterOptions options);
1935 string IPersistableModel<GeneratedImage>.GetFormatFromOptions(ModelReaderWriterOptions options);
1936 BinaryData IPersistableModel<GeneratedImage>.Write(ModelReaderWriterOptions options);
1937 }
1938 public class GeneratedImageCollection : ObjectModel.ReadOnlyCollection<GeneratedImage>, IJsonModel<GeneratedImageCollection>, IPersistableModel<GeneratedImageCollection> {
1939 public DateTimeOffset CreatedAt { get; }
1940 GeneratedImageCollection IJsonModel<GeneratedImageCollection>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
1941 void IJsonModel<GeneratedImageCollection>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
1942 GeneratedImageCollection IPersistableModel<GeneratedImageCollection>.Create(BinaryData data, ModelReaderWriterOptions options);
1943 string IPersistableModel<GeneratedImageCollection>.GetFormatFromOptions(ModelReaderWriterOptions options);
1944 BinaryData IPersistableModel<GeneratedImageCollection>.Write(ModelReaderWriterOptions options);
1945 }
1946 public readonly partial struct GeneratedImageFormat : IEquatable<GeneratedImageFormat> {
1947 private readonly object _dummy;
1948 private readonly int _dummyPrimitive;
1949 public GeneratedImageFormat(string value);
1950 public static GeneratedImageFormat Bytes { get; }
1951 public static GeneratedImageFormat Uri { get; }
1952 public readonly bool Equals(GeneratedImageFormat other);
1953 [EditorBrowsable(EditorBrowsableState.Never)]
1954 public override readonly bool Equals(object obj);
1955 [EditorBrowsable(EditorBrowsableState.Never)]
1956 public override readonly int GetHashCode();
1957 public static bool operator ==(GeneratedImageFormat left, GeneratedImageFormat right);
1958 public static implicit operator GeneratedImageFormat(string value);
1959 public static bool operator !=(GeneratedImageFormat left, GeneratedImageFormat right);
1960 public override readonly string ToString();
1961 }
1962 public readonly partial struct GeneratedImageQuality : IEquatable<GeneratedImageQuality> {
1963 private readonly object _dummy;
1964 private readonly int _dummyPrimitive;
1965 public GeneratedImageQuality(string value);
1966 public static GeneratedImageQuality High { get; }
1967 public static GeneratedImageQuality Standard { get; }
1968 public readonly bool Equals(GeneratedImageQuality other);
1969 [EditorBrowsable(EditorBrowsableState.Never)]
1970 public override readonly bool Equals(object obj);
1971 [EditorBrowsable(EditorBrowsableState.Never)]
1972 public override readonly int GetHashCode();
1973 public static bool operator ==(GeneratedImageQuality left, GeneratedImageQuality right);
1974 public static implicit operator GeneratedImageQuality(string value);
1975 public static bool operator !=(GeneratedImageQuality left, GeneratedImageQuality right);
1976 public override readonly string ToString();
1977 }
1978 public readonly partial struct GeneratedImageSize : IEquatable<GeneratedImageSize> {
1979 private readonly object _dummy;
1980 private readonly int _dummyPrimitive;
1981 public static readonly GeneratedImageSize W1024xH1024;
1982 public static readonly GeneratedImageSize W1024xH1792;
1983 public static readonly GeneratedImageSize W1792xH1024;
1984 public static readonly GeneratedImageSize W256xH256;
1985 public static readonly GeneratedImageSize W512xH512;
1986 public GeneratedImageSize(int width, int height);
1987 public readonly bool Equals(GeneratedImageSize other);
1988 [EditorBrowsable(EditorBrowsableState.Never)]
1989 public override readonly bool Equals(object obj);
1990 [EditorBrowsable(EditorBrowsableState.Never)]
1991 public override readonly int GetHashCode();
1992 public static bool operator ==(GeneratedImageSize left, GeneratedImageSize right);
1993 public static bool operator !=(GeneratedImageSize left, GeneratedImageSize right);
1994 public override readonly string ToString();
1995 }
1996 public readonly partial struct GeneratedImageStyle : IEquatable<GeneratedImageStyle> {
1997 private readonly object _dummy;
1998 private readonly int _dummyPrimitive;
1999 public GeneratedImageStyle(string value);
2000 public static GeneratedImageStyle Natural { get; }
2001 public static GeneratedImageStyle Vivid { get; }
2002 public readonly bool Equals(GeneratedImageStyle other);
2003 [EditorBrowsable(EditorBrowsableState.Never)]
2004 public override readonly bool Equals(object obj);
2005 [EditorBrowsable(EditorBrowsableState.Never)]
2006 public override readonly int GetHashCode();
2007 public static bool operator ==(GeneratedImageStyle left, GeneratedImageStyle right);
2008 public static implicit operator GeneratedImageStyle(string value);
2009 public static bool operator !=(GeneratedImageStyle left, GeneratedImageStyle right);
2010 public override readonly string ToString();
2011 }
2012 public class ImageClient {
2013 protected ImageClient();
2014 protected internal ImageClient(ClientPipeline pipeline, string model, OpenAIClientOptions options);
2015 public ImageClient(string model, ApiKeyCredential credential, OpenAIClientOptions options);
2016 public ImageClient(string model, ApiKeyCredential credential);
2017 public ImageClient(string model, string apiKey);
2018 public ClientPipeline Pipeline { get; }
2019 public virtual ClientResult<GeneratedImage> GenerateImage(string prompt, ImageGenerationOptions options = null, CancellationToken cancellationToken = default);
2020 public virtual Task<ClientResult<GeneratedImage>> GenerateImageAsync(string prompt, ImageGenerationOptions options = null, CancellationToken cancellationToken = default);
2021 public virtual ClientResult<GeneratedImage> GenerateImageEdit(Stream image, string imageFilename, string prompt, ImageEditOptions options = null, CancellationToken cancellationToken = default);
2022 public virtual ClientResult<GeneratedImage> GenerateImageEdit(Stream image, string imageFilename, string prompt, Stream mask, string maskFilename, ImageEditOptions options = null, CancellationToken cancellationToken = default);
2023 public virtual ClientResult<GeneratedImage> GenerateImageEdit(string imageFilePath, string prompt, ImageEditOptions options = null);
2024 public virtual ClientResult<GeneratedImage> GenerateImageEdit(string imageFilePath, string prompt, string maskFilePath, ImageEditOptions options = null);
2025 public virtual Task<ClientResult<GeneratedImage>> GenerateImageEditAsync(Stream image, string imageFilename, string prompt, ImageEditOptions options = null, CancellationToken cancellationToken = default);
2026 public virtual Task<ClientResult<GeneratedImage>> GenerateImageEditAsync(Stream image, string imageFilename, string prompt, Stream mask, string maskFilename, ImageEditOptions options = null, CancellationToken cancellationToken = default);
2027 public virtual Task<ClientResult<GeneratedImage>> GenerateImageEditAsync(string imageFilePath, string prompt, ImageEditOptions options = null);
2028 public virtual Task<ClientResult<GeneratedImage>> GenerateImageEditAsync(string imageFilePath, string prompt, string maskFilePath, ImageEditOptions options = null);
2029 [EditorBrowsable(EditorBrowsableState.Never)]
2030 public virtual ClientResult GenerateImageEdits(BinaryContent content, string contentType, RequestOptions options = null);
2031 public virtual ClientResult<GeneratedImageCollection> GenerateImageEdits(Stream image, string imageFilename, string prompt, int imageCount, ImageEditOptions options = null, CancellationToken cancellationToken = default);
2032 public virtual ClientResult<GeneratedImageCollection> GenerateImageEdits(Stream image, string imageFilename, string prompt, Stream mask, string maskFilename, int imageCount, ImageEditOptions options = null, CancellationToken cancellationToken = default);
2033 public virtual ClientResult<GeneratedImageCollection> GenerateImageEdits(string imageFilePath, string prompt, int imageCount, ImageEditOptions options = null);
2034 public virtual ClientResult<GeneratedImageCollection> GenerateImageEdits(string imageFilePath, string prompt, string maskFilePath, int imageCount, ImageEditOptions options = null);
2035 [EditorBrowsable(EditorBrowsableState.Never)]
2036 public virtual Task<ClientResult> GenerateImageEditsAsync(BinaryContent content, string contentType, RequestOptions options = null);
2037 public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImageEditsAsync(Stream image, string imageFilename, string prompt, int imageCount, ImageEditOptions options = null, CancellationToken cancellationToken = default);
2038 public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImageEditsAsync(Stream image, string imageFilename, string prompt, Stream mask, string maskFilename, int imageCount, ImageEditOptions options = null, CancellationToken cancellationToken = default);
2039 public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImageEditsAsync(string imageFilePath, string prompt, int imageCount, ImageEditOptions options = null);
2040 public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImageEditsAsync(string imageFilePath, string prompt, string maskFilePath, int imageCount, ImageEditOptions options = null);
2041 [EditorBrowsable(EditorBrowsableState.Never)]
2042 public virtual ClientResult GenerateImages(BinaryContent content, RequestOptions options = null);
2043 public virtual ClientResult<GeneratedImageCollection> GenerateImages(string prompt, int imageCount, ImageGenerationOptions options = null, CancellationToken cancellationToken = default);
2044 [EditorBrowsable(EditorBrowsableState.Never)]
2045 public virtual Task<ClientResult> GenerateImagesAsync(BinaryContent content, RequestOptions options = null);
2046 public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImagesAsync(string prompt, int imageCount, ImageGenerationOptions options = null, CancellationToken cancellationToken = default);
2047 public virtual ClientResult<GeneratedImage> GenerateImageVariation(Stream image, string imageFilename, ImageVariationOptions options = null, CancellationToken cancellationToken = default);
2048 public virtual ClientResult<GeneratedImage> GenerateImageVariation(string imageFilePath, ImageVariationOptions options = null);
2049 public virtual Task<ClientResult<GeneratedImage>> GenerateImageVariationAsync(Stream image, string imageFilename, ImageVariationOptions options = null, CancellationToken cancellationToken = default);
2050 public virtual Task<ClientResult<GeneratedImage>> GenerateImageVariationAsync(string imageFilePath, ImageVariationOptions options = null);
2051 [EditorBrowsable(EditorBrowsableState.Never)]
2052 public virtual ClientResult GenerateImageVariations(BinaryContent content, string contentType, RequestOptions options = null);
2053 public virtual ClientResult<GeneratedImageCollection> GenerateImageVariations(Stream image, string imageFilename, int imageCount, ImageVariationOptions options = null, CancellationToken cancellationToken = default);
2054 public virtual ClientResult<GeneratedImageCollection> GenerateImageVariations(string imageFilePath, int imageCount, ImageVariationOptions options = null);
2055 [EditorBrowsable(EditorBrowsableState.Never)]
2056 public virtual Task<ClientResult> GenerateImageVariationsAsync(BinaryContent content, string contentType, RequestOptions options = null);
2057 public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImageVariationsAsync(Stream image, string imageFilename, int imageCount, ImageVariationOptions options = null, CancellationToken cancellationToken = default);
2058 public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImageVariationsAsync(string imageFilePath, int imageCount, ImageVariationOptions options = null);
2059 }
2060 public class ImageEditOptions : IJsonModel<ImageEditOptions>, IPersistableModel<ImageEditOptions> {
2061 public string EndUserId { get; set; }
2062 public GeneratedImageFormat? ResponseFormat { get; set; }
2063 public GeneratedImageSize? Size { get; set; }
2064 ImageEditOptions IJsonModel<ImageEditOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2065 void IJsonModel<ImageEditOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2066 ImageEditOptions IPersistableModel<ImageEditOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
2067 string IPersistableModel<ImageEditOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
2068 BinaryData IPersistableModel<ImageEditOptions>.Write(ModelReaderWriterOptions options);
2069 }
2070 public class ImageGenerationOptions : IJsonModel<ImageGenerationOptions>, IPersistableModel<ImageGenerationOptions> {
2071 public string EndUserId { get; set; }
2072 public GeneratedImageQuality? Quality { get; set; }
2073 public GeneratedImageFormat? ResponseFormat { get; set; }
2074 public GeneratedImageSize? Size { get; set; }
2075 public GeneratedImageStyle? Style { get; set; }
2076 ImageGenerationOptions IJsonModel<ImageGenerationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2077 void IJsonModel<ImageGenerationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2078 ImageGenerationOptions IPersistableModel<ImageGenerationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
2079 string IPersistableModel<ImageGenerationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
2080 BinaryData IPersistableModel<ImageGenerationOptions>.Write(ModelReaderWriterOptions options);
2081 }
2082 public class ImageVariationOptions : IJsonModel<ImageVariationOptions>, IPersistableModel<ImageVariationOptions> {
2083 public string EndUserId { get; set; }
2084 public GeneratedImageFormat? ResponseFormat { get; set; }
2085 public GeneratedImageSize? Size { get; set; }
2086 ImageVariationOptions IJsonModel<ImageVariationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2087 void IJsonModel<ImageVariationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2088 ImageVariationOptions IPersistableModel<ImageVariationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
2089 string IPersistableModel<ImageVariationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
2090 BinaryData IPersistableModel<ImageVariationOptions>.Write(ModelReaderWriterOptions options);
2091 }
2092 public static class OpenAIImagesModelFactory {
2093 public static GeneratedImage GeneratedImage(BinaryData imageBytes = null, Uri imageUri = null, string revisedPrompt = null);
2094 public static GeneratedImageCollection GeneratedImageCollection(DateTimeOffset createdAt = default, IEnumerable<GeneratedImage> items = null);
2095 }
2096}
2097namespace OpenAI.Models {
2098 public class ModelDeletionResult : IJsonModel<ModelDeletionResult>, IPersistableModel<ModelDeletionResult> {
2099 public bool Deleted { get; }
2100 public string ModelId { get; }
2101 ModelDeletionResult IJsonModel<ModelDeletionResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2102 void IJsonModel<ModelDeletionResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2103 ModelDeletionResult IPersistableModel<ModelDeletionResult>.Create(BinaryData data, ModelReaderWriterOptions options);
2104 string IPersistableModel<ModelDeletionResult>.GetFormatFromOptions(ModelReaderWriterOptions options);
2105 BinaryData IPersistableModel<ModelDeletionResult>.Write(ModelReaderWriterOptions options);
2106 }
2107 public class OpenAIModel : IJsonModel<OpenAIModel>, IPersistableModel<OpenAIModel> {
2108 public DateTimeOffset CreatedAt { get; }
2109 public string Id { get; }
2110 public string OwnedBy { get; }
2111 OpenAIModel IJsonModel<OpenAIModel>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2112 void IJsonModel<OpenAIModel>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2113 OpenAIModel IPersistableModel<OpenAIModel>.Create(BinaryData data, ModelReaderWriterOptions options);
2114 string IPersistableModel<OpenAIModel>.GetFormatFromOptions(ModelReaderWriterOptions options);
2115 BinaryData IPersistableModel<OpenAIModel>.Write(ModelReaderWriterOptions options);
2116 }
2117 public class OpenAIModelClient {
2118 protected OpenAIModelClient();
2119 public OpenAIModelClient(ApiKeyCredential credential, OpenAIClientOptions options);
2120 public OpenAIModelClient(ApiKeyCredential credential);
2121 protected internal OpenAIModelClient(ClientPipeline pipeline, OpenAIClientOptions options);
2122 public OpenAIModelClient(string apiKey);
2123 public ClientPipeline Pipeline { get; }
2124 [EditorBrowsable(EditorBrowsableState.Never)]
2125 public virtual ClientResult DeleteModel(string model, RequestOptions options);
2126 public virtual ClientResult<ModelDeletionResult> DeleteModel(string model, CancellationToken cancellationToken = default);
2127 [EditorBrowsable(EditorBrowsableState.Never)]
2128 public virtual Task<ClientResult> DeleteModelAsync(string model, RequestOptions options);
2129 public virtual Task<ClientResult<ModelDeletionResult>> DeleteModelAsync(string model, CancellationToken cancellationToken = default);
2130 [EditorBrowsable(EditorBrowsableState.Never)]
2131 public virtual ClientResult GetModel(string model, RequestOptions options);
2132 public virtual ClientResult<OpenAIModel> GetModel(string model, CancellationToken cancellationToken = default);
2133 [EditorBrowsable(EditorBrowsableState.Never)]
2134 public virtual Task<ClientResult> GetModelAsync(string model, RequestOptions options);
2135 public virtual Task<ClientResult<OpenAIModel>> GetModelAsync(string model, CancellationToken cancellationToken = default);
2136 [EditorBrowsable(EditorBrowsableState.Never)]
2137 public virtual ClientResult GetModels(RequestOptions options);
2138 public virtual ClientResult<OpenAIModelCollection> GetModels(CancellationToken cancellationToken = default);
2139 [EditorBrowsable(EditorBrowsableState.Never)]
2140 public virtual Task<ClientResult> GetModelsAsync(RequestOptions options);
2141 public virtual Task<ClientResult<OpenAIModelCollection>> GetModelsAsync(CancellationToken cancellationToken = default);
2142 }
2143 public class OpenAIModelCollection : ObjectModel.ReadOnlyCollection<OpenAIModel>, IJsonModel<OpenAIModelCollection>, IPersistableModel<OpenAIModelCollection> {
2144 OpenAIModelCollection IJsonModel<OpenAIModelCollection>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2145 void IJsonModel<OpenAIModelCollection>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2146 OpenAIModelCollection IPersistableModel<OpenAIModelCollection>.Create(BinaryData data, ModelReaderWriterOptions options);
2147 string IPersistableModel<OpenAIModelCollection>.GetFormatFromOptions(ModelReaderWriterOptions options);
2148 BinaryData IPersistableModel<OpenAIModelCollection>.Write(ModelReaderWriterOptions options);
2149 }
2150 public static class OpenAIModelsModelFactory {
2151 public static ModelDeletionResult ModelDeletionResult(string modelId = null, bool deleted = false);
2152 public static OpenAIModel OpenAIModel(string id = null, DateTimeOffset createdAt = default, string ownedBy = null);
2153 public static OpenAIModelCollection OpenAIModelCollection(IEnumerable<OpenAIModel> items = null);
2154 }
2155}
2156namespace OpenAI.Moderations {
2157 public class ModerationCategory {
2158 public bool Flagged { get; }
2159 public float Score { get; }
2160 }
2161 public class ModerationClient {
2162 protected ModerationClient();
2163 protected internal ModerationClient(ClientPipeline pipeline, string model, OpenAIClientOptions options);
2164 public ModerationClient(string model, ApiKeyCredential credential, OpenAIClientOptions options);
2165 public ModerationClient(string model, ApiKeyCredential credential);
2166 public ModerationClient(string model, string apiKey);
2167 public ClientPipeline Pipeline { get; }
2168 [EditorBrowsable(EditorBrowsableState.Never)]
2169 public virtual ClientResult ClassifyText(BinaryContent content, RequestOptions options = null);
2170 public virtual ClientResult<ModerationResultCollection> ClassifyText(IEnumerable<string> inputs, CancellationToken cancellationToken = default);
2171 public virtual ClientResult<ModerationResult> ClassifyText(string input, CancellationToken cancellationToken = default);
2172 [EditorBrowsable(EditorBrowsableState.Never)]
2173 public virtual Task<ClientResult> ClassifyTextAsync(BinaryContent content, RequestOptions options = null);
2174 public virtual Task<ClientResult<ModerationResultCollection>> ClassifyTextAsync(IEnumerable<string> inputs, CancellationToken cancellationToken = default);
2175 public virtual Task<ClientResult<ModerationResult>> ClassifyTextAsync(string input, CancellationToken cancellationToken = default);
2176 }
2177 public class ModerationResult : IJsonModel<ModerationResult>, IPersistableModel<ModerationResult> {
2178 public bool Flagged { get; }
2179 public ModerationCategory Harassment { get; }
2180 public ModerationCategory HarassmentThreatening { get; }
2181 public ModerationCategory Hate { get; }
2182 public ModerationCategory HateThreatening { get; }
2183 public ModerationCategory SelfHarm { get; }
2184 public ModerationCategory SelfHarmInstructions { get; }
2185 public ModerationCategory SelfHarmIntent { get; }
2186 public ModerationCategory Sexual { get; }
2187 public ModerationCategory SexualMinors { get; }
2188 public ModerationCategory Violence { get; }
2189 public ModerationCategory ViolenceGraphic { get; }
2190 ModerationResult IJsonModel<ModerationResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2191 void IJsonModel<ModerationResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2192 ModerationResult IPersistableModel<ModerationResult>.Create(BinaryData data, ModelReaderWriterOptions options);
2193 string IPersistableModel<ModerationResult>.GetFormatFromOptions(ModelReaderWriterOptions options);
2194 BinaryData IPersistableModel<ModerationResult>.Write(ModelReaderWriterOptions options);
2195 }
2196 public class ModerationResultCollection : ObjectModel.ReadOnlyCollection<ModerationResult>, IJsonModel<ModerationResultCollection>, IPersistableModel<ModerationResultCollection> {
2197 public string Id { get; }
2198 public string Model { get; }
2199 ModerationResultCollection IJsonModel<ModerationResultCollection>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2200 void IJsonModel<ModerationResultCollection>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2201 ModerationResultCollection IPersistableModel<ModerationResultCollection>.Create(BinaryData data, ModelReaderWriterOptions options);
2202 string IPersistableModel<ModerationResultCollection>.GetFormatFromOptions(ModelReaderWriterOptions options);
2203 BinaryData IPersistableModel<ModerationResultCollection>.Write(ModelReaderWriterOptions options);
2204 }
2205 public static class OpenAIModerationsModelFactory {
2206 public static ModerationCategory ModerationCategory(bool flagged = false, float score = 0);
2207 public static ModerationResult ModerationResult(bool flagged = false, ModerationCategory hate = null, ModerationCategory hateThreatening = null, ModerationCategory harassment = null, ModerationCategory harassmentThreatening = null, ModerationCategory selfHarm = null, ModerationCategory selfHarmIntent = null, ModerationCategory selfHarmInstructions = null, ModerationCategory sexual = null, ModerationCategory sexualMinors = null, ModerationCategory violence = null, ModerationCategory violenceGraphic = null);
2208 public static ModerationResultCollection ModerationResultCollection(string id = null, string model = null, IEnumerable<ModerationResult> items = null);
2209 }
2210}
2211namespace OpenAI.VectorStores {
2212 public class AddFileToVectorStoreOperation : OperationResult {
2213 public string FileId { get; }
2214 public override ContinuationToken? RehydrationToken { get; protected set; }
2215 public VectorStoreFileAssociationStatus? Status { get; }
2216 public VectorStoreFileAssociation? Value { get; }
2217 public string VectorStoreId { get; }
2218 [EditorBrowsable(EditorBrowsableState.Never)]
2219 public virtual ClientResult GetFileAssociation(RequestOptions? options);
2220 public virtual ClientResult<VectorStoreFileAssociation> GetFileAssociation(CancellationToken cancellationToken = default);
2221 [EditorBrowsable(EditorBrowsableState.Never)]
2222 public virtual Task<ClientResult> GetFileAssociationAsync(RequestOptions? options);
2223 public virtual Task<ClientResult<VectorStoreFileAssociation>> GetFileAssociationAsync(CancellationToken cancellationToken = default);
2224 public static AddFileToVectorStoreOperation Rehydrate(VectorStoreClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default);
2225 public static Task<AddFileToVectorStoreOperation> RehydrateAsync(VectorStoreClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default);
2226 public override ClientResult UpdateStatus(RequestOptions? options = null);
2227 public override ValueTask<ClientResult> UpdateStatusAsync(RequestOptions? options = null);
2228 }
2229 public class CreateBatchFileJobOperation : OperationResult {
2230 public string BatchId { get; }
2231 public override ContinuationToken? RehydrationToken { get; protected set; }
2232 public VectorStoreBatchFileJobStatus? Status { get; }
2233 public VectorStoreBatchFileJob? Value { get; }
2234 public string VectorStoreId { get; }
2235 [EditorBrowsable(EditorBrowsableState.Never)]
2236 public virtual ClientResult Cancel(RequestOptions? options);
2237 public virtual ClientResult<VectorStoreBatchFileJob> Cancel(CancellationToken cancellationToken = default);
2238 [EditorBrowsable(EditorBrowsableState.Never)]
2239 public virtual Task<ClientResult> CancelAsync(RequestOptions? options);
2240 public virtual Task<ClientResult<VectorStoreBatchFileJob>> CancelAsync(CancellationToken cancellationToken = default);
2241 [EditorBrowsable(EditorBrowsableState.Never)]
2242 public virtual ClientResult GetFileBatch(RequestOptions? options);
2243 public virtual ClientResult<VectorStoreBatchFileJob> GetFileBatch(CancellationToken cancellationToken = default);
2244 [EditorBrowsable(EditorBrowsableState.Never)]
2245 public virtual Task<ClientResult> GetFileBatchAsync(RequestOptions? options);
2246 public virtual Task<ClientResult<VectorStoreBatchFileJob>> GetFileBatchAsync(CancellationToken cancellationToken = default);
2247 public static CreateBatchFileJobOperation Rehydrate(VectorStoreClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default);
2248 public static Task<CreateBatchFileJobOperation> RehydrateAsync(VectorStoreClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default);
2249 public override ClientResult UpdateStatus(RequestOptions? options = null);
2250 public override ValueTask<ClientResult> UpdateStatusAsync(RequestOptions? options = null);
2251 }
2252 public class CreateVectorStoreOperation : OperationResult {
2253 public override ContinuationToken? RehydrationToken { get; protected set; }
2254 public VectorStoreStatus? Status { get; }
2255 public VectorStore? Value { get; }
2256 public string VectorStoreId { get; }
2257 [EditorBrowsable(EditorBrowsableState.Never)]
2258 public virtual ClientResult GetVectorStore(RequestOptions? options);
2259 public virtual ClientResult<VectorStore> GetVectorStore(CancellationToken cancellationToken = default);
2260 [EditorBrowsable(EditorBrowsableState.Never)]
2261 public virtual Task<ClientResult> GetVectorStoreAsync(RequestOptions? options);
2262 public virtual Task<ClientResult<VectorStore>> GetVectorStoreAsync(CancellationToken cancellationToken = default);
2263 public static CreateVectorStoreOperation Rehydrate(VectorStoreClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default);
2264 public static Task<CreateVectorStoreOperation> RehydrateAsync(VectorStoreClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default);
2265 public override ClientResult UpdateStatus(RequestOptions? options = null);
2266 public override ValueTask<ClientResult> UpdateStatusAsync(RequestOptions? options = null);
2267 }
2268 public abstract class FileChunkingStrategy : IJsonModel<FileChunkingStrategy>, IPersistableModel<FileChunkingStrategy> {
2269 public static FileChunkingStrategy Auto { get; }
2270 public static FileChunkingStrategy Unknown { get; }
2271 public static FileChunkingStrategy CreateStaticStrategy(int maxTokensPerChunk, int overlappingTokenCount);
2272 FileChunkingStrategy IJsonModel<FileChunkingStrategy>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2273 void IJsonModel<FileChunkingStrategy>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2274 FileChunkingStrategy IPersistableModel<FileChunkingStrategy>.Create(BinaryData data, ModelReaderWriterOptions options);
2275 string IPersistableModel<FileChunkingStrategy>.GetFormatFromOptions(ModelReaderWriterOptions options);
2276 BinaryData IPersistableModel<FileChunkingStrategy>.Write(ModelReaderWriterOptions options);
2277 }
2278 public class FileFromStoreRemovalResult : IJsonModel<FileFromStoreRemovalResult>, IPersistableModel<FileFromStoreRemovalResult> {
2279 public string FileId { get; }
2280 public bool Removed { get; }
2281 FileFromStoreRemovalResult IJsonModel<FileFromStoreRemovalResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2282 void IJsonModel<FileFromStoreRemovalResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2283 FileFromStoreRemovalResult IPersistableModel<FileFromStoreRemovalResult>.Create(BinaryData data, ModelReaderWriterOptions options);
2284 string IPersistableModel<FileFromStoreRemovalResult>.GetFormatFromOptions(ModelReaderWriterOptions options);
2285 BinaryData IPersistableModel<FileFromStoreRemovalResult>.Write(ModelReaderWriterOptions options);
2286 }
2287 public class StaticFileChunkingStrategy : FileChunkingStrategy, IJsonModel<StaticFileChunkingStrategy>, IPersistableModel<StaticFileChunkingStrategy> {
2288 public StaticFileChunkingStrategy(int maxTokensPerChunk, int overlappingTokenCount);
2289 public int MaxTokensPerChunk { get; }
2290 public int OverlappingTokenCount { get; }
2291 StaticFileChunkingStrategy IJsonModel<StaticFileChunkingStrategy>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2292 void IJsonModel<StaticFileChunkingStrategy>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2293 StaticFileChunkingStrategy IPersistableModel<StaticFileChunkingStrategy>.Create(BinaryData data, ModelReaderWriterOptions options);
2294 string IPersistableModel<StaticFileChunkingStrategy>.GetFormatFromOptions(ModelReaderWriterOptions options);
2295 BinaryData IPersistableModel<StaticFileChunkingStrategy>.Write(ModelReaderWriterOptions options);
2296 }
2297 public class VectorStore : IJsonModel<VectorStore>, IPersistableModel<VectorStore> {
2298 public DateTimeOffset CreatedAt { get; }
2299 public VectorStoreExpirationPolicy ExpirationPolicy { get; }
2300 public DateTimeOffset? ExpiresAt { get; }
2301 public VectorStoreFileCounts FileCounts { get; }
2302 public string Id { get; }
2303 public DateTimeOffset? LastActiveAt { get; }
2304 public IReadOnlyDictionary<string, string> Metadata { get; }
2305 public string Name { get; }
2306 public VectorStoreStatus Status { get; }
2307 public int UsageBytes { get; }
2308 VectorStore IJsonModel<VectorStore>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2309 void IJsonModel<VectorStore>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2310 VectorStore IPersistableModel<VectorStore>.Create(BinaryData data, ModelReaderWriterOptions options);
2311 string IPersistableModel<VectorStore>.GetFormatFromOptions(ModelReaderWriterOptions options);
2312 BinaryData IPersistableModel<VectorStore>.Write(ModelReaderWriterOptions options);
2313 }
2314 public class VectorStoreBatchFileJob : IJsonModel<VectorStoreBatchFileJob>, IPersistableModel<VectorStoreBatchFileJob> {
2315 public string BatchId { get; }
2316 public DateTimeOffset CreatedAt { get; }
2317 public VectorStoreFileCounts FileCounts { get; }
2318 public VectorStoreBatchFileJobStatus Status { get; }
2319 public string VectorStoreId { get; }
2320 VectorStoreBatchFileJob IJsonModel<VectorStoreBatchFileJob>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2321 void IJsonModel<VectorStoreBatchFileJob>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2322 VectorStoreBatchFileJob IPersistableModel<VectorStoreBatchFileJob>.Create(BinaryData data, ModelReaderWriterOptions options);
2323 string IPersistableModel<VectorStoreBatchFileJob>.GetFormatFromOptions(ModelReaderWriterOptions options);
2324 BinaryData IPersistableModel<VectorStoreBatchFileJob>.Write(ModelReaderWriterOptions options);
2325 }
2326 public readonly partial struct VectorStoreBatchFileJobStatus : IEquatable<VectorStoreBatchFileJobStatus> {
2327 private readonly object _dummy;
2328 private readonly int _dummyPrimitive;
2329 public VectorStoreBatchFileJobStatus(string value);
2330 public static VectorStoreBatchFileJobStatus Cancelled { get; }
2331 public static VectorStoreBatchFileJobStatus Completed { get; }
2332 public static VectorStoreBatchFileJobStatus Failed { get; }
2333 public static VectorStoreBatchFileJobStatus InProgress { get; }
2334 public readonly bool Equals(VectorStoreBatchFileJobStatus other);
2335 [EditorBrowsable(EditorBrowsableState.Never)]
2336 public override readonly bool Equals(object obj);
2337 [EditorBrowsable(EditorBrowsableState.Never)]
2338 public override readonly int GetHashCode();
2339 public static bool operator ==(VectorStoreBatchFileJobStatus left, VectorStoreBatchFileJobStatus right);
2340 public static implicit operator VectorStoreBatchFileJobStatus(string value);
2341 public static bool operator !=(VectorStoreBatchFileJobStatus left, VectorStoreBatchFileJobStatus right);
2342 public override readonly string ToString();
2343 }
2344 public class VectorStoreClient {
2345 protected VectorStoreClient();
2346 public VectorStoreClient(ApiKeyCredential credential, OpenAIClientOptions options);
2347 public VectorStoreClient(ApiKeyCredential credential);
2348 protected internal VectorStoreClient(ClientPipeline pipeline, OpenAIClientOptions options);
2349 public VectorStoreClient(string apiKey);
2350 public ClientPipeline Pipeline { get; }
2351 [EditorBrowsable(EditorBrowsableState.Never)]
2352 public virtual AddFileToVectorStoreOperation AddFileToVectorStore(string vectorStoreId, BinaryContent content, bool waitUntilCompleted, RequestOptions options = null);
2353 public virtual AddFileToVectorStoreOperation AddFileToVectorStore(string vectorStoreId, string fileId, bool waitUntilCompleted, CancellationToken cancellationToken = default);
2354 [EditorBrowsable(EditorBrowsableState.Never)]
2355 public virtual Task<AddFileToVectorStoreOperation> AddFileToVectorStoreAsync(string vectorStoreId, BinaryContent content, bool waitUntilCompleted, RequestOptions options = null);
2356 public virtual Task<AddFileToVectorStoreOperation> AddFileToVectorStoreAsync(string vectorStoreId, string fileId, bool waitUntilCompleted, CancellationToken cancellationToken = default);
2357 [EditorBrowsable(EditorBrowsableState.Never)]
2358 public virtual ClientResult CancelBatchFileJob(string vectorStoreId, string batchId, RequestOptions options);
2359 public virtual ClientResult<VectorStoreBatchFileJob> CancelBatchFileJob(string vectorStoreId, string batchJobId, CancellationToken cancellationToken = default);
2360 [EditorBrowsable(EditorBrowsableState.Never)]
2361 public virtual Task<ClientResult> CancelBatchFileJobAsync(string vectorStoreId, string batchId, RequestOptions options);
2362 public virtual Task<ClientResult<VectorStoreBatchFileJob>> CancelBatchFileJobAsync(string vectorStoreId, string batchJobId, CancellationToken cancellationToken = default);
2363 [EditorBrowsable(EditorBrowsableState.Never)]
2364 public virtual CreateBatchFileJobOperation CreateBatchFileJob(string vectorStoreId, BinaryContent content, bool waitUntilCompleted, RequestOptions options = null);
2365 public virtual CreateBatchFileJobOperation CreateBatchFileJob(string vectorStoreId, IEnumerable<string> fileIds, bool waitUntilCompleted, CancellationToken cancellationToken = default);
2366 [EditorBrowsable(EditorBrowsableState.Never)]
2367 public virtual Task<CreateBatchFileJobOperation> CreateBatchFileJobAsync(string vectorStoreId, BinaryContent content, bool waitUntilCompleted, RequestOptions options = null);
2368 public virtual Task<CreateBatchFileJobOperation> CreateBatchFileJobAsync(string vectorStoreId, IEnumerable<string> fileIds, bool waitUntilCompleted, CancellationToken cancellationToken = default);
2369 public virtual CreateVectorStoreOperation CreateVectorStore(bool waitUntilCompleted, VectorStoreCreationOptions vectorStore = null, CancellationToken cancellationToken = default);
2370 [EditorBrowsable(EditorBrowsableState.Never)]
2371 public virtual CreateVectorStoreOperation CreateVectorStore(BinaryContent content, bool waitUntilCompleted, RequestOptions options = null);
2372 public virtual ClientResult CreateVectorStore(BinaryContent content, RequestOptions options = null);
2373 public virtual Task<CreateVectorStoreOperation> CreateVectorStoreAsync(bool waitUntilCompleted, VectorStoreCreationOptions vectorStore = null, CancellationToken cancellationToken = default);
2374 [EditorBrowsable(EditorBrowsableState.Never)]
2375 public virtual Task<CreateVectorStoreOperation> CreateVectorStoreAsync(BinaryContent content, bool waitUntilCompleted, RequestOptions options = null);
2376 public virtual Task<ClientResult> CreateVectorStoreAsync(BinaryContent content, RequestOptions options = null);
2377 [EditorBrowsable(EditorBrowsableState.Never)]
2378 public virtual ClientResult DeleteVectorStore(string vectorStoreId, RequestOptions options);
2379 public virtual ClientResult<VectorStoreDeletionResult> DeleteVectorStore(string vectorStoreId, CancellationToken cancellationToken = default);
2380 [EditorBrowsable(EditorBrowsableState.Never)]
2381 public virtual Task<ClientResult> DeleteVectorStoreAsync(string vectorStoreId, RequestOptions options);
2382 public virtual Task<ClientResult<VectorStoreDeletionResult>> DeleteVectorStoreAsync(string vectorStoreId, CancellationToken cancellationToken = default);
2383 public virtual ClientResult<VectorStoreBatchFileJob> GetBatchFileJob(string vectorStoreId, string batchJobId, CancellationToken cancellationToken = default);
2384 public virtual Task<ClientResult<VectorStoreBatchFileJob>> GetBatchFileJobAsync(string vectorStoreId, string batchJobId, CancellationToken cancellationToken = default);
2385 [EditorBrowsable(EditorBrowsableState.Never)]
2386 public virtual ClientResult GetFileAssociation(string vectorStoreId, string fileId, RequestOptions options);
2387 public virtual ClientResult<VectorStoreFileAssociation> GetFileAssociation(string vectorStoreId, string fileId, CancellationToken cancellationToken = default);
2388 [EditorBrowsable(EditorBrowsableState.Never)]
2389 public virtual Task<ClientResult> GetFileAssociationAsync(string vectorStoreId, string fileId, RequestOptions options);
2390 public virtual Task<ClientResult<VectorStoreFileAssociation>> GetFileAssociationAsync(string vectorStoreId, string fileId, CancellationToken cancellationToken = default);
2391 public virtual CollectionResult<VectorStoreFileAssociation> GetFileAssociations(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
2392 public virtual CollectionResult<VectorStoreFileAssociation> GetFileAssociations(string vectorStoreId, VectorStoreFileAssociationCollectionOptions options = null, CancellationToken cancellationToken = default);
2393 [EditorBrowsable(EditorBrowsableState.Never)]
2394 public virtual CollectionResult GetFileAssociations(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options);
2395 public virtual CollectionResult<VectorStoreFileAssociation> GetFileAssociations(string vectorStoreId, string batchJobId, VectorStoreFileAssociationCollectionOptions options = null, CancellationToken cancellationToken = default);
2396 public virtual CollectionResult<VectorStoreFileAssociation> GetFileAssociations(string vectorStoreId, string batchJobId, ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
2397 [EditorBrowsable(EditorBrowsableState.Never)]
2398 public virtual CollectionResult GetFileAssociations(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options);
2399 public virtual AsyncCollectionResult<VectorStoreFileAssociation> GetFileAssociationsAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
2400 public virtual AsyncCollectionResult<VectorStoreFileAssociation> GetFileAssociationsAsync(string vectorStoreId, VectorStoreFileAssociationCollectionOptions options = null, CancellationToken cancellationToken = default);
2401 [EditorBrowsable(EditorBrowsableState.Never)]
2402 public virtual AsyncCollectionResult GetFileAssociationsAsync(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options);
2403 public virtual AsyncCollectionResult<VectorStoreFileAssociation> GetFileAssociationsAsync(string vectorStoreId, string batchJobId, VectorStoreFileAssociationCollectionOptions options = null, CancellationToken cancellationToken = default);
2404 public virtual AsyncCollectionResult<VectorStoreFileAssociation> GetFileAssociationsAsync(string vectorStoreId, string batchJobId, ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
2405 [EditorBrowsable(EditorBrowsableState.Never)]
2406 public virtual AsyncCollectionResult GetFileAssociationsAsync(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options);
2407 public virtual ClientResult<VectorStore> GetVectorStore(string vectorStoreId, CancellationToken cancellationToken = default);
2408 public virtual CollectionResult<VectorStore> GetVectorStores(VectorStoreCollectionOptions options = null, CancellationToken cancellationToken = default);
2409 public virtual CollectionResult<VectorStore> GetVectorStores(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
2410 [EditorBrowsable(EditorBrowsableState.Never)]
2411 public virtual CollectionResult GetVectorStores(int? limit, string order, string after, string before, RequestOptions options);
2412 public virtual AsyncCollectionResult<VectorStore> GetVectorStoresAsync(VectorStoreCollectionOptions options = null, CancellationToken cancellationToken = default);
2413 public virtual AsyncCollectionResult<VectorStore> GetVectorStoresAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default);
2414 [EditorBrowsable(EditorBrowsableState.Never)]
2415 public virtual AsyncCollectionResult GetVectorStoresAsync(int? limit, string order, string after, string before, RequestOptions options);
2416 public virtual ClientResult<VectorStore> ModifyVectorStore(string vectorStoreId, VectorStoreModificationOptions vectorStore, CancellationToken cancellationToken = default);
2417 [EditorBrowsable(EditorBrowsableState.Never)]
2418 public virtual ClientResult ModifyVectorStore(string vectorStoreId, BinaryContent content, RequestOptions options = null);
2419 public virtual Task<ClientResult<VectorStore>> ModifyVectorStoreAsync(string vectorStoreId, VectorStoreModificationOptions vectorStore, CancellationToken cancellationToken = default);
2420 [EditorBrowsable(EditorBrowsableState.Never)]
2421 public virtual Task<ClientResult> ModifyVectorStoreAsync(string vectorStoreId, BinaryContent content, RequestOptions options = null);
2422 [EditorBrowsable(EditorBrowsableState.Never)]
2423 public virtual ClientResult RemoveFileFromStore(string vectorStoreId, string fileId, RequestOptions options);
2424 public virtual ClientResult<FileFromStoreRemovalResult> RemoveFileFromStore(string vectorStoreId, string fileId, CancellationToken cancellationToken = default);
2425 [EditorBrowsable(EditorBrowsableState.Never)]
2426 public virtual Task<ClientResult> RemoveFileFromStoreAsync(string vectorStoreId, string fileId, RequestOptions options);
2427 public virtual Task<ClientResult<FileFromStoreRemovalResult>> RemoveFileFromStoreAsync(string vectorStoreId, string fileId, CancellationToken cancellationToken = default);
2428 }
2429 public class VectorStoreCollectionOptions {
2430 public string AfterId { get; set; }
2431 public string BeforeId { get; set; }
2432 public VectorStoreCollectionOrder? Order { get; set; }
2433 public int? PageSizeLimit { get; set; }
2434 }
2435 public readonly partial struct VectorStoreCollectionOrder : IEquatable<VectorStoreCollectionOrder> {
2436 private readonly object _dummy;
2437 private readonly int _dummyPrimitive;
2438 public VectorStoreCollectionOrder(string value);
2439 public static VectorStoreCollectionOrder Ascending { get; }
2440 public static VectorStoreCollectionOrder Descending { get; }
2441 public readonly bool Equals(VectorStoreCollectionOrder other);
2442 [EditorBrowsable(EditorBrowsableState.Never)]
2443 public override readonly bool Equals(object obj);
2444 [EditorBrowsable(EditorBrowsableState.Never)]
2445 public override readonly int GetHashCode();
2446 public static bool operator ==(VectorStoreCollectionOrder left, VectorStoreCollectionOrder right);
2447 public static implicit operator VectorStoreCollectionOrder(string value);
2448 public static bool operator !=(VectorStoreCollectionOrder left, VectorStoreCollectionOrder right);
2449 public override readonly string ToString();
2450 }
2451 public class VectorStoreCreationOptions : IJsonModel<VectorStoreCreationOptions>, IPersistableModel<VectorStoreCreationOptions> {
2452 public FileChunkingStrategy ChunkingStrategy { get; set; }
2453 public VectorStoreExpirationPolicy ExpirationPolicy { get; set; }
2454 public IList<string> FileIds { get; }
2455 public IDictionary<string, string> Metadata { get; set; }
2456 public string Name { get; set; }
2457 VectorStoreCreationOptions IJsonModel<VectorStoreCreationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2458 void IJsonModel<VectorStoreCreationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2459 VectorStoreCreationOptions IPersistableModel<VectorStoreCreationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
2460 string IPersistableModel<VectorStoreCreationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
2461 BinaryData IPersistableModel<VectorStoreCreationOptions>.Write(ModelReaderWriterOptions options);
2462 }
2463 public class VectorStoreDeletionResult : IJsonModel<VectorStoreDeletionResult>, IPersistableModel<VectorStoreDeletionResult> {
2464 public bool Deleted { get; }
2465 public string VectorStoreId { get; }
2466 VectorStoreDeletionResult IJsonModel<VectorStoreDeletionResult>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2467 void IJsonModel<VectorStoreDeletionResult>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2468 VectorStoreDeletionResult IPersistableModel<VectorStoreDeletionResult>.Create(BinaryData data, ModelReaderWriterOptions options);
2469 string IPersistableModel<VectorStoreDeletionResult>.GetFormatFromOptions(ModelReaderWriterOptions options);
2470 BinaryData IPersistableModel<VectorStoreDeletionResult>.Write(ModelReaderWriterOptions options);
2471 }
2472 public enum VectorStoreExpirationAnchor {
2473 Unknown = 0,
2474 LastActiveAt = 1
2475 }
2476 public class VectorStoreExpirationPolicy : IJsonModel<VectorStoreExpirationPolicy>, IPersistableModel<VectorStoreExpirationPolicy> {
2477 public VectorStoreExpirationPolicy();
2478 public VectorStoreExpirationPolicy(VectorStoreExpirationAnchor anchor, int days);
2479 public required VectorStoreExpirationAnchor Anchor { get; set; }
2480 public required int Days { get; set; }
2481 VectorStoreExpirationPolicy IJsonModel<VectorStoreExpirationPolicy>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2482 void IJsonModel<VectorStoreExpirationPolicy>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2483 VectorStoreExpirationPolicy IPersistableModel<VectorStoreExpirationPolicy>.Create(BinaryData data, ModelReaderWriterOptions options);
2484 string IPersistableModel<VectorStoreExpirationPolicy>.GetFormatFromOptions(ModelReaderWriterOptions options);
2485 BinaryData IPersistableModel<VectorStoreExpirationPolicy>.Write(ModelReaderWriterOptions options);
2486 }
2487 public class VectorStoreFileAssociation : IJsonModel<VectorStoreFileAssociation>, IPersistableModel<VectorStoreFileAssociation> {
2488 public FileChunkingStrategy ChunkingStrategy { get; }
2489 public DateTimeOffset CreatedAt { get; }
2490 public string FileId { get; }
2491 public VectorStoreFileAssociationError LastError { get; }
2492 public int Size { get; }
2493 public VectorStoreFileAssociationStatus Status { get; }
2494 public string VectorStoreId { get; }
2495 VectorStoreFileAssociation IJsonModel<VectorStoreFileAssociation>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2496 void IJsonModel<VectorStoreFileAssociation>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2497 VectorStoreFileAssociation IPersistableModel<VectorStoreFileAssociation>.Create(BinaryData data, ModelReaderWriterOptions options);
2498 string IPersistableModel<VectorStoreFileAssociation>.GetFormatFromOptions(ModelReaderWriterOptions options);
2499 BinaryData IPersistableModel<VectorStoreFileAssociation>.Write(ModelReaderWriterOptions options);
2500 }
2501 public class VectorStoreFileAssociationCollectionOptions {
2502 public string AfterId { get; set; }
2503 public string BeforeId { get; set; }
2504 public VectorStoreFileStatusFilter? Filter { get; set; }
2505 public VectorStoreFileAssociationCollectionOrder? Order { get; set; }
2506 public int? PageSizeLimit { get; set; }
2507 }
2508 public readonly partial struct VectorStoreFileAssociationCollectionOrder : IEquatable<VectorStoreFileAssociationCollectionOrder> {
2509 private readonly object _dummy;
2510 private readonly int _dummyPrimitive;
2511 public VectorStoreFileAssociationCollectionOrder(string value);
2512 public static VectorStoreFileAssociationCollectionOrder Ascending { get; }
2513 public static VectorStoreFileAssociationCollectionOrder Descending { get; }
2514 public readonly bool Equals(VectorStoreFileAssociationCollectionOrder other);
2515 [EditorBrowsable(EditorBrowsableState.Never)]
2516 public override readonly bool Equals(object obj);
2517 [EditorBrowsable(EditorBrowsableState.Never)]
2518 public override readonly int GetHashCode();
2519 public static bool operator ==(VectorStoreFileAssociationCollectionOrder left, VectorStoreFileAssociationCollectionOrder right);
2520 public static implicit operator VectorStoreFileAssociationCollectionOrder(string value);
2521 public static bool operator !=(VectorStoreFileAssociationCollectionOrder left, VectorStoreFileAssociationCollectionOrder right);
2522 public override readonly string ToString();
2523 }
2524 public class VectorStoreFileAssociationError : IJsonModel<VectorStoreFileAssociationError>, IPersistableModel<VectorStoreFileAssociationError> {
2525 public VectorStoreFileAssociationErrorCode Code { get; }
2526 public string Message { get; }
2527 VectorStoreFileAssociationError IJsonModel<VectorStoreFileAssociationError>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2528 void IJsonModel<VectorStoreFileAssociationError>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2529 VectorStoreFileAssociationError IPersistableModel<VectorStoreFileAssociationError>.Create(BinaryData data, ModelReaderWriterOptions options);
2530 string IPersistableModel<VectorStoreFileAssociationError>.GetFormatFromOptions(ModelReaderWriterOptions options);
2531 BinaryData IPersistableModel<VectorStoreFileAssociationError>.Write(ModelReaderWriterOptions options);
2532 }
2533 public readonly partial struct VectorStoreFileAssociationErrorCode : IEquatable<VectorStoreFileAssociationErrorCode> {
2534 private readonly object _dummy;
2535 private readonly int _dummyPrimitive;
2536 public VectorStoreFileAssociationErrorCode(string value);
2537 public static VectorStoreFileAssociationErrorCode InvalidFile { get; }
2538 public static VectorStoreFileAssociationErrorCode ServerError { get; }
2539 public static VectorStoreFileAssociationErrorCode UnsupportedFile { get; }
2540 public readonly bool Equals(VectorStoreFileAssociationErrorCode other);
2541 [EditorBrowsable(EditorBrowsableState.Never)]
2542 public override readonly bool Equals(object obj);
2543 [EditorBrowsable(EditorBrowsableState.Never)]
2544 public override readonly int GetHashCode();
2545 public static bool operator ==(VectorStoreFileAssociationErrorCode left, VectorStoreFileAssociationErrorCode right);
2546 public static implicit operator VectorStoreFileAssociationErrorCode(string value);
2547 public static bool operator !=(VectorStoreFileAssociationErrorCode left, VectorStoreFileAssociationErrorCode right);
2548 public override readonly string ToString();
2549 }
2550 public enum VectorStoreFileAssociationStatus {
2551 Unknown = 0,
2552 InProgress = 1,
2553 Completed = 2,
2554 Cancelled = 3,
2555 Failed = 4
2556 }
2557 public class VectorStoreFileCounts : IJsonModel<VectorStoreFileCounts>, IPersistableModel<VectorStoreFileCounts> {
2558 public int Cancelled { get; }
2559 public int Completed { get; }
2560 public int Failed { get; }
2561 public int InProgress { get; }
2562 public int Total { get; }
2563 VectorStoreFileCounts IJsonModel<VectorStoreFileCounts>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2564 void IJsonModel<VectorStoreFileCounts>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2565 VectorStoreFileCounts IPersistableModel<VectorStoreFileCounts>.Create(BinaryData data, ModelReaderWriterOptions options);
2566 string IPersistableModel<VectorStoreFileCounts>.GetFormatFromOptions(ModelReaderWriterOptions options);
2567 BinaryData IPersistableModel<VectorStoreFileCounts>.Write(ModelReaderWriterOptions options);
2568 }
2569 public readonly partial struct VectorStoreFileStatusFilter : IEquatable<VectorStoreFileStatusFilter> {
2570 private readonly object _dummy;
2571 private readonly int _dummyPrimitive;
2572 public VectorStoreFileStatusFilter(string value);
2573 public static VectorStoreFileStatusFilter Cancelled { get; }
2574 public static VectorStoreFileStatusFilter Completed { get; }
2575 public static VectorStoreFileStatusFilter Failed { get; }
2576 public static VectorStoreFileStatusFilter InProgress { get; }
2577 public readonly bool Equals(VectorStoreFileStatusFilter other);
2578 [EditorBrowsable(EditorBrowsableState.Never)]
2579 public override readonly bool Equals(object obj);
2580 [EditorBrowsable(EditorBrowsableState.Never)]
2581 public override readonly int GetHashCode();
2582 public static bool operator ==(VectorStoreFileStatusFilter left, VectorStoreFileStatusFilter right);
2583 public static implicit operator VectorStoreFileStatusFilter(string value);
2584 public static bool operator !=(VectorStoreFileStatusFilter left, VectorStoreFileStatusFilter right);
2585 public override readonly string ToString();
2586 }
2587 public class VectorStoreModificationOptions : IJsonModel<VectorStoreModificationOptions>, IPersistableModel<VectorStoreModificationOptions> {
2588 public VectorStoreExpirationPolicy ExpirationPolicy { get; set; }
2589 public IDictionary<string, string> Metadata { get; set; }
2590 public string Name { get; set; }
2591 VectorStoreModificationOptions IJsonModel<VectorStoreModificationOptions>.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options);
2592 void IJsonModel<VectorStoreModificationOptions>.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options);
2593 VectorStoreModificationOptions IPersistableModel<VectorStoreModificationOptions>.Create(BinaryData data, ModelReaderWriterOptions options);
2594 string IPersistableModel<VectorStoreModificationOptions>.GetFormatFromOptions(ModelReaderWriterOptions options);
2595 BinaryData IPersistableModel<VectorStoreModificationOptions>.Write(ModelReaderWriterOptions options);
2596 }
2597 public enum VectorStoreStatus {
2598 Unknown = 0,
2599 InProgress = 1,
2600 Completed = 2,
2601 Expired = 3
2602 }
2603}