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