openai/openai-dotnet
Publicmirrored from https://github.com/openai/openai-dotnetAvailable
api/OpenAI.net8.0.cs
6055lines · 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); |
| 8 | public ClientPipeline Pipeline { get; } |
| 9 | [Experimental("OPENAI001")] |
| 10 | public virtual AssistantClient GetAssistantClient(); |
| 11 | public virtual AudioClient GetAudioClient(string model); |
| 12 | [Experimental("OPENAI001")] |
| 13 | public virtual BatchClient GetBatchClient(); |
| 14 | public virtual ChatClient GetChatClient(string model); |
| 15 | public virtual EmbeddingClient GetEmbeddingClient(string model); |
| 16 | [Experimental("OPENAI001")] |
| 17 | public virtual EvaluationClient GetEvaluationClient(); |
| 18 | [Experimental("OPENAI001")] |
| 19 | public virtual FineTuningClient GetFineTuningClient(); |
| 20 | public virtual ImageClient GetImageClient(string model); |
| 21 | public virtual ModerationClient GetModerationClient(string model); |
| 22 | public virtual OpenAIFileClient GetOpenAIFileClient(); |
| 23 | public virtual OpenAIModelClient GetOpenAIModelClient(); |
| 24 | [Experimental("OPENAI001")] |
| 25 | public virtual OpenAIResponseClient GetOpenAIResponseClient(string model); |
| 26 | [Experimental("OPENAI002")] |
| 27 | public virtual RealtimeClient GetRealtimeClient(); |
| 28 | [Experimental("OPENAI001")] |
| 29 | public virtual VectorStoreClient GetVectorStoreClient(); |
| 30 | } |
| 31 | public class OpenAIClientOptions : ClientPipelineOptions { |
| 32 | public Uri Endpoint { get; set; } |
| 33 | public string OrganizationId { get; set; } |
| 34 | public string ProjectId { get; set; } |
| 35 | public string UserAgentApplicationId { get; set; } |
| 36 | } |
| 37 | [Experimental("OPENAI001")] |
| 38 | public class OpenAIContext : ModelReaderWriterContext { |
| 39 | public static OpenAIContext Default { get; } |
| 40 | protected override bool TryGetTypeBuilderCore(Type type, out ModelReaderWriterTypeBuilder builder); |
| 41 | } |
| 42 | } |
| 43 | namespace OpenAI.Assistants { |
| 44 | [Experimental("OPENAI001")] |
| 45 | public class Assistant : IJsonModel<Assistant>, IPersistableModel<Assistant> { |
| 46 | public DateTimeOffset CreatedAt { get; } |
| 47 | public string Description { get; } |
| 48 | public string Id { get; } |
| 49 | public string Instructions { get; } |
| 50 | public IReadOnlyDictionary<string, string> Metadata { get; } |
| 51 | public string Model { get; } |
| 52 | public string Name { get; } |
| 53 | public float? NucleusSamplingFactor { get; } |
| 54 | public AssistantResponseFormat ResponseFormat { get; } |
| 55 | public float? Temperature { get; } |
| 56 | public ToolResources ToolResources { get; } |
| 57 | public IReadOnlyList<ToolDefinition> Tools { get; } |
| 58 | [Experimental("OPENAI001")] |
| 59 | protected virtual Assistant JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 60 | [Experimental("OPENAI001")] |
| 61 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 62 | [Experimental("OPENAI001")] |
| 63 | protected virtual Assistant PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 64 | [Experimental("OPENAI001")] |
| 65 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 66 | } |
| 67 | [Experimental("OPENAI001")] |
| 68 | public class AssistantClient { |
| 69 | protected AssistantClient(); |
| 70 | public AssistantClient(ApiKeyCredential credential, OpenAIClientOptions options); |
| 71 | public AssistantClient(ApiKeyCredential credential); |
| 72 | protected internal AssistantClient(ClientPipeline pipeline, OpenAIClientOptions options); |
| 73 | public AssistantClient(string apiKey); |
| 74 | public ClientPipeline Pipeline { get; } |
| 75 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 76 | public virtual ClientResult CancelRun(string threadId, string runId, RequestOptions options); |
| 77 | public virtual ClientResult<ThreadRun> CancelRun(string threadId, string runId, CancellationToken cancellationToken = default); |
| 78 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 79 | public virtual Task<ClientResult> CancelRunAsync(string threadId, string runId, RequestOptions options); |
| 80 | public virtual Task<ClientResult<ThreadRun>> CancelRunAsync(string threadId, string runId, CancellationToken cancellationToken = default); |
| 81 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 82 | public virtual ClientResult CreateAssistant(BinaryContent content, RequestOptions options = null); |
| 83 | public virtual ClientResult<Assistant> CreateAssistant(string model, AssistantCreationOptions options = null, CancellationToken cancellationToken = default); |
| 84 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 85 | public virtual Task<ClientResult> CreateAssistantAsync(BinaryContent content, RequestOptions options = null); |
| 86 | public virtual Task<ClientResult<Assistant>> CreateAssistantAsync(string model, AssistantCreationOptions options = null, CancellationToken cancellationToken = default); |
| 87 | public virtual ClientResult<ThreadMessage> CreateMessage(string threadId, MessageRole role, IEnumerable<MessageContent> content, MessageCreationOptions options = null, CancellationToken cancellationToken = default); |
| 88 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 89 | public virtual ClientResult CreateMessage(string threadId, BinaryContent content, RequestOptions options = null); |
| 90 | public virtual Task<ClientResult<ThreadMessage>> CreateMessageAsync(string threadId, MessageRole role, IEnumerable<MessageContent> content, MessageCreationOptions options = null, CancellationToken cancellationToken = default); |
| 91 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 92 | public virtual Task<ClientResult> CreateMessageAsync(string threadId, BinaryContent content, RequestOptions options = null); |
| 93 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 94 | public virtual ClientResult CreateRun(string threadId, BinaryContent content, RequestOptions options = null); |
| 95 | public virtual ClientResult<ThreadRun> CreateRun(string threadId, string assistantId, RunCreationOptions options = null, CancellationToken cancellationToken = default); |
| 96 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 97 | public virtual Task<ClientResult> CreateRunAsync(string threadId, BinaryContent content, RequestOptions options = null); |
| 98 | public virtual Task<ClientResult<ThreadRun>> CreateRunAsync(string threadId, string assistantId, RunCreationOptions options = null, CancellationToken cancellationToken = default); |
| 99 | public virtual CollectionResult<StreamingUpdate> CreateRunStreaming(string threadId, string assistantId, RunCreationOptions options = null, CancellationToken cancellationToken = default); |
| 100 | public virtual AsyncCollectionResult<StreamingUpdate> CreateRunStreamingAsync(string threadId, string assistantId, RunCreationOptions options = null, CancellationToken cancellationToken = default); |
| 101 | public virtual ClientResult<AssistantThread> CreateThread(ThreadCreationOptions options = null, CancellationToken cancellationToken = default); |
| 102 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 103 | public virtual ClientResult CreateThread(BinaryContent content, RequestOptions options = null); |
| 104 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 105 | public virtual ClientResult CreateThreadAndRun(BinaryContent content, RequestOptions options = null); |
| 106 | public virtual ClientResult<ThreadRun> CreateThreadAndRun(string assistantId, ThreadCreationOptions threadOptions = null, RunCreationOptions runOptions = null, CancellationToken cancellationToken = default); |
| 107 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 108 | public virtual Task<ClientResult> CreateThreadAndRunAsync(BinaryContent content, RequestOptions options = null); |
| 109 | public virtual Task<ClientResult<ThreadRun>> CreateThreadAndRunAsync(string assistantId, ThreadCreationOptions threadOptions = null, RunCreationOptions runOptions = null, CancellationToken cancellationToken = default); |
| 110 | public virtual CollectionResult<StreamingUpdate> CreateThreadAndRunStreaming(string assistantId, ThreadCreationOptions threadOptions = null, RunCreationOptions runOptions = null, CancellationToken cancellationToken = default); |
| 111 | public virtual AsyncCollectionResult<StreamingUpdate> CreateThreadAndRunStreamingAsync(string assistantId, ThreadCreationOptions threadOptions = null, RunCreationOptions runOptions = null, CancellationToken cancellationToken = default); |
| 112 | public virtual Task<ClientResult<AssistantThread>> CreateThreadAsync(ThreadCreationOptions options = null, CancellationToken cancellationToken = default); |
| 113 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 114 | public virtual Task<ClientResult> CreateThreadAsync(BinaryContent content, RequestOptions options = null); |
| 115 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 116 | public virtual ClientResult DeleteAssistant(string assistantId, RequestOptions options); |
| 117 | public virtual ClientResult<AssistantDeletionResult> DeleteAssistant(string assistantId, CancellationToken cancellationToken = default); |
| 118 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 119 | public virtual Task<ClientResult> DeleteAssistantAsync(string assistantId, RequestOptions options); |
| 120 | public virtual Task<ClientResult<AssistantDeletionResult>> DeleteAssistantAsync(string assistantId, CancellationToken cancellationToken = default); |
| 121 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 122 | public virtual ClientResult DeleteMessage(string threadId, string messageId, RequestOptions options); |
| 123 | public virtual ClientResult<MessageDeletionResult> DeleteMessage(string threadId, string messageId, CancellationToken cancellationToken = default); |
| 124 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 125 | public virtual Task<ClientResult> DeleteMessageAsync(string threadId, string messageId, RequestOptions options); |
| 126 | public virtual Task<ClientResult<MessageDeletionResult>> DeleteMessageAsync(string threadId, string messageId, CancellationToken cancellationToken = default); |
| 127 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 128 | public virtual ClientResult DeleteThread(string threadId, RequestOptions options); |
| 129 | public virtual ClientResult<ThreadDeletionResult> DeleteThread(string threadId, CancellationToken cancellationToken = default); |
| 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 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 148 | public virtual ClientResult GetMessage(string threadId, string messageId, RequestOptions options); |
| 149 | public virtual ClientResult<ThreadMessage> GetMessage(string threadId, string messageId, CancellationToken cancellationToken = default); |
| 150 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 151 | public virtual Task<ClientResult> GetMessageAsync(string threadId, string messageId, RequestOptions options); |
| 152 | public virtual Task<ClientResult<ThreadMessage>> GetMessageAsync(string threadId, string messageId, CancellationToken cancellationToken = default); |
| 153 | public virtual CollectionResult<ThreadMessage> GetMessages(ContinuationToken firstPageToken, CancellationToken cancellationToken = default); |
| 154 | public virtual CollectionResult<ThreadMessage> GetMessages(string threadId, MessageCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 155 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 156 | public virtual CollectionResult GetMessages(string threadId, int? limit, string order, string after, string before, RequestOptions options); |
| 157 | public virtual AsyncCollectionResult<ThreadMessage> GetMessagesAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default); |
| 158 | public virtual AsyncCollectionResult<ThreadMessage> GetMessagesAsync(string threadId, MessageCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 159 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 160 | public virtual AsyncCollectionResult GetMessagesAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options); |
| 161 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 162 | public virtual ClientResult GetRun(string threadId, string runId, RequestOptions options); |
| 163 | public virtual ClientResult<ThreadRun> GetRun(string threadId, string runId, CancellationToken cancellationToken = default); |
| 164 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 165 | public virtual Task<ClientResult> GetRunAsync(string threadId, string runId, RequestOptions options); |
| 166 | public virtual Task<ClientResult<ThreadRun>> GetRunAsync(string threadId, string runId, CancellationToken cancellationToken = default); |
| 167 | public virtual CollectionResult<ThreadRun> GetRuns(ContinuationToken firstPageToken, CancellationToken cancellationToken = default); |
| 168 | public virtual CollectionResult<ThreadRun> GetRuns(string threadId, RunCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 169 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 170 | public virtual CollectionResult GetRuns(string threadId, int? limit, string order, string after, string before, RequestOptions options); |
| 171 | public virtual AsyncCollectionResult<ThreadRun> GetRunsAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default); |
| 172 | public virtual AsyncCollectionResult<ThreadRun> GetRunsAsync(string threadId, RunCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 173 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 174 | public virtual AsyncCollectionResult GetRunsAsync(string threadId, int? limit, string order, string after, string before, RequestOptions options); |
| 175 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 176 | public virtual ClientResult GetRunStep(string threadId, string runId, string stepId, RequestOptions options); |
| 177 | public virtual ClientResult<RunStep> GetRunStep(string threadId, string runId, string stepId, CancellationToken cancellationToken = default); |
| 178 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 179 | public virtual Task<ClientResult> GetRunStepAsync(string threadId, string runId, string stepId, RequestOptions options); |
| 180 | public virtual Task<ClientResult<RunStep>> GetRunStepAsync(string threadId, string runId, string stepId, CancellationToken cancellationToken = default); |
| 181 | public virtual CollectionResult<RunStep> GetRunSteps(ContinuationToken firstPageToken, CancellationToken cancellationToken = default); |
| 182 | public virtual CollectionResult<RunStep> GetRunSteps(string threadId, string runId, RunStepCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 183 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 184 | public virtual CollectionResult GetRunSteps(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options); |
| 185 | public virtual AsyncCollectionResult<RunStep> GetRunStepsAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default); |
| 186 | public virtual AsyncCollectionResult<RunStep> GetRunStepsAsync(string threadId, string runId, RunStepCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 187 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 188 | public virtual AsyncCollectionResult GetRunStepsAsync(string threadId, string runId, int? limit, string order, string after, string before, RequestOptions options); |
| 189 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 190 | public virtual ClientResult GetThread(string threadId, RequestOptions options); |
| 191 | public virtual ClientResult<AssistantThread> GetThread(string threadId, CancellationToken cancellationToken = default); |
| 192 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 193 | public virtual Task<ClientResult> GetThreadAsync(string threadId, RequestOptions options); |
| 194 | public virtual Task<ClientResult<AssistantThread>> GetThreadAsync(string threadId, CancellationToken cancellationToken = default); |
| 195 | public virtual ClientResult<Assistant> ModifyAssistant(string assistantId, AssistantModificationOptions options, CancellationToken cancellationToken = default); |
| 196 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 197 | public virtual ClientResult ModifyAssistant(string assistantId, BinaryContent content, RequestOptions options = null); |
| 198 | public virtual Task<ClientResult<Assistant>> ModifyAssistantAsync(string assistantId, AssistantModificationOptions options, CancellationToken cancellationToken = default); |
| 199 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 200 | public virtual Task<ClientResult> ModifyAssistantAsync(string assistantId, BinaryContent content, RequestOptions options = null); |
| 201 | public virtual ClientResult<ThreadMessage> ModifyMessage(string threadId, string messageId, MessageModificationOptions options, CancellationToken cancellationToken = default); |
| 202 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 203 | public virtual ClientResult ModifyMessage(string threadId, string messageId, BinaryContent content, RequestOptions options = null); |
| 204 | public virtual Task<ClientResult<ThreadMessage>> ModifyMessageAsync(string threadId, string messageId, MessageModificationOptions options, CancellationToken cancellationToken = default); |
| 205 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 206 | public virtual Task<ClientResult> ModifyMessageAsync(string threadId, string messageId, BinaryContent content, RequestOptions options = null); |
| 207 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 208 | public virtual ClientResult ModifyRun(string threadId, string runId, BinaryContent content, RequestOptions options = null); |
| 209 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 210 | public virtual Task<ClientResult> ModifyRunAsync(string threadId, string runId, BinaryContent content, RequestOptions options = null); |
| 211 | public virtual ClientResult<AssistantThread> ModifyThread(string threadId, ThreadModificationOptions options, CancellationToken cancellationToken = default); |
| 212 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 213 | public virtual ClientResult ModifyThread(string threadId, BinaryContent content, RequestOptions options = null); |
| 214 | public virtual Task<ClientResult<AssistantThread>> ModifyThreadAsync(string threadId, ThreadModificationOptions options, CancellationToken cancellationToken = default); |
| 215 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 216 | public virtual Task<ClientResult> ModifyThreadAsync(string threadId, BinaryContent content, RequestOptions options = null); |
| 217 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 218 | public virtual ClientResult SubmitToolOutputsToRun(string threadId, string runId, BinaryContent content, RequestOptions options = null); |
| 219 | public virtual ClientResult<ThreadRun> SubmitToolOutputsToRun(string threadId, string runId, IEnumerable<ToolOutput> toolOutputs, CancellationToken cancellationToken = default); |
| 220 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 221 | public virtual Task<ClientResult> SubmitToolOutputsToRunAsync(string threadId, string runId, BinaryContent content, RequestOptions options = null); |
| 222 | public virtual Task<ClientResult<ThreadRun>> SubmitToolOutputsToRunAsync(string threadId, string runId, IEnumerable<ToolOutput> toolOutputs, CancellationToken cancellationToken = default); |
| 223 | public virtual CollectionResult<StreamingUpdate> SubmitToolOutputsToRunStreaming(string threadId, string runId, IEnumerable<ToolOutput> toolOutputs, CancellationToken cancellationToken = default); |
| 224 | public virtual AsyncCollectionResult<StreamingUpdate> SubmitToolOutputsToRunStreamingAsync(string threadId, string runId, IEnumerable<ToolOutput> toolOutputs, CancellationToken cancellationToken = default); |
| 225 | } |
| 226 | [Experimental("OPENAI001")] |
| 227 | public class AssistantCollectionOptions { |
| 228 | public string AfterId { get; set; } |
| 229 | public string BeforeId { get; set; } |
| 230 | public AssistantCollectionOrder? Order { get; set; } |
| 231 | public int? PageSizeLimit { get; set; } |
| 232 | } |
| 233 | [Experimental("OPENAI001")] |
| 234 | public readonly partial struct AssistantCollectionOrder : IEquatable<AssistantCollectionOrder> { |
| 235 | public AssistantCollectionOrder(string value); |
| 236 | public static AssistantCollectionOrder Ascending { get; } |
| 237 | public static AssistantCollectionOrder Descending { get; } |
| 238 | public readonly bool Equals(AssistantCollectionOrder other); |
| 239 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 240 | public override readonly bool Equals(object obj); |
| 241 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 242 | public override readonly int GetHashCode(); |
| 243 | public static bool operator ==(AssistantCollectionOrder left, AssistantCollectionOrder right); |
| 244 | public static implicit operator AssistantCollectionOrder(string value); |
| 245 | public static bool operator !=(AssistantCollectionOrder left, AssistantCollectionOrder right); |
| 246 | public override readonly string ToString(); |
| 247 | } |
| 248 | [Experimental("OPENAI001")] |
| 249 | public class AssistantCreationOptions : IJsonModel<AssistantCreationOptions>, IPersistableModel<AssistantCreationOptions> { |
| 250 | public string Description { get; set; } |
| 251 | public string Instructions { get; set; } |
| 252 | public IDictionary<string, string> Metadata { get; } |
| 253 | public string Name { get; set; } |
| 254 | public float? NucleusSamplingFactor { get; set; } |
| 255 | public AssistantResponseFormat ResponseFormat { get; set; } |
| 256 | public float? Temperature { get; set; } |
| 257 | public ToolResources ToolResources { get; set; } |
| 258 | public IList<ToolDefinition> Tools { get; } |
| 259 | [Experimental("OPENAI001")] |
| 260 | protected virtual AssistantCreationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 261 | [Experimental("OPENAI001")] |
| 262 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 263 | [Experimental("OPENAI001")] |
| 264 | protected virtual AssistantCreationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 265 | [Experimental("OPENAI001")] |
| 266 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 267 | } |
| 268 | [Experimental("OPENAI001")] |
| 269 | public class AssistantDeletionResult : IJsonModel<AssistantDeletionResult>, IPersistableModel<AssistantDeletionResult> { |
| 270 | public string AssistantId { get; } |
| 271 | public bool Deleted { get; } |
| 272 | [Experimental("OPENAI001")] |
| 273 | protected virtual AssistantDeletionResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 274 | [Experimental("OPENAI001")] |
| 275 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 276 | [Experimental("OPENAI001")] |
| 277 | protected virtual AssistantDeletionResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 278 | [Experimental("OPENAI001")] |
| 279 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 280 | } |
| 281 | [Experimental("OPENAI001")] |
| 282 | public class AssistantModificationOptions : IJsonModel<AssistantModificationOptions>, IPersistableModel<AssistantModificationOptions> { |
| 283 | public IList<ToolDefinition> DefaultTools { get; } |
| 284 | public string Description { get; set; } |
| 285 | public string Instructions { get; set; } |
| 286 | public IDictionary<string, string> Metadata { get; } |
| 287 | public string Model { get; set; } |
| 288 | public string Name { get; set; } |
| 289 | public float? NucleusSamplingFactor { get; set; } |
| 290 | public AssistantResponseFormat ResponseFormat { get; set; } |
| 291 | public float? Temperature { get; set; } |
| 292 | public ToolResources ToolResources { get; set; } |
| 293 | [Experimental("OPENAI001")] |
| 294 | protected virtual AssistantModificationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 295 | [Experimental("OPENAI001")] |
| 296 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 297 | [Experimental("OPENAI001")] |
| 298 | protected virtual AssistantModificationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 299 | [Experimental("OPENAI001")] |
| 300 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 301 | } |
| 302 | [Experimental("OPENAI001")] |
| 303 | public class AssistantResponseFormat : IEquatable<AssistantResponseFormat>, IEquatable<string>, IJsonModel<AssistantResponseFormat>, IPersistableModel<AssistantResponseFormat> { |
| 304 | public static AssistantResponseFormat Auto { get; } |
| 305 | public static AssistantResponseFormat JsonObject { get; } |
| 306 | public static AssistantResponseFormat Text { get; } |
| 307 | public static AssistantResponseFormat CreateAutoFormat(); |
| 308 | public static AssistantResponseFormat CreateJsonObjectFormat(); |
| 309 | public static AssistantResponseFormat CreateJsonSchemaFormat(string name, BinaryData jsonSchema, string description = null, bool? strictSchemaEnabled = null); |
| 310 | public static AssistantResponseFormat CreateTextFormat(); |
| 311 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 312 | public override bool Equals(object obj); |
| 313 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 314 | public override int GetHashCode(); |
| 315 | [Experimental("OPENAI001")] |
| 316 | protected virtual AssistantResponseFormat JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 317 | [Experimental("OPENAI001")] |
| 318 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 319 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 320 | public static bool operator ==(AssistantResponseFormat first, AssistantResponseFormat second); |
| 321 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 322 | public static implicit operator AssistantResponseFormat(string plainTextFormat); |
| 323 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 324 | public static bool operator !=(AssistantResponseFormat first, AssistantResponseFormat second); |
| 325 | [Experimental("OPENAI001")] |
| 326 | protected virtual AssistantResponseFormat PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 327 | [Experimental("OPENAI001")] |
| 328 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 329 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 330 | bool IEquatable<AssistantResponseFormat>.Equals(AssistantResponseFormat other); |
| 331 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 332 | bool IEquatable<string>.Equals(string other); |
| 333 | public override string ToString(); |
| 334 | } |
| 335 | [Experimental("OPENAI001")] |
| 336 | public class AssistantThread : IJsonModel<AssistantThread>, IPersistableModel<AssistantThread> { |
| 337 | public DateTimeOffset CreatedAt { get; } |
| 338 | public string Id { get; } |
| 339 | public IReadOnlyDictionary<string, string> Metadata { get; } |
| 340 | public ToolResources ToolResources { get; } |
| 341 | [Experimental("OPENAI001")] |
| 342 | protected virtual AssistantThread JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 343 | [Experimental("OPENAI001")] |
| 344 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 345 | [Experimental("OPENAI001")] |
| 346 | protected virtual AssistantThread PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 347 | [Experimental("OPENAI001")] |
| 348 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 349 | } |
| 350 | [Experimental("OPENAI001")] |
| 351 | public class CodeInterpreterToolDefinition : ToolDefinition, IJsonModel<CodeInterpreterToolDefinition>, IPersistableModel<CodeInterpreterToolDefinition> { |
| 352 | public CodeInterpreterToolDefinition(); |
| 353 | [Experimental("OPENAI001")] |
| 354 | protected override ToolDefinition JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 355 | [Experimental("OPENAI001")] |
| 356 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 357 | [Experimental("OPENAI001")] |
| 358 | protected override ToolDefinition PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 359 | [Experimental("OPENAI001")] |
| 360 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 361 | } |
| 362 | [Experimental("OPENAI001")] |
| 363 | public class CodeInterpreterToolResources : IJsonModel<CodeInterpreterToolResources>, IPersistableModel<CodeInterpreterToolResources> { |
| 364 | public IList<string> FileIds { get; } |
| 365 | [Experimental("OPENAI001")] |
| 366 | protected virtual CodeInterpreterToolResources JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 367 | [Experimental("OPENAI001")] |
| 368 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 369 | [Experimental("OPENAI001")] |
| 370 | protected virtual CodeInterpreterToolResources PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 371 | [Experimental("OPENAI001")] |
| 372 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 373 | } |
| 374 | [Experimental("OPENAI001")] |
| 375 | public readonly partial struct FileSearchRanker : IEquatable<FileSearchRanker> { |
| 376 | public FileSearchRanker(string value); |
| 377 | public static FileSearchRanker Auto { get; } |
| 378 | public static FileSearchRanker Default20240821 { get; } |
| 379 | public readonly bool Equals(FileSearchRanker other); |
| 380 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 381 | public override readonly bool Equals(object obj); |
| 382 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 383 | public override readonly int GetHashCode(); |
| 384 | public static bool operator ==(FileSearchRanker left, FileSearchRanker right); |
| 385 | public static implicit operator FileSearchRanker(string value); |
| 386 | public static bool operator !=(FileSearchRanker left, FileSearchRanker right); |
| 387 | public override readonly string ToString(); |
| 388 | } |
| 389 | [Experimental("OPENAI001")] |
| 390 | public class FileSearchRankingOptions : IJsonModel<FileSearchRankingOptions>, IPersistableModel<FileSearchRankingOptions> { |
| 391 | public FileSearchRankingOptions(float scoreThreshold); |
| 392 | public FileSearchRanker? Ranker { get; set; } |
| 393 | public float ScoreThreshold { get; set; } |
| 394 | [Experimental("OPENAI001")] |
| 395 | protected virtual FileSearchRankingOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 396 | [Experimental("OPENAI001")] |
| 397 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 398 | [Experimental("OPENAI001")] |
| 399 | protected virtual FileSearchRankingOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 400 | [Experimental("OPENAI001")] |
| 401 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 402 | } |
| 403 | [Experimental("OPENAI001")] |
| 404 | public class FileSearchToolDefinition : ToolDefinition, IJsonModel<FileSearchToolDefinition>, IPersistableModel<FileSearchToolDefinition> { |
| 405 | public FileSearchToolDefinition(); |
| 406 | public int? MaxResults { get; set; } |
| 407 | public FileSearchRankingOptions RankingOptions { get; set; } |
| 408 | [Experimental("OPENAI001")] |
| 409 | protected override ToolDefinition JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 410 | [Experimental("OPENAI001")] |
| 411 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 412 | [Experimental("OPENAI001")] |
| 413 | protected override ToolDefinition PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 414 | [Experimental("OPENAI001")] |
| 415 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 416 | } |
| 417 | [Experimental("OPENAI001")] |
| 418 | public class FileSearchToolResources : IJsonModel<FileSearchToolResources>, IPersistableModel<FileSearchToolResources> { |
| 419 | public IList<VectorStoreCreationHelper> NewVectorStores { get; } |
| 420 | public IList<string> VectorStoreIds { get; } |
| 421 | [Experimental("OPENAI001")] |
| 422 | protected virtual FileSearchToolResources JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 423 | [Experimental("OPENAI001")] |
| 424 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 425 | [Experimental("OPENAI001")] |
| 426 | protected virtual FileSearchToolResources PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 427 | [Experimental("OPENAI001")] |
| 428 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 429 | } |
| 430 | [Experimental("OPENAI001")] |
| 431 | public class FunctionToolDefinition : ToolDefinition, IJsonModel<FunctionToolDefinition>, IPersistableModel<FunctionToolDefinition> { |
| 432 | public FunctionToolDefinition(); |
| 433 | public FunctionToolDefinition(string name); |
| 434 | public string Description { get; set; } |
| 435 | public string FunctionName { get; set; } |
| 436 | public BinaryData Parameters { get; set; } |
| 437 | public bool? StrictParameterSchemaEnabled { get; set; } |
| 438 | [Experimental("OPENAI001")] |
| 439 | protected override ToolDefinition JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 440 | [Experimental("OPENAI001")] |
| 441 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 442 | [Experimental("OPENAI001")] |
| 443 | protected override ToolDefinition PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 444 | [Experimental("OPENAI001")] |
| 445 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 446 | } |
| 447 | [Experimental("OPENAI001")] |
| 448 | public class MessageCollectionOptions { |
| 449 | public string AfterId { get; set; } |
| 450 | public string BeforeId { get; set; } |
| 451 | public MessageCollectionOrder? Order { get; set; } |
| 452 | public int? PageSizeLimit { get; set; } |
| 453 | } |
| 454 | [Experimental("OPENAI001")] |
| 455 | public readonly partial struct MessageCollectionOrder : IEquatable<MessageCollectionOrder> { |
| 456 | public MessageCollectionOrder(string value); |
| 457 | public static MessageCollectionOrder Ascending { get; } |
| 458 | public static MessageCollectionOrder Descending { get; } |
| 459 | public readonly bool Equals(MessageCollectionOrder other); |
| 460 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 461 | public override readonly bool Equals(object obj); |
| 462 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 463 | public override readonly int GetHashCode(); |
| 464 | public static bool operator ==(MessageCollectionOrder left, MessageCollectionOrder right); |
| 465 | public static implicit operator MessageCollectionOrder(string value); |
| 466 | public static bool operator !=(MessageCollectionOrder left, MessageCollectionOrder right); |
| 467 | public override readonly string ToString(); |
| 468 | } |
| 469 | [Experimental("OPENAI001")] |
| 470 | public abstract class MessageContent : IJsonModel<MessageContent>, IPersistableModel<MessageContent> { |
| 471 | public MessageImageDetail? ImageDetail { get; } |
| 472 | public string ImageFileId { get; } |
| 473 | public Uri ImageUri { get; } |
| 474 | public string Refusal { get; } |
| 475 | public string Text { get; } |
| 476 | public IReadOnlyList<TextAnnotation> TextAnnotations { get; } |
| 477 | public static MessageContent FromImageFileId(string imageFileId, MessageImageDetail? detail = null); |
| 478 | public static MessageContent FromImageUri(Uri imageUri, MessageImageDetail? detail = null); |
| 479 | public static MessageContent FromText(string text); |
| 480 | [Experimental("OPENAI001")] |
| 481 | protected virtual MessageContent JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 482 | [Experimental("OPENAI001")] |
| 483 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 484 | public static implicit operator MessageContent(string value); |
| 485 | [Experimental("OPENAI001")] |
| 486 | protected virtual MessageContent PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 487 | [Experimental("OPENAI001")] |
| 488 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 489 | } |
| 490 | [Experimental("OPENAI001")] |
| 491 | public class MessageContentUpdate : StreamingUpdate { |
| 492 | public MessageImageDetail? ImageDetail { get; } |
| 493 | public string ImageFileId { get; } |
| 494 | public string MessageId { get; } |
| 495 | public int MessageIndex { get; } |
| 496 | public string RefusalUpdate { get; } |
| 497 | public MessageRole? Role { get; } |
| 498 | public string Text { get; } |
| 499 | public TextAnnotationUpdate TextAnnotation { get; } |
| 500 | } |
| 501 | [Experimental("OPENAI001")] |
| 502 | public class MessageCreationAttachment : IJsonModel<MessageCreationAttachment>, IPersistableModel<MessageCreationAttachment> { |
| 503 | public MessageCreationAttachment(string fileId, IEnumerable<ToolDefinition> tools); |
| 504 | public string FileId { get; } |
| 505 | public IReadOnlyList<ToolDefinition> Tools { get; } |
| 506 | [Experimental("OPENAI001")] |
| 507 | protected virtual MessageCreationAttachment JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 508 | [Experimental("OPENAI001")] |
| 509 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 510 | [Experimental("OPENAI001")] |
| 511 | protected virtual MessageCreationAttachment PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 512 | [Experimental("OPENAI001")] |
| 513 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 514 | } |
| 515 | [Experimental("OPENAI001")] |
| 516 | public class MessageCreationOptions : IJsonModel<MessageCreationOptions>, IPersistableModel<MessageCreationOptions> { |
| 517 | public IList<MessageCreationAttachment> Attachments { get; set; } |
| 518 | public IDictionary<string, string> Metadata { get; } |
| 519 | [Experimental("OPENAI001")] |
| 520 | protected virtual MessageCreationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 521 | [Experimental("OPENAI001")] |
| 522 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 523 | [Experimental("OPENAI001")] |
| 524 | protected virtual MessageCreationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 525 | [Experimental("OPENAI001")] |
| 526 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 527 | } |
| 528 | [Experimental("OPENAI001")] |
| 529 | public class MessageDeletionResult : IJsonModel<MessageDeletionResult>, IPersistableModel<MessageDeletionResult> { |
| 530 | public bool Deleted { get; } |
| 531 | public string MessageId { get; } |
| 532 | [Experimental("OPENAI001")] |
| 533 | protected virtual MessageDeletionResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 534 | [Experimental("OPENAI001")] |
| 535 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 536 | [Experimental("OPENAI001")] |
| 537 | protected virtual MessageDeletionResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 538 | [Experimental("OPENAI001")] |
| 539 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 540 | } |
| 541 | [Experimental("OPENAI001")] |
| 542 | public class MessageFailureDetails : IJsonModel<MessageFailureDetails>, IPersistableModel<MessageFailureDetails> { |
| 543 | public MessageFailureReason Reason { get; } |
| 544 | [Experimental("OPENAI001")] |
| 545 | protected virtual MessageFailureDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 546 | [Experimental("OPENAI001")] |
| 547 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 548 | [Experimental("OPENAI001")] |
| 549 | protected virtual MessageFailureDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 550 | [Experimental("OPENAI001")] |
| 551 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 552 | } |
| 553 | [Experimental("OPENAI001")] |
| 554 | public readonly partial struct MessageFailureReason : IEquatable<MessageFailureReason> { |
| 555 | public MessageFailureReason(string value); |
| 556 | public static MessageFailureReason ContentFilter { get; } |
| 557 | public static MessageFailureReason MaxTokens { get; } |
| 558 | public static MessageFailureReason RunCancelled { get; } |
| 559 | public static MessageFailureReason RunExpired { get; } |
| 560 | public static MessageFailureReason RunFailed { get; } |
| 561 | public readonly bool Equals(MessageFailureReason other); |
| 562 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 563 | public override readonly bool Equals(object obj); |
| 564 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 565 | public override readonly int GetHashCode(); |
| 566 | public static bool operator ==(MessageFailureReason left, MessageFailureReason right); |
| 567 | public static implicit operator MessageFailureReason(string value); |
| 568 | public static bool operator !=(MessageFailureReason left, MessageFailureReason right); |
| 569 | public override readonly string ToString(); |
| 570 | } |
| 571 | [Experimental("OPENAI001")] |
| 572 | public enum MessageImageDetail { |
| 573 | Auto = 0, |
| 574 | Low = 1, |
| 575 | High = 2 |
| 576 | } |
| 577 | [Experimental("OPENAI001")] |
| 578 | public class MessageModificationOptions : IJsonModel<MessageModificationOptions>, IPersistableModel<MessageModificationOptions> { |
| 579 | public IDictionary<string, string> Metadata { get; } |
| 580 | [Experimental("OPENAI001")] |
| 581 | protected virtual MessageModificationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 582 | [Experimental("OPENAI001")] |
| 583 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 584 | [Experimental("OPENAI001")] |
| 585 | protected virtual MessageModificationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 586 | [Experimental("OPENAI001")] |
| 587 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 588 | } |
| 589 | [Experimental("OPENAI001")] |
| 590 | public enum MessageRole { |
| 591 | User = 0, |
| 592 | Assistant = 1 |
| 593 | } |
| 594 | [Experimental("OPENAI001")] |
| 595 | public readonly partial struct MessageStatus : IEquatable<MessageStatus> { |
| 596 | public MessageStatus(string value); |
| 597 | public static MessageStatus Completed { get; } |
| 598 | public static MessageStatus Incomplete { get; } |
| 599 | public static MessageStatus InProgress { get; } |
| 600 | public readonly bool Equals(MessageStatus other); |
| 601 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 602 | public override readonly bool Equals(object obj); |
| 603 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 604 | public override readonly int GetHashCode(); |
| 605 | public static bool operator ==(MessageStatus left, MessageStatus right); |
| 606 | public static implicit operator MessageStatus(string value); |
| 607 | public static bool operator !=(MessageStatus left, MessageStatus right); |
| 608 | public override readonly string ToString(); |
| 609 | } |
| 610 | [Experimental("OPENAI001")] |
| 611 | public class MessageStatusUpdate : StreamingUpdate<ThreadMessage> { |
| 612 | } |
| 613 | [Experimental("OPENAI001")] |
| 614 | public abstract class RequiredAction { |
| 615 | public string FunctionArguments { get; } |
| 616 | public string FunctionName { get; } |
| 617 | public string ToolCallId { get; } |
| 618 | } |
| 619 | [Experimental("OPENAI001")] |
| 620 | public class RequiredActionUpdate : RunUpdate { |
| 621 | public string FunctionArguments { get; } |
| 622 | public string FunctionName { get; } |
| 623 | public string ToolCallId { get; } |
| 624 | public ThreadRun GetThreadRun(); |
| 625 | } |
| 626 | [Experimental("OPENAI001")] |
| 627 | public class RunCollectionOptions { |
| 628 | public string AfterId { get; set; } |
| 629 | public string BeforeId { get; set; } |
| 630 | public RunCollectionOrder? Order { get; set; } |
| 631 | public int? PageSizeLimit { get; set; } |
| 632 | } |
| 633 | [Experimental("OPENAI001")] |
| 634 | public readonly partial struct RunCollectionOrder : IEquatable<RunCollectionOrder> { |
| 635 | public RunCollectionOrder(string value); |
| 636 | public static RunCollectionOrder Ascending { get; } |
| 637 | public static RunCollectionOrder Descending { get; } |
| 638 | public readonly bool Equals(RunCollectionOrder other); |
| 639 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 640 | public override readonly bool Equals(object obj); |
| 641 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 642 | public override readonly int GetHashCode(); |
| 643 | public static bool operator ==(RunCollectionOrder left, RunCollectionOrder right); |
| 644 | public static implicit operator RunCollectionOrder(string value); |
| 645 | public static bool operator !=(RunCollectionOrder left, RunCollectionOrder right); |
| 646 | public override readonly string ToString(); |
| 647 | } |
| 648 | [Experimental("OPENAI001")] |
| 649 | public class RunCreationOptions : IJsonModel<RunCreationOptions>, IPersistableModel<RunCreationOptions> { |
| 650 | public string AdditionalInstructions { get; set; } |
| 651 | public IList<ThreadInitializationMessage> AdditionalMessages { get; } |
| 652 | public bool? AllowParallelToolCalls { get; set; } |
| 653 | public string InstructionsOverride { get; set; } |
| 654 | public int? MaxInputTokenCount { get; set; } |
| 655 | public int? MaxOutputTokenCount { get; set; } |
| 656 | public IDictionary<string, string> Metadata { get; } |
| 657 | public string ModelOverride { get; set; } |
| 658 | public float? NucleusSamplingFactor { get; set; } |
| 659 | public AssistantResponseFormat ResponseFormat { get; set; } |
| 660 | public float? Temperature { get; set; } |
| 661 | public ToolConstraint ToolConstraint { get; set; } |
| 662 | public IList<ToolDefinition> ToolsOverride { get; } |
| 663 | public RunTruncationStrategy TruncationStrategy { get; set; } |
| 664 | [Experimental("OPENAI001")] |
| 665 | protected virtual RunCreationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 666 | [Experimental("OPENAI001")] |
| 667 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 668 | [Experimental("OPENAI001")] |
| 669 | protected virtual RunCreationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 670 | [Experimental("OPENAI001")] |
| 671 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 672 | } |
| 673 | [Experimental("OPENAI001")] |
| 674 | public class RunError : IJsonModel<RunError>, IPersistableModel<RunError> { |
| 675 | public RunErrorCode Code { get; } |
| 676 | public string Message { get; } |
| 677 | [Experimental("OPENAI001")] |
| 678 | protected virtual RunError JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 679 | [Experimental("OPENAI001")] |
| 680 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 681 | [Experimental("OPENAI001")] |
| 682 | protected virtual RunError PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 683 | [Experimental("OPENAI001")] |
| 684 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 685 | } |
| 686 | [Experimental("OPENAI001")] |
| 687 | public readonly partial struct RunErrorCode : IEquatable<RunErrorCode> { |
| 688 | public RunErrorCode(string value); |
| 689 | public static RunErrorCode InvalidPrompt { get; } |
| 690 | public static RunErrorCode RateLimitExceeded { get; } |
| 691 | public static RunErrorCode ServerError { get; } |
| 692 | public readonly bool Equals(RunErrorCode other); |
| 693 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 694 | public override readonly bool Equals(object obj); |
| 695 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 696 | public override readonly int GetHashCode(); |
| 697 | public static bool operator ==(RunErrorCode left, RunErrorCode right); |
| 698 | public static implicit operator RunErrorCode(string value); |
| 699 | public static bool operator !=(RunErrorCode left, RunErrorCode right); |
| 700 | public override readonly string ToString(); |
| 701 | } |
| 702 | [Experimental("OPENAI001")] |
| 703 | public class RunIncompleteDetails : IJsonModel<RunIncompleteDetails>, IPersistableModel<RunIncompleteDetails> { |
| 704 | public RunIncompleteReason? Reason { get; } |
| 705 | [Experimental("OPENAI001")] |
| 706 | protected virtual RunIncompleteDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 707 | [Experimental("OPENAI001")] |
| 708 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 709 | [Experimental("OPENAI001")] |
| 710 | protected virtual RunIncompleteDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 711 | [Experimental("OPENAI001")] |
| 712 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 713 | } |
| 714 | [Experimental("OPENAI001")] |
| 715 | public readonly partial struct RunIncompleteReason : IEquatable<RunIncompleteReason> { |
| 716 | public RunIncompleteReason(string value); |
| 717 | public static RunIncompleteReason MaxInputTokenCount { get; } |
| 718 | public static RunIncompleteReason MaxOutputTokenCount { get; } |
| 719 | public readonly bool Equals(RunIncompleteReason other); |
| 720 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 721 | public override readonly bool Equals(object obj); |
| 722 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 723 | public override readonly int GetHashCode(); |
| 724 | public static bool operator ==(RunIncompleteReason left, RunIncompleteReason right); |
| 725 | public static implicit operator RunIncompleteReason(string value); |
| 726 | public static bool operator !=(RunIncompleteReason left, RunIncompleteReason right); |
| 727 | public override readonly string ToString(); |
| 728 | } |
| 729 | [Experimental("OPENAI001")] |
| 730 | public class RunModificationOptions : IJsonModel<RunModificationOptions>, IPersistableModel<RunModificationOptions> { |
| 731 | public IDictionary<string, string> Metadata { get; } |
| 732 | [Experimental("OPENAI001")] |
| 733 | protected virtual RunModificationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 734 | [Experimental("OPENAI001")] |
| 735 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 736 | [Experimental("OPENAI001")] |
| 737 | protected virtual RunModificationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 738 | [Experimental("OPENAI001")] |
| 739 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 740 | } |
| 741 | [Experimental("OPENAI001")] |
| 742 | public readonly partial struct RunStatus : IEquatable<RunStatus> { |
| 743 | public RunStatus(string value); |
| 744 | public static RunStatus Cancelled { get; } |
| 745 | public static RunStatus Cancelling { get; } |
| 746 | public static RunStatus Completed { get; } |
| 747 | public static RunStatus Expired { get; } |
| 748 | public static RunStatus Failed { get; } |
| 749 | public static RunStatus Incomplete { get; } |
| 750 | public static RunStatus InProgress { get; } |
| 751 | public bool IsTerminal { get; } |
| 752 | public static RunStatus Queued { get; } |
| 753 | public static RunStatus RequiresAction { get; } |
| 754 | public readonly bool Equals(RunStatus other); |
| 755 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 756 | public override readonly bool Equals(object obj); |
| 757 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 758 | public override readonly int GetHashCode(); |
| 759 | public static bool operator ==(RunStatus left, RunStatus right); |
| 760 | public static implicit operator RunStatus(string value); |
| 761 | public static bool operator !=(RunStatus left, RunStatus right); |
| 762 | public override readonly string ToString(); |
| 763 | } |
| 764 | [Experimental("OPENAI001")] |
| 765 | public class RunStep : IJsonModel<RunStep>, IPersistableModel<RunStep> { |
| 766 | public string AssistantId { get; } |
| 767 | public DateTimeOffset? CancelledAt { get; } |
| 768 | public DateTimeOffset? CompletedAt { get; } |
| 769 | public DateTimeOffset CreatedAt { get; } |
| 770 | public RunStepDetails Details { get; } |
| 771 | public DateTimeOffset? ExpiredAt { get; } |
| 772 | public DateTimeOffset? FailedAt { get; } |
| 773 | public string Id { get; } |
| 774 | public RunStepKind Kind { get; } |
| 775 | public RunStepError LastError { get; } |
| 776 | public IReadOnlyDictionary<string, string> Metadata { get; } |
| 777 | public string RunId { get; } |
| 778 | public RunStepStatus Status { get; } |
| 779 | public string ThreadId { get; } |
| 780 | public RunStepTokenUsage Usage { get; } |
| 781 | [Experimental("OPENAI001")] |
| 782 | protected virtual RunStep JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 783 | [Experimental("OPENAI001")] |
| 784 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 785 | [Experimental("OPENAI001")] |
| 786 | protected virtual RunStep PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 787 | [Experimental("OPENAI001")] |
| 788 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 789 | } |
| 790 | [Experimental("OPENAI001")] |
| 791 | public abstract class RunStepCodeInterpreterOutput : IJsonModel<RunStepCodeInterpreterOutput>, IPersistableModel<RunStepCodeInterpreterOutput> { |
| 792 | public string ImageFileId { get; } |
| 793 | public string Logs { get; } |
| 794 | [Experimental("OPENAI001")] |
| 795 | protected virtual RunStepCodeInterpreterOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 796 | [Experimental("OPENAI001")] |
| 797 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 798 | [Experimental("OPENAI001")] |
| 799 | protected virtual RunStepCodeInterpreterOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 800 | [Experimental("OPENAI001")] |
| 801 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 802 | } |
| 803 | [Experimental("OPENAI001")] |
| 804 | public class RunStepCollectionOptions { |
| 805 | public string AfterId { get; set; } |
| 806 | public string BeforeId { get; set; } |
| 807 | public RunStepCollectionOrder? Order { get; set; } |
| 808 | public int? PageSizeLimit { get; set; } |
| 809 | } |
| 810 | [Experimental("OPENAI001")] |
| 811 | public readonly partial struct RunStepCollectionOrder : IEquatable<RunStepCollectionOrder> { |
| 812 | public RunStepCollectionOrder(string value); |
| 813 | public static RunStepCollectionOrder Ascending { get; } |
| 814 | public static RunStepCollectionOrder Descending { get; } |
| 815 | public readonly bool Equals(RunStepCollectionOrder other); |
| 816 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 817 | public override readonly bool Equals(object obj); |
| 818 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 819 | public override readonly int GetHashCode(); |
| 820 | public static bool operator ==(RunStepCollectionOrder left, RunStepCollectionOrder right); |
| 821 | public static implicit operator RunStepCollectionOrder(string value); |
| 822 | public static bool operator !=(RunStepCollectionOrder left, RunStepCollectionOrder right); |
| 823 | public override readonly string ToString(); |
| 824 | } |
| 825 | [Experimental("OPENAI001")] |
| 826 | public abstract class RunStepDetails : IJsonModel<RunStepDetails>, IPersistableModel<RunStepDetails> { |
| 827 | public string CreatedMessageId { get; } |
| 828 | public IReadOnlyList<RunStepToolCall> ToolCalls { get; } |
| 829 | [Experimental("OPENAI001")] |
| 830 | protected virtual RunStepDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 831 | [Experimental("OPENAI001")] |
| 832 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 833 | [Experimental("OPENAI001")] |
| 834 | protected virtual RunStepDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 835 | [Experimental("OPENAI001")] |
| 836 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 837 | } |
| 838 | [Experimental("OPENAI001")] |
| 839 | public class RunStepDetailsUpdate : StreamingUpdate { |
| 840 | public string CodeInterpreterInput { get; } |
| 841 | public IReadOnlyList<RunStepUpdateCodeInterpreterOutput> CodeInterpreterOutputs { get; } |
| 842 | public string CreatedMessageId { get; } |
| 843 | public FileSearchRankingOptions FileSearchRankingOptions { get; } |
| 844 | public IReadOnlyList<RunStepFileSearchResult> FileSearchResults { get; } |
| 845 | public string FunctionArguments { get; } |
| 846 | public string FunctionName { get; } |
| 847 | public string FunctionOutput { get; } |
| 848 | public string StepId { get; } |
| 849 | public string ToolCallId { get; } |
| 850 | public int? ToolCallIndex { get; } |
| 851 | } |
| 852 | [Experimental("OPENAI001")] |
| 853 | public class RunStepError : IJsonModel<RunStepError>, IPersistableModel<RunStepError> { |
| 854 | public RunStepErrorCode Code { get; } |
| 855 | public string Message { get; } |
| 856 | [Experimental("OPENAI001")] |
| 857 | protected virtual RunStepError JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 858 | [Experimental("OPENAI001")] |
| 859 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 860 | [Experimental("OPENAI001")] |
| 861 | protected virtual RunStepError PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 862 | [Experimental("OPENAI001")] |
| 863 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 864 | } |
| 865 | [Experimental("OPENAI001")] |
| 866 | public readonly partial struct RunStepErrorCode : IEquatable<RunStepErrorCode> { |
| 867 | public RunStepErrorCode(string value); |
| 868 | public static RunStepErrorCode RateLimitExceeded { get; } |
| 869 | public static RunStepErrorCode ServerError { get; } |
| 870 | public readonly bool Equals(RunStepErrorCode other); |
| 871 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 872 | public override readonly bool Equals(object obj); |
| 873 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 874 | public override readonly int GetHashCode(); |
| 875 | public static bool operator ==(RunStepErrorCode left, RunStepErrorCode right); |
| 876 | public static implicit operator RunStepErrorCode(string value); |
| 877 | public static bool operator !=(RunStepErrorCode left, RunStepErrorCode right); |
| 878 | public override readonly string ToString(); |
| 879 | } |
| 880 | [Experimental("OPENAI001")] |
| 881 | public class RunStepFileSearchResult : IJsonModel<RunStepFileSearchResult>, IPersistableModel<RunStepFileSearchResult> { |
| 882 | public IReadOnlyList<RunStepFileSearchResultContent> Content { get; } |
| 883 | public string FileId { get; } |
| 884 | public string FileName { get; } |
| 885 | public float Score { get; } |
| 886 | [Experimental("OPENAI001")] |
| 887 | protected virtual RunStepFileSearchResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 888 | [Experimental("OPENAI001")] |
| 889 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 890 | [Experimental("OPENAI001")] |
| 891 | protected virtual RunStepFileSearchResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 892 | [Experimental("OPENAI001")] |
| 893 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 894 | } |
| 895 | [Experimental("OPENAI001")] |
| 896 | public class RunStepFileSearchResultContent : IJsonModel<RunStepFileSearchResultContent>, IPersistableModel<RunStepFileSearchResultContent> { |
| 897 | public RunStepFileSearchResultContentKind Kind { get; } |
| 898 | public string Text { get; } |
| 899 | [Experimental("OPENAI001")] |
| 900 | protected virtual RunStepFileSearchResultContent JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 901 | [Experimental("OPENAI001")] |
| 902 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 903 | [Experimental("OPENAI001")] |
| 904 | protected virtual RunStepFileSearchResultContent PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 905 | [Experimental("OPENAI001")] |
| 906 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 907 | } |
| 908 | [Experimental("OPENAI001")] |
| 909 | public enum RunStepFileSearchResultContentKind { |
| 910 | Text = 0 |
| 911 | } |
| 912 | [Experimental("OPENAI001")] |
| 913 | public enum RunStepKind { |
| 914 | CreatedMessage = 0, |
| 915 | ToolCall = 1 |
| 916 | } |
| 917 | [Experimental("OPENAI001")] |
| 918 | public readonly partial struct RunStepStatus : IEquatable<RunStepStatus> { |
| 919 | public RunStepStatus(string value); |
| 920 | public static RunStepStatus Cancelled { get; } |
| 921 | public static RunStepStatus Completed { get; } |
| 922 | public static RunStepStatus Expired { get; } |
| 923 | public static RunStepStatus Failed { get; } |
| 924 | public static RunStepStatus InProgress { get; } |
| 925 | public readonly bool Equals(RunStepStatus other); |
| 926 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 927 | public override readonly bool Equals(object obj); |
| 928 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 929 | public override readonly int GetHashCode(); |
| 930 | public static bool operator ==(RunStepStatus left, RunStepStatus right); |
| 931 | public static implicit operator RunStepStatus(string value); |
| 932 | public static bool operator !=(RunStepStatus left, RunStepStatus right); |
| 933 | public override readonly string ToString(); |
| 934 | } |
| 935 | [Experimental("OPENAI001")] |
| 936 | public class RunStepTokenUsage : IJsonModel<RunStepTokenUsage>, IPersistableModel<RunStepTokenUsage> { |
| 937 | public int InputTokenCount { get; } |
| 938 | public int OutputTokenCount { get; } |
| 939 | public int TotalTokenCount { get; } |
| 940 | [Experimental("OPENAI001")] |
| 941 | protected virtual RunStepTokenUsage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 942 | [Experimental("OPENAI001")] |
| 943 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 944 | [Experimental("OPENAI001")] |
| 945 | protected virtual RunStepTokenUsage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 946 | [Experimental("OPENAI001")] |
| 947 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 948 | } |
| 949 | [Experimental("OPENAI001")] |
| 950 | public class RunStepToolCall : IJsonModel<RunStepToolCall>, IPersistableModel<RunStepToolCall> { |
| 951 | public string CodeInterpreterInput { get; } |
| 952 | public IReadOnlyList<RunStepCodeInterpreterOutput> CodeInterpreterOutputs { get; } |
| 953 | public FileSearchRankingOptions FileSearchRankingOptions { get; } |
| 954 | public IReadOnlyList<RunStepFileSearchResult> FileSearchResults { get; } |
| 955 | public string FunctionArguments { get; } |
| 956 | public string FunctionName { get; } |
| 957 | public string FunctionOutput { get; } |
| 958 | public string Id { get; } |
| 959 | public RunStepToolCallKind Kind { get; } |
| 960 | [Experimental("OPENAI001")] |
| 961 | protected virtual RunStepToolCall JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 962 | [Experimental("OPENAI001")] |
| 963 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 964 | [Experimental("OPENAI001")] |
| 965 | protected virtual RunStepToolCall PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 966 | [Experimental("OPENAI001")] |
| 967 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 968 | } |
| 969 | [Experimental("OPENAI001")] |
| 970 | public enum RunStepToolCallKind { |
| 971 | CodeInterpreter = 0, |
| 972 | FileSearch = 1, |
| 973 | Function = 2 |
| 974 | } |
| 975 | [Experimental("OPENAI001")] |
| 976 | public class RunStepUpdate : StreamingUpdate<RunStep> { |
| 977 | } |
| 978 | [Experimental("OPENAI001")] |
| 979 | public class RunStepUpdateCodeInterpreterOutput : IJsonModel<RunStepUpdateCodeInterpreterOutput>, IPersistableModel<RunStepUpdateCodeInterpreterOutput> { |
| 980 | public string ImageFileId { get; } |
| 981 | public string Logs { get; } |
| 982 | public int OutputIndex { get; } |
| 983 | [Experimental("OPENAI001")] |
| 984 | protected virtual RunStepUpdateCodeInterpreterOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 985 | [Experimental("OPENAI001")] |
| 986 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 987 | [Experimental("OPENAI001")] |
| 988 | protected virtual RunStepUpdateCodeInterpreterOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 989 | [Experimental("OPENAI001")] |
| 990 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 991 | } |
| 992 | [Experimental("OPENAI001")] |
| 993 | public class RunTokenUsage : IJsonModel<RunTokenUsage>, IPersistableModel<RunTokenUsage> { |
| 994 | public int InputTokenCount { get; } |
| 995 | public int OutputTokenCount { get; } |
| 996 | public int TotalTokenCount { get; } |
| 997 | [Experimental("OPENAI001")] |
| 998 | protected virtual RunTokenUsage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 999 | [Experimental("OPENAI001")] |
| 1000 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1001 | [Experimental("OPENAI001")] |
| 1002 | protected virtual RunTokenUsage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1003 | [Experimental("OPENAI001")] |
| 1004 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1005 | } |
| 1006 | [Experimental("OPENAI001")] |
| 1007 | public class RunTruncationStrategy : IJsonModel<RunTruncationStrategy>, IPersistableModel<RunTruncationStrategy> { |
| 1008 | public static RunTruncationStrategy Auto { get; } |
| 1009 | public int? LastMessages { get; } |
| 1010 | public static RunTruncationStrategy CreateLastMessagesStrategy(int lastMessageCount); |
| 1011 | [Experimental("OPENAI001")] |
| 1012 | protected virtual RunTruncationStrategy JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1013 | [Experimental("OPENAI001")] |
| 1014 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1015 | [Experimental("OPENAI001")] |
| 1016 | protected virtual RunTruncationStrategy PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1017 | [Experimental("OPENAI001")] |
| 1018 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1019 | } |
| 1020 | [Experimental("OPENAI001")] |
| 1021 | public class RunUpdate : StreamingUpdate<ThreadRun> { |
| 1022 | } |
| 1023 | [Experimental("OPENAI001")] |
| 1024 | public abstract class StreamingUpdate { |
| 1025 | public StreamingUpdateReason UpdateKind { get; } |
| 1026 | } |
| 1027 | [Experimental("OPENAI001")] |
| 1028 | public enum StreamingUpdateReason { |
| 1029 | Unknown = 0, |
| 1030 | ThreadCreated = 1, |
| 1031 | RunCreated = 2, |
| 1032 | RunQueued = 3, |
| 1033 | RunInProgress = 4, |
| 1034 | RunRequiresAction = 5, |
| 1035 | RunCompleted = 6, |
| 1036 | RunIncomplete = 7, |
| 1037 | RunFailed = 8, |
| 1038 | RunCancelling = 9, |
| 1039 | RunCancelled = 10, |
| 1040 | RunExpired = 11, |
| 1041 | RunStepCreated = 12, |
| 1042 | RunStepInProgress = 13, |
| 1043 | RunStepUpdated = 14, |
| 1044 | RunStepCompleted = 15, |
| 1045 | RunStepFailed = 16, |
| 1046 | RunStepCancelled = 17, |
| 1047 | RunStepExpired = 18, |
| 1048 | MessageCreated = 19, |
| 1049 | MessageInProgress = 20, |
| 1050 | MessageUpdated = 21, |
| 1051 | MessageCompleted = 22, |
| 1052 | MessageFailed = 23, |
| 1053 | Error = 24, |
| 1054 | Done = 25 |
| 1055 | } |
| 1056 | [Experimental("OPENAI001")] |
| 1057 | public class StreamingUpdate<T> : StreamingUpdate where T : class { |
| 1058 | public T Value { get; } |
| 1059 | public static implicit operator T(StreamingUpdate<T> update); |
| 1060 | } |
| 1061 | [Experimental("OPENAI001")] |
| 1062 | public class TextAnnotation { |
| 1063 | public int EndIndex { get; } |
| 1064 | public string InputFileId { get; } |
| 1065 | public string OutputFileId { get; } |
| 1066 | public int StartIndex { get; } |
| 1067 | public string TextToReplace { get; } |
| 1068 | } |
| 1069 | [Experimental("OPENAI001")] |
| 1070 | public class TextAnnotationUpdate { |
| 1071 | public int ContentIndex { get; } |
| 1072 | public int? EndIndex { get; } |
| 1073 | public string InputFileId { get; } |
| 1074 | public string OutputFileId { get; } |
| 1075 | public int? StartIndex { get; } |
| 1076 | public string TextToReplace { get; } |
| 1077 | } |
| 1078 | [Experimental("OPENAI001")] |
| 1079 | public class ThreadCreationOptions : IJsonModel<ThreadCreationOptions>, IPersistableModel<ThreadCreationOptions> { |
| 1080 | public IList<ThreadInitializationMessage> InitialMessages { get; } |
| 1081 | public IDictionary<string, string> Metadata { get; } |
| 1082 | public ToolResources ToolResources { get; set; } |
| 1083 | [Experimental("OPENAI001")] |
| 1084 | protected virtual ThreadCreationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1085 | [Experimental("OPENAI001")] |
| 1086 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1087 | [Experimental("OPENAI001")] |
| 1088 | protected virtual ThreadCreationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1089 | [Experimental("OPENAI001")] |
| 1090 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1091 | } |
| 1092 | [Experimental("OPENAI001")] |
| 1093 | public class ThreadDeletionResult : IJsonModel<ThreadDeletionResult>, IPersistableModel<ThreadDeletionResult> { |
| 1094 | public bool Deleted { get; } |
| 1095 | public string ThreadId { get; } |
| 1096 | [Experimental("OPENAI001")] |
| 1097 | protected virtual ThreadDeletionResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1098 | [Experimental("OPENAI001")] |
| 1099 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1100 | [Experimental("OPENAI001")] |
| 1101 | protected virtual ThreadDeletionResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1102 | [Experimental("OPENAI001")] |
| 1103 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1104 | } |
| 1105 | [Experimental("OPENAI001")] |
| 1106 | public class ThreadInitializationMessage : MessageCreationOptions { |
| 1107 | public ThreadInitializationMessage(MessageRole role, IEnumerable<MessageContent> content); |
| 1108 | public static implicit operator ThreadInitializationMessage(string initializationMessage); |
| 1109 | } |
| 1110 | [Experimental("OPENAI001")] |
| 1111 | public class ThreadMessage : IJsonModel<ThreadMessage>, IPersistableModel<ThreadMessage> { |
| 1112 | public string AssistantId { get; } |
| 1113 | public IReadOnlyList<MessageCreationAttachment> Attachments { get; } |
| 1114 | public DateTimeOffset? CompletedAt { get; } |
| 1115 | public IReadOnlyList<MessageContent> Content { get; } |
| 1116 | public DateTimeOffset CreatedAt { get; } |
| 1117 | public string Id { get; } |
| 1118 | public DateTimeOffset? IncompleteAt { get; } |
| 1119 | public MessageFailureDetails IncompleteDetails { get; } |
| 1120 | public IReadOnlyDictionary<string, string> Metadata { get; } |
| 1121 | public MessageRole Role { get; } |
| 1122 | public string RunId { get; } |
| 1123 | public MessageStatus Status { get; } |
| 1124 | public string ThreadId { get; } |
| 1125 | [Experimental("OPENAI001")] |
| 1126 | protected virtual ThreadMessage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1127 | [Experimental("OPENAI001")] |
| 1128 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1129 | [Experimental("OPENAI001")] |
| 1130 | protected virtual ThreadMessage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1131 | [Experimental("OPENAI001")] |
| 1132 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1133 | } |
| 1134 | [Experimental("OPENAI001")] |
| 1135 | public class ThreadModificationOptions : IJsonModel<ThreadModificationOptions>, IPersistableModel<ThreadModificationOptions> { |
| 1136 | public IDictionary<string, string> Metadata { get; } |
| 1137 | public ToolResources ToolResources { get; set; } |
| 1138 | [Experimental("OPENAI001")] |
| 1139 | protected virtual ThreadModificationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1140 | [Experimental("OPENAI001")] |
| 1141 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1142 | [Experimental("OPENAI001")] |
| 1143 | protected virtual ThreadModificationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1144 | [Experimental("OPENAI001")] |
| 1145 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1146 | } |
| 1147 | [Experimental("OPENAI001")] |
| 1148 | public class ThreadRun : IJsonModel<ThreadRun>, IPersistableModel<ThreadRun> { |
| 1149 | public bool? AllowParallelToolCalls { get; } |
| 1150 | public string AssistantId { get; } |
| 1151 | public DateTimeOffset? CancelledAt { get; } |
| 1152 | public DateTimeOffset? CompletedAt { get; } |
| 1153 | public DateTimeOffset CreatedAt { get; } |
| 1154 | public DateTimeOffset? ExpiresAt { get; } |
| 1155 | public DateTimeOffset? FailedAt { get; } |
| 1156 | public string Id { get; } |
| 1157 | public RunIncompleteDetails IncompleteDetails { get; } |
| 1158 | public string Instructions { get; } |
| 1159 | public RunError LastError { get; } |
| 1160 | public int? MaxInputTokenCount { get; } |
| 1161 | public int? MaxOutputTokenCount { get; } |
| 1162 | public IReadOnlyDictionary<string, string> Metadata { get; } |
| 1163 | public string Model { get; } |
| 1164 | public float? NucleusSamplingFactor { get; } |
| 1165 | public IReadOnlyList<RequiredAction> RequiredActions { get; } |
| 1166 | public AssistantResponseFormat ResponseFormat { get; } |
| 1167 | public DateTimeOffset? StartedAt { get; } |
| 1168 | public RunStatus Status { get; } |
| 1169 | public float? Temperature { get; } |
| 1170 | public string ThreadId { get; } |
| 1171 | public ToolConstraint ToolConstraint { get; } |
| 1172 | public IReadOnlyList<ToolDefinition> Tools { get; } |
| 1173 | public RunTruncationStrategy TruncationStrategy { get; } |
| 1174 | public RunTokenUsage Usage { get; } |
| 1175 | [Experimental("OPENAI001")] |
| 1176 | protected virtual ThreadRun JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1177 | [Experimental("OPENAI001")] |
| 1178 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1179 | [Experimental("OPENAI001")] |
| 1180 | protected virtual ThreadRun PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1181 | [Experimental("OPENAI001")] |
| 1182 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1183 | } |
| 1184 | [Experimental("OPENAI001")] |
| 1185 | public class ThreadUpdate : StreamingUpdate<AssistantThread> { |
| 1186 | public DateTimeOffset CreatedAt { get; } |
| 1187 | public string Id { get; } |
| 1188 | public IReadOnlyDictionary<string, string> Metadata { get; } |
| 1189 | public ToolResources ToolResources { get; } |
| 1190 | } |
| 1191 | [Experimental("OPENAI001")] |
| 1192 | public class ToolConstraint : IJsonModel<ToolConstraint>, IPersistableModel<ToolConstraint> { |
| 1193 | public ToolConstraint(ToolDefinition toolDefinition); |
| 1194 | public static ToolConstraint Auto { get; } |
| 1195 | public static ToolConstraint None { get; } |
| 1196 | public static ToolConstraint Required { get; } |
| 1197 | [Experimental("OPENAI001")] |
| 1198 | protected virtual ToolConstraint JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1199 | [Experimental("OPENAI001")] |
| 1200 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1201 | [Experimental("OPENAI001")] |
| 1202 | protected virtual ToolConstraint PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1203 | [Experimental("OPENAI001")] |
| 1204 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1205 | } |
| 1206 | [Experimental("OPENAI001")] |
| 1207 | public class ToolDefinition : IJsonModel<ToolDefinition>, IPersistableModel<ToolDefinition> { |
| 1208 | public static CodeInterpreterToolDefinition CreateCodeInterpreter(); |
| 1209 | public static FileSearchToolDefinition CreateFileSearch(int? maxResults = null); |
| 1210 | public static FunctionToolDefinition CreateFunction(string name, string description = null, BinaryData parameters = null, bool? strictParameterSchemaEnabled = null); |
| 1211 | [Experimental("OPENAI001")] |
| 1212 | protected virtual ToolDefinition JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1213 | [Experimental("OPENAI001")] |
| 1214 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1215 | [Experimental("OPENAI001")] |
| 1216 | protected virtual ToolDefinition PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1217 | [Experimental("OPENAI001")] |
| 1218 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1219 | } |
| 1220 | [Experimental("OPENAI001")] |
| 1221 | public class ToolOutput : IJsonModel<ToolOutput>, IPersistableModel<ToolOutput> { |
| 1222 | public ToolOutput(); |
| 1223 | public ToolOutput(string toolCallId, string output); |
| 1224 | public string Output { get; set; } |
| 1225 | public string ToolCallId { get; set; } |
| 1226 | [Experimental("OPENAI001")] |
| 1227 | protected virtual ToolOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1228 | [Experimental("OPENAI001")] |
| 1229 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1230 | [Experimental("OPENAI001")] |
| 1231 | protected virtual ToolOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1232 | [Experimental("OPENAI001")] |
| 1233 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1234 | } |
| 1235 | [Experimental("OPENAI001")] |
| 1236 | public class ToolResources : IJsonModel<ToolResources>, IPersistableModel<ToolResources> { |
| 1237 | public CodeInterpreterToolResources CodeInterpreter { get; set; } |
| 1238 | public FileSearchToolResources FileSearch { get; set; } |
| 1239 | [Experimental("OPENAI001")] |
| 1240 | protected virtual ToolResources JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1241 | [Experimental("OPENAI001")] |
| 1242 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1243 | [Experimental("OPENAI001")] |
| 1244 | protected virtual ToolResources PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1245 | [Experimental("OPENAI001")] |
| 1246 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1247 | } |
| 1248 | [Experimental("OPENAI001")] |
| 1249 | public class VectorStoreCreationHelper : IJsonModel<VectorStoreCreationHelper>, IPersistableModel<VectorStoreCreationHelper> { |
| 1250 | public VectorStoreCreationHelper(); |
| 1251 | public VectorStoreCreationHelper(IEnumerable<OpenAIFile> files); |
| 1252 | public VectorStoreCreationHelper(IEnumerable<string> fileIds); |
| 1253 | public FileChunkingStrategy ChunkingStrategy { get; set; } |
| 1254 | public IList<string> FileIds { get; } |
| 1255 | public IDictionary<string, string> Metadata { get; } |
| 1256 | [Experimental("OPENAI001")] |
| 1257 | protected virtual VectorStoreCreationHelper JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1258 | [Experimental("OPENAI001")] |
| 1259 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1260 | [Experimental("OPENAI001")] |
| 1261 | protected virtual VectorStoreCreationHelper PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1262 | [Experimental("OPENAI001")] |
| 1263 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1264 | } |
| 1265 | } |
| 1266 | namespace OpenAI.Audio { |
| 1267 | public class AudioClient { |
| 1268 | protected AudioClient(); |
| 1269 | protected internal AudioClient(ClientPipeline pipeline, string model, OpenAIClientOptions options); |
| 1270 | public AudioClient(string model, ApiKeyCredential credential, OpenAIClientOptions options); |
| 1271 | public AudioClient(string model, ApiKeyCredential credential); |
| 1272 | public AudioClient(string model, string apiKey); |
| 1273 | public ClientPipeline Pipeline { get; } |
| 1274 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1275 | public virtual ClientResult GenerateSpeech(BinaryContent content, RequestOptions options = null); |
| 1276 | public virtual ClientResult<BinaryData> GenerateSpeech(string text, GeneratedSpeechVoice voice, SpeechGenerationOptions options = null, CancellationToken cancellationToken = default); |
| 1277 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1278 | public virtual Task<ClientResult> GenerateSpeechAsync(BinaryContent content, RequestOptions options = null); |
| 1279 | public virtual Task<ClientResult<BinaryData>> GenerateSpeechAsync(string text, GeneratedSpeechVoice voice, SpeechGenerationOptions options = null, CancellationToken cancellationToken = default); |
| 1280 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1281 | public virtual ClientResult TranscribeAudio(BinaryContent content, string contentType, RequestOptions options = null); |
| 1282 | public virtual ClientResult<AudioTranscription> TranscribeAudio(Stream audio, string audioFilename, AudioTranscriptionOptions options = null, CancellationToken cancellationToken = default); |
| 1283 | public virtual ClientResult<AudioTranscription> TranscribeAudio(string audioFilePath, AudioTranscriptionOptions options = null); |
| 1284 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1285 | public virtual Task<ClientResult> TranscribeAudioAsync(BinaryContent content, string contentType, RequestOptions options = null); |
| 1286 | public virtual Task<ClientResult<AudioTranscription>> TranscribeAudioAsync(Stream audio, string audioFilename, AudioTranscriptionOptions options = null, CancellationToken cancellationToken = default); |
| 1287 | public virtual Task<ClientResult<AudioTranscription>> TranscribeAudioAsync(string audioFilePath, AudioTranscriptionOptions options = null); |
| 1288 | [Experimental("OPENAI001")] |
| 1289 | public virtual CollectionResult<StreamingAudioTranscriptionUpdate> TranscribeAudioStreaming(Stream audio, string audioFilename, AudioTranscriptionOptions options = null, CancellationToken cancellationToken = default); |
| 1290 | [Experimental("OPENAI001")] |
| 1291 | public virtual CollectionResult<StreamingAudioTranscriptionUpdate> TranscribeAudioStreaming(string audioFilePath, AudioTranscriptionOptions options = null, CancellationToken cancellationToken = default); |
| 1292 | [Experimental("OPENAI001")] |
| 1293 | public virtual AsyncCollectionResult<StreamingAudioTranscriptionUpdate> TranscribeAudioStreamingAsync(Stream audio, string audioFilename, AudioTranscriptionOptions options = null, CancellationToken cancellationToken = default); |
| 1294 | [Experimental("OPENAI001")] |
| 1295 | public virtual AsyncCollectionResult<StreamingAudioTranscriptionUpdate> TranscribeAudioStreamingAsync(string audioFilePath, AudioTranscriptionOptions options = null, CancellationToken cancellationToken = default); |
| 1296 | public virtual ClientResult TranslateAudio(BinaryContent content, string contentType, RequestOptions options = null); |
| 1297 | public virtual ClientResult<AudioTranslation> TranslateAudio(Stream audio, string audioFilename, AudioTranslationOptions options = null, CancellationToken cancellationToken = default); |
| 1298 | public virtual ClientResult<AudioTranslation> TranslateAudio(string audioFilePath, AudioTranslationOptions options = null); |
| 1299 | public virtual Task<ClientResult> TranslateAudioAsync(BinaryContent content, string contentType, RequestOptions options = null); |
| 1300 | public virtual Task<ClientResult<AudioTranslation>> TranslateAudioAsync(Stream audio, string audioFilename, AudioTranslationOptions options = null, CancellationToken cancellationToken = default); |
| 1301 | public virtual Task<ClientResult<AudioTranslation>> TranslateAudioAsync(string audioFilePath, AudioTranslationOptions options = null); |
| 1302 | } |
| 1303 | [Flags] |
| 1304 | public enum AudioTimestampGranularities { |
| 1305 | Default = 0, |
| 1306 | Word = 1, |
| 1307 | Segment = 2 |
| 1308 | } |
| 1309 | [Experimental("OPENAI001")] |
| 1310 | public class AudioTokenLogProbabilityDetails : IJsonModel<AudioTokenLogProbabilityDetails>, IPersistableModel<AudioTokenLogProbabilityDetails> { |
| 1311 | public float LogProbability { get; } |
| 1312 | public string Token { get; } |
| 1313 | public ReadOnlyMemory<byte> Utf8Bytes { get; } |
| 1314 | [Experimental("OPENAI001")] |
| 1315 | protected virtual AudioTokenLogProbabilityDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1316 | [Experimental("OPENAI001")] |
| 1317 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1318 | [Experimental("OPENAI001")] |
| 1319 | protected virtual AudioTokenLogProbabilityDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1320 | [Experimental("OPENAI001")] |
| 1321 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1322 | } |
| 1323 | public class AudioTranscription : IJsonModel<AudioTranscription>, IPersistableModel<AudioTranscription> { |
| 1324 | public TimeSpan? Duration { get; } |
| 1325 | public string Language { get; } |
| 1326 | public IReadOnlyList<TranscribedSegment> Segments { get; } |
| 1327 | public string Text { get; } |
| 1328 | [Experimental("OPENAI001")] |
| 1329 | public IReadOnlyList<AudioTokenLogProbabilityDetails> TranscriptionTokenLogProbabilities { get; } |
| 1330 | public IReadOnlyList<TranscribedWord> Words { get; } |
| 1331 | [Experimental("OPENAI001")] |
| 1332 | protected virtual AudioTranscription JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1333 | [Experimental("OPENAI001")] |
| 1334 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1335 | [Experimental("OPENAI001")] |
| 1336 | protected virtual AudioTranscription PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1337 | [Experimental("OPENAI001")] |
| 1338 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1339 | } |
| 1340 | public readonly partial struct AudioTranscriptionFormat : IEquatable<AudioTranscriptionFormat> { |
| 1341 | public AudioTranscriptionFormat(string value); |
| 1342 | public static AudioTranscriptionFormat Simple { get; } |
| 1343 | public static AudioTranscriptionFormat Srt { get; } |
| 1344 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1345 | public static AudioTranscriptionFormat Text { get; } |
| 1346 | public static AudioTranscriptionFormat Verbose { get; } |
| 1347 | public static AudioTranscriptionFormat Vtt { get; } |
| 1348 | public readonly bool Equals(AudioTranscriptionFormat other); |
| 1349 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1350 | public override readonly bool Equals(object obj); |
| 1351 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1352 | public override readonly int GetHashCode(); |
| 1353 | public static bool operator ==(AudioTranscriptionFormat left, AudioTranscriptionFormat right); |
| 1354 | public static implicit operator AudioTranscriptionFormat(string value); |
| 1355 | public static bool operator !=(AudioTranscriptionFormat left, AudioTranscriptionFormat right); |
| 1356 | public override readonly string ToString(); |
| 1357 | } |
| 1358 | [Experimental("OPENAI001")] |
| 1359 | [Flags] |
| 1360 | public enum AudioTranscriptionIncludes { |
| 1361 | Default = 0, |
| 1362 | Logprobs = 1 |
| 1363 | } |
| 1364 | public class AudioTranscriptionOptions : IJsonModel<AudioTranscriptionOptions>, IPersistableModel<AudioTranscriptionOptions> { |
| 1365 | [Experimental("OPENAI001")] |
| 1366 | public AudioTranscriptionIncludes Includes { get; set; } |
| 1367 | public string Language { get; set; } |
| 1368 | public string Prompt { get; set; } |
| 1369 | public AudioTranscriptionFormat? ResponseFormat { get; set; } |
| 1370 | public float? Temperature { get; set; } |
| 1371 | public AudioTimestampGranularities TimestampGranularities { get; set; } |
| 1372 | [Experimental("OPENAI001")] |
| 1373 | protected virtual AudioTranscriptionOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1374 | [Experimental("OPENAI001")] |
| 1375 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1376 | [Experimental("OPENAI001")] |
| 1377 | protected virtual AudioTranscriptionOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1378 | [Experimental("OPENAI001")] |
| 1379 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1380 | } |
| 1381 | public class AudioTranslation : IJsonModel<AudioTranslation>, IPersistableModel<AudioTranslation> { |
| 1382 | public TimeSpan? Duration { get; } |
| 1383 | public string Language { get; } |
| 1384 | public IReadOnlyList<TranscribedSegment> Segments { get; } |
| 1385 | public string Text { get; } |
| 1386 | [Experimental("OPENAI001")] |
| 1387 | protected virtual AudioTranslation JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1388 | [Experimental("OPENAI001")] |
| 1389 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1390 | [Experimental("OPENAI001")] |
| 1391 | protected virtual AudioTranslation PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1392 | [Experimental("OPENAI001")] |
| 1393 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1394 | } |
| 1395 | public readonly partial struct AudioTranslationFormat : IEquatable<AudioTranslationFormat> { |
| 1396 | public AudioTranslationFormat(string value); |
| 1397 | public static AudioTranslationFormat Simple { get; } |
| 1398 | public static AudioTranslationFormat Srt { get; } |
| 1399 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1400 | public static AudioTranslationFormat Text { get; } |
| 1401 | public static AudioTranslationFormat Verbose { get; } |
| 1402 | public static AudioTranslationFormat Vtt { get; } |
| 1403 | public readonly bool Equals(AudioTranslationFormat other); |
| 1404 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1405 | public override readonly bool Equals(object obj); |
| 1406 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1407 | public override readonly int GetHashCode(); |
| 1408 | public static bool operator ==(AudioTranslationFormat left, AudioTranslationFormat right); |
| 1409 | public static implicit operator AudioTranslationFormat(string value); |
| 1410 | public static bool operator !=(AudioTranslationFormat left, AudioTranslationFormat right); |
| 1411 | public override readonly string ToString(); |
| 1412 | } |
| 1413 | public class AudioTranslationOptions : IJsonModel<AudioTranslationOptions>, IPersistableModel<AudioTranslationOptions> { |
| 1414 | public string Prompt { get; set; } |
| 1415 | public AudioTranslationFormat? ResponseFormat { get; set; } |
| 1416 | public float? Temperature { get; set; } |
| 1417 | [Experimental("OPENAI001")] |
| 1418 | protected virtual AudioTranslationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1419 | [Experimental("OPENAI001")] |
| 1420 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1421 | [Experimental("OPENAI001")] |
| 1422 | protected virtual AudioTranslationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1423 | [Experimental("OPENAI001")] |
| 1424 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1425 | } |
| 1426 | public readonly partial struct GeneratedSpeechFormat : IEquatable<GeneratedSpeechFormat> { |
| 1427 | public GeneratedSpeechFormat(string value); |
| 1428 | public static GeneratedSpeechFormat Aac { get; } |
| 1429 | public static GeneratedSpeechFormat Flac { get; } |
| 1430 | public static GeneratedSpeechFormat Mp3 { get; } |
| 1431 | public static GeneratedSpeechFormat Opus { get; } |
| 1432 | public static GeneratedSpeechFormat Pcm { get; } |
| 1433 | public static GeneratedSpeechFormat Wav { get; } |
| 1434 | public readonly bool Equals(GeneratedSpeechFormat other); |
| 1435 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1436 | public override readonly bool Equals(object obj); |
| 1437 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1438 | public override readonly int GetHashCode(); |
| 1439 | public static bool operator ==(GeneratedSpeechFormat left, GeneratedSpeechFormat right); |
| 1440 | public static implicit operator GeneratedSpeechFormat(string value); |
| 1441 | public static bool operator !=(GeneratedSpeechFormat left, GeneratedSpeechFormat right); |
| 1442 | public override readonly string ToString(); |
| 1443 | } |
| 1444 | public readonly partial struct GeneratedSpeechVoice : IEquatable<GeneratedSpeechVoice> { |
| 1445 | public GeneratedSpeechVoice(string value); |
| 1446 | public static GeneratedSpeechVoice Alloy { get; } |
| 1447 | [Experimental("OPENAI001")] |
| 1448 | public static GeneratedSpeechVoice Ash { get; } |
| 1449 | [Experimental("OPENAI001")] |
| 1450 | public static GeneratedSpeechVoice Ballad { get; } |
| 1451 | [Experimental("OPENAI001")] |
| 1452 | public static GeneratedSpeechVoice Coral { get; } |
| 1453 | public static GeneratedSpeechVoice Echo { get; } |
| 1454 | public static GeneratedSpeechVoice Fable { get; } |
| 1455 | public static GeneratedSpeechVoice Nova { get; } |
| 1456 | public static GeneratedSpeechVoice Onyx { get; } |
| 1457 | [Experimental("OPENAI001")] |
| 1458 | public static GeneratedSpeechVoice Sage { get; } |
| 1459 | public static GeneratedSpeechVoice Shimmer { get; } |
| 1460 | [Experimental("OPENAI001")] |
| 1461 | public static GeneratedSpeechVoice Verse { get; } |
| 1462 | public readonly bool Equals(GeneratedSpeechVoice other); |
| 1463 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1464 | public override readonly bool Equals(object obj); |
| 1465 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1466 | public override readonly int GetHashCode(); |
| 1467 | public static bool operator ==(GeneratedSpeechVoice left, GeneratedSpeechVoice right); |
| 1468 | public static implicit operator GeneratedSpeechVoice(string value); |
| 1469 | public static bool operator !=(GeneratedSpeechVoice left, GeneratedSpeechVoice right); |
| 1470 | public override readonly string ToString(); |
| 1471 | } |
| 1472 | public static class OpenAIAudioModelFactory { |
| 1473 | [Experimental("OPENAI001")] |
| 1474 | public static AudioTranscription AudioTranscription(string language = null, TimeSpan? duration = null, string text = null, IEnumerable<TranscribedWord> words = null, IEnumerable<TranscribedSegment> segments = null, IEnumerable<AudioTokenLogProbabilityDetails> transcriptionTokenLogProbabilities = null); |
| 1475 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1476 | public static AudioTranscription AudioTranscription(string language, TimeSpan? duration, string text, IEnumerable<TranscribedWord> words, IEnumerable<TranscribedSegment> segments); |
| 1477 | public static AudioTranslation AudioTranslation(string language = null, TimeSpan? duration = null, string text = null, IEnumerable<TranscribedSegment> segments = null); |
| 1478 | public static TranscribedSegment TranscribedSegment(int id = 0, int seekOffset = 0, TimeSpan startTime = default, TimeSpan endTime = default, string text = null, ReadOnlyMemory<int> tokenIds = default, float temperature = 0, float averageLogProbability = 0, float compressionRatio = 0, float noSpeechProbability = 0); |
| 1479 | public static TranscribedWord TranscribedWord(string word = null, TimeSpan startTime = default, TimeSpan endTime = default); |
| 1480 | } |
| 1481 | public class SpeechGenerationOptions : IJsonModel<SpeechGenerationOptions>, IPersistableModel<SpeechGenerationOptions> { |
| 1482 | [Experimental("OPENAI001")] |
| 1483 | public string Instructions { get; set; } |
| 1484 | public GeneratedSpeechFormat? ResponseFormat { get; set; } |
| 1485 | public float? SpeedRatio { get; set; } |
| 1486 | [Experimental("OPENAI001")] |
| 1487 | protected virtual SpeechGenerationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1488 | [Experimental("OPENAI001")] |
| 1489 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1490 | [Experimental("OPENAI001")] |
| 1491 | protected virtual SpeechGenerationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1492 | [Experimental("OPENAI001")] |
| 1493 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1494 | } |
| 1495 | [Experimental("OPENAI001")] |
| 1496 | public class StreamingAudioTranscriptionTextDeltaUpdate : StreamingAudioTranscriptionUpdate, IJsonModel<StreamingAudioTranscriptionTextDeltaUpdate>, IPersistableModel<StreamingAudioTranscriptionTextDeltaUpdate> { |
| 1497 | public string Delta { get; } |
| 1498 | public IReadOnlyList<AudioTokenLogProbabilityDetails> TranscriptionTokenLogProbabilities { get; } |
| 1499 | [Experimental("OPENAI001")] |
| 1500 | protected override StreamingAudioTranscriptionUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1501 | [Experimental("OPENAI001")] |
| 1502 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1503 | [Experimental("OPENAI001")] |
| 1504 | protected override StreamingAudioTranscriptionUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1505 | [Experimental("OPENAI001")] |
| 1506 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1507 | } |
| 1508 | [Experimental("OPENAI001")] |
| 1509 | public class StreamingAudioTranscriptionTextDoneUpdate : StreamingAudioTranscriptionUpdate, IJsonModel<StreamingAudioTranscriptionTextDoneUpdate>, IPersistableModel<StreamingAudioTranscriptionTextDoneUpdate> { |
| 1510 | public string Text { get; } |
| 1511 | public IReadOnlyList<AudioTokenLogProbabilityDetails> TranscriptionTokenLogProbabilities { get; } |
| 1512 | [Experimental("OPENAI001")] |
| 1513 | protected override StreamingAudioTranscriptionUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1514 | [Experimental("OPENAI001")] |
| 1515 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1516 | [Experimental("OPENAI001")] |
| 1517 | protected override StreamingAudioTranscriptionUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1518 | [Experimental("OPENAI001")] |
| 1519 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1520 | } |
| 1521 | [Experimental("OPENAI001")] |
| 1522 | public class StreamingAudioTranscriptionUpdate : IJsonModel<StreamingAudioTranscriptionUpdate>, IPersistableModel<StreamingAudioTranscriptionUpdate> { |
| 1523 | [Experimental("OPENAI001")] |
| 1524 | protected virtual StreamingAudioTranscriptionUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1525 | [Experimental("OPENAI001")] |
| 1526 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1527 | [Experimental("OPENAI001")] |
| 1528 | protected virtual StreamingAudioTranscriptionUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1529 | [Experimental("OPENAI001")] |
| 1530 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1531 | } |
| 1532 | [Experimental("OPENAI001")] |
| 1533 | public readonly partial struct StreamingAudioTranscriptionUpdateKind : IEquatable<StreamingAudioTranscriptionUpdateKind> { |
| 1534 | public StreamingAudioTranscriptionUpdateKind(string value); |
| 1535 | public static StreamingAudioTranscriptionUpdateKind TranscriptTextDelta { get; } |
| 1536 | public static StreamingAudioTranscriptionUpdateKind TranscriptTextDone { get; } |
| 1537 | public readonly bool Equals(StreamingAudioTranscriptionUpdateKind other); |
| 1538 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1539 | public override readonly bool Equals(object obj); |
| 1540 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1541 | public override readonly int GetHashCode(); |
| 1542 | public static bool operator ==(StreamingAudioTranscriptionUpdateKind left, StreamingAudioTranscriptionUpdateKind right); |
| 1543 | public static implicit operator StreamingAudioTranscriptionUpdateKind(string value); |
| 1544 | public static bool operator !=(StreamingAudioTranscriptionUpdateKind left, StreamingAudioTranscriptionUpdateKind right); |
| 1545 | public override readonly string ToString(); |
| 1546 | } |
| 1547 | public readonly partial struct TranscribedSegment : IJsonModel<TranscribedSegment>, IPersistableModel<TranscribedSegment>, IJsonModel<object>, IPersistableModel<object> { |
| 1548 | public float AverageLogProbability { get; } |
| 1549 | public float CompressionRatio { get; } |
| 1550 | public TimeSpan EndTime { get; } |
| 1551 | public int Id { get; } |
| 1552 | public float NoSpeechProbability { get; } |
| 1553 | public int SeekOffset { get; } |
| 1554 | public TimeSpan StartTime { get; } |
| 1555 | public float Temperature { get; } |
| 1556 | public string Text { get; } |
| 1557 | public ReadOnlyMemory<int> TokenIds { get; } |
| 1558 | } |
| 1559 | public readonly partial struct TranscribedWord : IJsonModel<TranscribedWord>, IPersistableModel<TranscribedWord>, IJsonModel<object>, IPersistableModel<object> { |
| 1560 | public TimeSpan EndTime { get; } |
| 1561 | public TimeSpan StartTime { get; } |
| 1562 | public string Word { get; } |
| 1563 | } |
| 1564 | } |
| 1565 | namespace OpenAI.Batch { |
| 1566 | [Experimental("OPENAI001")] |
| 1567 | public class BatchClient { |
| 1568 | protected BatchClient(); |
| 1569 | public BatchClient(ApiKeyCredential credential, OpenAIClientOptions options); |
| 1570 | public BatchClient(ApiKeyCredential credential); |
| 1571 | protected internal BatchClient(ClientPipeline pipeline, OpenAIClientOptions options); |
| 1572 | public BatchClient(string apiKey); |
| 1573 | public ClientPipeline Pipeline { get; } |
| 1574 | public virtual CreateBatchOperation CreateBatch(BinaryContent content, bool waitUntilCompleted, RequestOptions options = null); |
| 1575 | public virtual Task<CreateBatchOperation> CreateBatchAsync(BinaryContent content, bool waitUntilCompleted, RequestOptions options = null); |
| 1576 | public virtual CollectionResult GetBatches(string after, int? limit, RequestOptions options); |
| 1577 | public virtual AsyncCollectionResult GetBatchesAsync(string after, int? limit, RequestOptions options); |
| 1578 | } |
| 1579 | [Experimental("OPENAI001")] |
| 1580 | public class CreateBatchOperation : OperationResult { |
| 1581 | public string BatchId { get; } |
| 1582 | public override ContinuationToken? RehydrationToken { get; protected set; } |
| 1583 | public virtual ClientResult Cancel(RequestOptions? options); |
| 1584 | public virtual Task<ClientResult> CancelAsync(RequestOptions? options); |
| 1585 | public virtual ClientResult GetBatch(RequestOptions? options); |
| 1586 | public virtual Task<ClientResult> GetBatchAsync(RequestOptions? options); |
| 1587 | public static CreateBatchOperation Rehydrate(BatchClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default); |
| 1588 | public static CreateBatchOperation Rehydrate(BatchClient client, string batchId, CancellationToken cancellationToken = default); |
| 1589 | public static Task<CreateBatchOperation> RehydrateAsync(BatchClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default); |
| 1590 | public static Task<CreateBatchOperation> RehydrateAsync(BatchClient client, string batchId, CancellationToken cancellationToken = default); |
| 1591 | public override ClientResult UpdateStatus(RequestOptions? options = null); |
| 1592 | public override ValueTask<ClientResult> UpdateStatusAsync(RequestOptions? options = null); |
| 1593 | } |
| 1594 | } |
| 1595 | namespace OpenAI.Chat { |
| 1596 | public class AssistantChatMessage : ChatMessage, IJsonModel<AssistantChatMessage>, IPersistableModel<AssistantChatMessage> { |
| 1597 | public AssistantChatMessage(ChatCompletion chatCompletion); |
| 1598 | [Obsolete("This constructor is obsolete. Please use the constructor that takes an IEnumerable<ChatToolCall> parameter instead.")] |
| 1599 | public AssistantChatMessage(ChatFunctionCall functionCall); |
| 1600 | public AssistantChatMessage(params ChatMessageContentPart[] contentParts); |
| 1601 | [Experimental("OPENAI001")] |
| 1602 | public AssistantChatMessage(ChatOutputAudioReference outputAudioReference); |
| 1603 | public AssistantChatMessage(IEnumerable<ChatMessageContentPart> contentParts); |
| 1604 | public AssistantChatMessage(IEnumerable<ChatToolCall> toolCalls); |
| 1605 | public AssistantChatMessage(string content); |
| 1606 | [Obsolete("This property is obsolete. Please use ToolCalls instead.")] |
| 1607 | public ChatFunctionCall FunctionCall { get; set; } |
| 1608 | [Experimental("OPENAI001")] |
| 1609 | public ChatOutputAudioReference OutputAudioReference { get; set; } |
| 1610 | public string ParticipantName { get; set; } |
| 1611 | public string Refusal { get; set; } |
| 1612 | public IList<ChatToolCall> ToolCalls { get; } |
| 1613 | [Experimental("OPENAI001")] |
| 1614 | protected override ChatMessage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1615 | [Experimental("OPENAI001")] |
| 1616 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1617 | [Experimental("OPENAI001")] |
| 1618 | protected override ChatMessage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1619 | [Experimental("OPENAI001")] |
| 1620 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1621 | } |
| 1622 | [Experimental("OPENAI001")] |
| 1623 | public class ChatAudioOptions : IJsonModel<ChatAudioOptions>, IPersistableModel<ChatAudioOptions> { |
| 1624 | public ChatAudioOptions(ChatOutputAudioVoice outputAudioVoice, ChatOutputAudioFormat outputAudioFormat); |
| 1625 | public ChatOutputAudioFormat OutputAudioFormat { get; } |
| 1626 | public ChatOutputAudioVoice OutputAudioVoice { get; } |
| 1627 | [Experimental("OPENAI001")] |
| 1628 | protected virtual ChatAudioOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1629 | [Experimental("OPENAI001")] |
| 1630 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1631 | [Experimental("OPENAI001")] |
| 1632 | protected virtual ChatAudioOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1633 | [Experimental("OPENAI001")] |
| 1634 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1635 | } |
| 1636 | public class ChatClient { |
| 1637 | protected ChatClient(); |
| 1638 | protected internal ChatClient(ClientPipeline pipeline, string model, OpenAIClientOptions options); |
| 1639 | public ChatClient(string model, ApiKeyCredential credential, OpenAIClientOptions options); |
| 1640 | public ChatClient(string model, ApiKeyCredential credential); |
| 1641 | public ChatClient(string model, string apiKey); |
| 1642 | public ClientPipeline Pipeline { get; } |
| 1643 | public virtual ClientResult<ChatCompletion> CompleteChat(params ChatMessage[] messages); |
| 1644 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1645 | public virtual ClientResult CompleteChat(BinaryContent content, RequestOptions options = null); |
| 1646 | public virtual ClientResult<ChatCompletion> CompleteChat(IEnumerable<ChatMessage> messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default); |
| 1647 | public virtual Task<ClientResult<ChatCompletion>> CompleteChatAsync(params ChatMessage[] messages); |
| 1648 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1649 | public virtual Task<ClientResult> CompleteChatAsync(BinaryContent content, RequestOptions options = null); |
| 1650 | public virtual Task<ClientResult<ChatCompletion>> CompleteChatAsync(IEnumerable<ChatMessage> messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default); |
| 1651 | public virtual CollectionResult<StreamingChatCompletionUpdate> CompleteChatStreaming(params ChatMessage[] messages); |
| 1652 | public virtual CollectionResult<StreamingChatCompletionUpdate> CompleteChatStreaming(IEnumerable<ChatMessage> messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default); |
| 1653 | public virtual AsyncCollectionResult<StreamingChatCompletionUpdate> CompleteChatStreamingAsync(params ChatMessage[] messages); |
| 1654 | public virtual AsyncCollectionResult<StreamingChatCompletionUpdate> CompleteChatStreamingAsync(IEnumerable<ChatMessage> messages, ChatCompletionOptions options = null, CancellationToken cancellationToken = default); |
| 1655 | [Experimental("OPENAI001")] |
| 1656 | public virtual ClientResult DeleteChatCompletion(string completionId, RequestOptions options); |
| 1657 | [Experimental("OPENAI001")] |
| 1658 | public virtual ClientResult<ChatCompletionDeletionResult> DeleteChatCompletion(string completionId, CancellationToken cancellationToken = default); |
| 1659 | [Experimental("OPENAI001")] |
| 1660 | public virtual Task<ClientResult> DeleteChatCompletionAsync(string completionId, RequestOptions options); |
| 1661 | [Experimental("OPENAI001")] |
| 1662 | public virtual Task<ClientResult<ChatCompletionDeletionResult>> DeleteChatCompletionAsync(string completionId, CancellationToken cancellationToken = default); |
| 1663 | [Experimental("OPENAI001")] |
| 1664 | public virtual ClientResult GetChatCompletion(string completionId, RequestOptions options); |
| 1665 | [Experimental("OPENAI001")] |
| 1666 | public virtual ClientResult<ChatCompletion> GetChatCompletion(string completionId, CancellationToken cancellationToken = default); |
| 1667 | [Experimental("OPENAI001")] |
| 1668 | public virtual Task<ClientResult> GetChatCompletionAsync(string completionId, RequestOptions options); |
| 1669 | [Experimental("OPENAI001")] |
| 1670 | public virtual Task<ClientResult<ChatCompletion>> GetChatCompletionAsync(string completionId, CancellationToken cancellationToken = default); |
| 1671 | } |
| 1672 | public class ChatCompletion : IJsonModel<ChatCompletion>, IPersistableModel<ChatCompletion> { |
| 1673 | [Experimental("OPENAI001")] |
| 1674 | public IReadOnlyList<ChatMessageAnnotation> Annotations { get; } |
| 1675 | public ChatMessageContent Content { get; } |
| 1676 | public IReadOnlyList<ChatTokenLogProbabilityDetails> ContentTokenLogProbabilities { get; } |
| 1677 | public DateTimeOffset CreatedAt { get; } |
| 1678 | public ChatFinishReason FinishReason { get; } |
| 1679 | [Obsolete("This property is obsolete. Please use ToolCalls instead.")] |
| 1680 | public ChatFunctionCall FunctionCall { get; } |
| 1681 | public string Id { get; } |
| 1682 | public string Model { get; } |
| 1683 | [Experimental("OPENAI001")] |
| 1684 | public ChatOutputAudio OutputAudio { get; } |
| 1685 | public string Refusal { get; } |
| 1686 | public IReadOnlyList<ChatTokenLogProbabilityDetails> RefusalTokenLogProbabilities { get; } |
| 1687 | public ChatMessageRole Role { get; } |
| 1688 | public string SystemFingerprint { get; } |
| 1689 | public IReadOnlyList<ChatToolCall> ToolCalls { get; } |
| 1690 | public ChatTokenUsage Usage { get; } |
| 1691 | [Experimental("OPENAI001")] |
| 1692 | protected virtual ChatCompletion JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1693 | [Experimental("OPENAI001")] |
| 1694 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1695 | [Experimental("OPENAI001")] |
| 1696 | protected virtual ChatCompletion PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1697 | [Experimental("OPENAI001")] |
| 1698 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1699 | } |
| 1700 | [Experimental("OPENAI001")] |
| 1701 | public class ChatCompletionDeletionResult : IJsonModel<ChatCompletionDeletionResult>, IPersistableModel<ChatCompletionDeletionResult> { |
| 1702 | public string ChatCompletionId { get; } |
| 1703 | public bool Deleted { get; } |
| 1704 | [Experimental("OPENAI001")] |
| 1705 | protected virtual ChatCompletionDeletionResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1706 | [Experimental("OPENAI001")] |
| 1707 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1708 | [Experimental("OPENAI001")] |
| 1709 | protected virtual ChatCompletionDeletionResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1710 | [Experimental("OPENAI001")] |
| 1711 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1712 | } |
| 1713 | public class ChatCompletionOptions : IJsonModel<ChatCompletionOptions>, IPersistableModel<ChatCompletionOptions> { |
| 1714 | public bool? AllowParallelToolCalls { get; set; } |
| 1715 | [Experimental("OPENAI001")] |
| 1716 | public ChatAudioOptions AudioOptions { get; set; } |
| 1717 | public string EndUserId { get; set; } |
| 1718 | public float? FrequencyPenalty { get; set; } |
| 1719 | [Obsolete("This property is obsolete. Please use ToolChoice instead.")] |
| 1720 | public ChatFunctionChoice FunctionChoice { get; set; } |
| 1721 | [Obsolete("This property is obsolete. Please use Tools instead.")] |
| 1722 | public IList<ChatFunction> Functions { get; } |
| 1723 | public bool? IncludeLogProbabilities { get; set; } |
| 1724 | public IDictionary<int, int> LogitBiases { get; } |
| 1725 | public int? MaxOutputTokenCount { get; set; } |
| 1726 | public IDictionary<string, string> Metadata { get; } |
| 1727 | [Experimental("OPENAI001")] |
| 1728 | public ChatOutputPrediction OutputPrediction { get; set; } |
| 1729 | public float? PresencePenalty { get; set; } |
| 1730 | [Experimental("OPENAI001")] |
| 1731 | public ChatReasoningEffortLevel? ReasoningEffortLevel { get; set; } |
| 1732 | public ChatResponseFormat ResponseFormat { get; set; } |
| 1733 | [Experimental("OPENAI001")] |
| 1734 | public ChatResponseModalities ResponseModalities { get; set; } |
| 1735 | [Experimental("OPENAI001")] |
| 1736 | public long? Seed { get; set; } |
| 1737 | public IList<string> StopSequences { get; } |
| 1738 | public bool? StoredOutputEnabled { get; set; } |
| 1739 | public float? Temperature { get; set; } |
| 1740 | public ChatToolChoice ToolChoice { get; set; } |
| 1741 | public IList<ChatTool> Tools { get; } |
| 1742 | public int? TopLogProbabilityCount { get; set; } |
| 1743 | public float? TopP { get; set; } |
| 1744 | [Experimental("OPENAI001")] |
| 1745 | public ChatWebSearchOptions WebSearchOptions { get; set; } |
| 1746 | [Experimental("OPENAI001")] |
| 1747 | protected virtual ChatCompletionOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1748 | [Experimental("OPENAI001")] |
| 1749 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1750 | [Experimental("OPENAI001")] |
| 1751 | protected virtual ChatCompletionOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1752 | [Experimental("OPENAI001")] |
| 1753 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1754 | } |
| 1755 | public enum ChatFinishReason { |
| 1756 | Stop = 0, |
| 1757 | Length = 1, |
| 1758 | ContentFilter = 2, |
| 1759 | ToolCalls = 3, |
| 1760 | FunctionCall = 4 |
| 1761 | } |
| 1762 | [Obsolete("This class is obsolete. Please use ChatTool instead.")] |
| 1763 | public class ChatFunction : IJsonModel<ChatFunction>, IPersistableModel<ChatFunction> { |
| 1764 | public ChatFunction(string functionName); |
| 1765 | public string FunctionDescription { get; set; } |
| 1766 | public string FunctionName { get; } |
| 1767 | public BinaryData FunctionParameters { get; set; } |
| 1768 | [Experimental("OPENAI001")] |
| 1769 | protected virtual ChatFunction JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1770 | [Experimental("OPENAI001")] |
| 1771 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1772 | [Experimental("OPENAI001")] |
| 1773 | protected virtual ChatFunction PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1774 | [Experimental("OPENAI001")] |
| 1775 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1776 | } |
| 1777 | [Obsolete("This class is obsolete. Please use ChatToolCall instead.")] |
| 1778 | public class ChatFunctionCall : IJsonModel<ChatFunctionCall>, IPersistableModel<ChatFunctionCall> { |
| 1779 | public ChatFunctionCall(string functionName, BinaryData functionArguments); |
| 1780 | public BinaryData FunctionArguments { get; } |
| 1781 | public string FunctionName { get; } |
| 1782 | [Experimental("OPENAI001")] |
| 1783 | protected virtual ChatFunctionCall JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1784 | [Experimental("OPENAI001")] |
| 1785 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1786 | [Experimental("OPENAI001")] |
| 1787 | protected virtual ChatFunctionCall PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1788 | [Experimental("OPENAI001")] |
| 1789 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1790 | } |
| 1791 | [Obsolete("This class is obsolete. Please use ChatToolChoice instead.")] |
| 1792 | public class ChatFunctionChoice : IJsonModel<ChatFunctionChoice>, IPersistableModel<ChatFunctionChoice> { |
| 1793 | public static ChatFunctionChoice CreateAutoChoice(); |
| 1794 | public static ChatFunctionChoice CreateNamedChoice(string functionName); |
| 1795 | public static ChatFunctionChoice CreateNoneChoice(); |
| 1796 | [Experimental("OPENAI001")] |
| 1797 | protected virtual ChatFunctionChoice JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1798 | [Experimental("OPENAI001")] |
| 1799 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1800 | [Experimental("OPENAI001")] |
| 1801 | protected virtual ChatFunctionChoice PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1802 | [Experimental("OPENAI001")] |
| 1803 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1804 | } |
| 1805 | public readonly partial struct ChatImageDetailLevel : IEquatable<ChatImageDetailLevel> { |
| 1806 | public ChatImageDetailLevel(string value); |
| 1807 | public static ChatImageDetailLevel Auto { get; } |
| 1808 | public static ChatImageDetailLevel High { get; } |
| 1809 | public static ChatImageDetailLevel Low { get; } |
| 1810 | public readonly bool Equals(ChatImageDetailLevel other); |
| 1811 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1812 | public override readonly bool Equals(object obj); |
| 1813 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1814 | public override readonly int GetHashCode(); |
| 1815 | public static bool operator ==(ChatImageDetailLevel left, ChatImageDetailLevel right); |
| 1816 | public static implicit operator ChatImageDetailLevel(string value); |
| 1817 | public static bool operator !=(ChatImageDetailLevel left, ChatImageDetailLevel right); |
| 1818 | public override readonly string ToString(); |
| 1819 | } |
| 1820 | [Experimental("OPENAI001")] |
| 1821 | public readonly partial struct ChatInputAudioFormat : IEquatable<ChatInputAudioFormat> { |
| 1822 | public ChatInputAudioFormat(string value); |
| 1823 | public static ChatInputAudioFormat Mp3 { get; } |
| 1824 | public static ChatInputAudioFormat Wav { get; } |
| 1825 | public readonly bool Equals(ChatInputAudioFormat other); |
| 1826 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1827 | public override readonly bool Equals(object obj); |
| 1828 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1829 | public override readonly int GetHashCode(); |
| 1830 | public static bool operator ==(ChatInputAudioFormat left, ChatInputAudioFormat right); |
| 1831 | public static implicit operator ChatInputAudioFormat(string value); |
| 1832 | public static bool operator !=(ChatInputAudioFormat left, ChatInputAudioFormat right); |
| 1833 | public override readonly string ToString(); |
| 1834 | } |
| 1835 | public class ChatInputTokenUsageDetails : IJsonModel<ChatInputTokenUsageDetails>, IPersistableModel<ChatInputTokenUsageDetails> { |
| 1836 | public int AudioTokenCount { get; } |
| 1837 | public int CachedTokenCount { get; } |
| 1838 | [Experimental("OPENAI001")] |
| 1839 | protected virtual ChatInputTokenUsageDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1840 | [Experimental("OPENAI001")] |
| 1841 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1842 | [Experimental("OPENAI001")] |
| 1843 | protected virtual ChatInputTokenUsageDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1844 | [Experimental("OPENAI001")] |
| 1845 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1846 | } |
| 1847 | public class ChatMessage : IJsonModel<ChatMessage>, IPersistableModel<ChatMessage> { |
| 1848 | public ChatMessageContent Content { get; } |
| 1849 | public static AssistantChatMessage CreateAssistantMessage(ChatCompletion chatCompletion); |
| 1850 | public static AssistantChatMessage CreateAssistantMessage(ChatFunctionCall functionCall); |
| 1851 | public static AssistantChatMessage CreateAssistantMessage(params ChatMessageContentPart[] contentParts); |
| 1852 | [Experimental("OPENAI001")] |
| 1853 | public static AssistantChatMessage CreateAssistantMessage(ChatOutputAudioReference outputAudioReference); |
| 1854 | public static AssistantChatMessage CreateAssistantMessage(IEnumerable<ChatMessageContentPart> contentParts); |
| 1855 | public static AssistantChatMessage CreateAssistantMessage(IEnumerable<ChatToolCall> toolCalls); |
| 1856 | public static AssistantChatMessage CreateAssistantMessage(string content); |
| 1857 | [Experimental("OPENAI001")] |
| 1858 | public static DeveloperChatMessage CreateDeveloperMessage(params ChatMessageContentPart[] contentParts); |
| 1859 | [Experimental("OPENAI001")] |
| 1860 | public static DeveloperChatMessage CreateDeveloperMessage(IEnumerable<ChatMessageContentPart> contentParts); |
| 1861 | [Experimental("OPENAI001")] |
| 1862 | public static DeveloperChatMessage CreateDeveloperMessage(string content); |
| 1863 | [Obsolete("This method is obsolete. Please use CreateToolMessage instead.")] |
| 1864 | public static FunctionChatMessage CreateFunctionMessage(string functionName, string content); |
| 1865 | public static SystemChatMessage CreateSystemMessage(params ChatMessageContentPart[] contentParts); |
| 1866 | public static SystemChatMessage CreateSystemMessage(IEnumerable<ChatMessageContentPart> contentParts); |
| 1867 | public static SystemChatMessage CreateSystemMessage(string content); |
| 1868 | public static ToolChatMessage CreateToolMessage(string toolCallId, params ChatMessageContentPart[] contentParts); |
| 1869 | public static ToolChatMessage CreateToolMessage(string toolCallId, IEnumerable<ChatMessageContentPart> contentParts); |
| 1870 | public static ToolChatMessage CreateToolMessage(string toolCallId, string content); |
| 1871 | public static UserChatMessage CreateUserMessage(params ChatMessageContentPart[] contentParts); |
| 1872 | public static UserChatMessage CreateUserMessage(IEnumerable<ChatMessageContentPart> contentParts); |
| 1873 | public static UserChatMessage CreateUserMessage(string content); |
| 1874 | [Experimental("OPENAI001")] |
| 1875 | protected virtual ChatMessage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1876 | [Experimental("OPENAI001")] |
| 1877 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1878 | public static implicit operator ChatMessage(string content); |
| 1879 | [Experimental("OPENAI001")] |
| 1880 | protected virtual ChatMessage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1881 | [Experimental("OPENAI001")] |
| 1882 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1883 | } |
| 1884 | [Experimental("OPENAI001")] |
| 1885 | public class ChatMessageAnnotation : IJsonModel<ChatMessageAnnotation>, IPersistableModel<ChatMessageAnnotation> { |
| 1886 | public int EndIndex { get; } |
| 1887 | public int StartIndex { get; } |
| 1888 | public string WebResourceTitle { get; } |
| 1889 | public Uri WebResourceUri { get; } |
| 1890 | [Experimental("OPENAI001")] |
| 1891 | protected virtual ChatMessageAnnotation JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1892 | [Experimental("OPENAI001")] |
| 1893 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1894 | [Experimental("OPENAI001")] |
| 1895 | protected virtual ChatMessageAnnotation PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1896 | [Experimental("OPENAI001")] |
| 1897 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1898 | } |
| 1899 | public class ChatMessageContent : ObjectModel.Collection<ChatMessageContentPart> { |
| 1900 | public ChatMessageContent(); |
| 1901 | public ChatMessageContent(params ChatMessageContentPart[] contentParts); |
| 1902 | public ChatMessageContent(IEnumerable<ChatMessageContentPart> contentParts); |
| 1903 | public ChatMessageContent(string content); |
| 1904 | } |
| 1905 | public class ChatMessageContentPart : IJsonModel<ChatMessageContentPart>, IPersistableModel<ChatMessageContentPart> { |
| 1906 | [Experimental("OPENAI001")] |
| 1907 | public BinaryData FileBytes { get; } |
| 1908 | [Experimental("OPENAI001")] |
| 1909 | public string FileBytesMediaType { get; } |
| 1910 | [Experimental("OPENAI001")] |
| 1911 | public string FileId { get; } |
| 1912 | [Experimental("OPENAI001")] |
| 1913 | public string Filename { get; } |
| 1914 | public BinaryData ImageBytes { get; } |
| 1915 | public string ImageBytesMediaType { get; } |
| 1916 | public ChatImageDetailLevel? ImageDetailLevel { get; } |
| 1917 | public Uri ImageUri { get; } |
| 1918 | [Experimental("OPENAI001")] |
| 1919 | public BinaryData InputAudioBytes { get; } |
| 1920 | [Experimental("OPENAI001")] |
| 1921 | public ChatInputAudioFormat? InputAudioFormat { get; } |
| 1922 | public ChatMessageContentPartKind Kind { get; } |
| 1923 | public string Refusal { get; } |
| 1924 | public string Text { get; } |
| 1925 | [Experimental("OPENAI001")] |
| 1926 | public static ChatMessageContentPart CreateFilePart(BinaryData fileBytes, string fileBytesMediaType, string filename); |
| 1927 | [Experimental("OPENAI001")] |
| 1928 | public static ChatMessageContentPart CreateFilePart(string fileId); |
| 1929 | public static ChatMessageContentPart CreateImagePart(BinaryData imageBytes, string imageBytesMediaType, ChatImageDetailLevel? imageDetailLevel = null); |
| 1930 | public static ChatMessageContentPart CreateImagePart(Uri imageUri, ChatImageDetailLevel? imageDetailLevel = null); |
| 1931 | [Experimental("OPENAI001")] |
| 1932 | public static ChatMessageContentPart CreateInputAudioPart(BinaryData inputAudioBytes, ChatInputAudioFormat inputAudioFormat); |
| 1933 | public static ChatMessageContentPart CreateRefusalPart(string refusal); |
| 1934 | public static ChatMessageContentPart CreateTextPart(string text); |
| 1935 | [Experimental("OPENAI001")] |
| 1936 | protected virtual ChatMessageContentPart JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1937 | [Experimental("OPENAI001")] |
| 1938 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1939 | public static implicit operator ChatMessageContentPart(string text); |
| 1940 | [Experimental("OPENAI001")] |
| 1941 | protected virtual ChatMessageContentPart PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1942 | [Experimental("OPENAI001")] |
| 1943 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1944 | } |
| 1945 | public enum ChatMessageContentPartKind { |
| 1946 | Text = 0, |
| 1947 | Refusal = 1, |
| 1948 | Image = 2, |
| 1949 | InputAudio = 3, |
| 1950 | File = 4 |
| 1951 | } |
| 1952 | public enum ChatMessageRole { |
| 1953 | System = 0, |
| 1954 | User = 1, |
| 1955 | Assistant = 2, |
| 1956 | Tool = 3, |
| 1957 | Function = 4, |
| 1958 | Developer = 5 |
| 1959 | } |
| 1960 | [Experimental("OPENAI001")] |
| 1961 | public class ChatOutputAudio : IJsonModel<ChatOutputAudio>, IPersistableModel<ChatOutputAudio> { |
| 1962 | public BinaryData AudioBytes { get; } |
| 1963 | public DateTimeOffset ExpiresAt { get; } |
| 1964 | public string Id { get; } |
| 1965 | public string Transcript { get; } |
| 1966 | [Experimental("OPENAI001")] |
| 1967 | protected virtual ChatOutputAudio JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 1968 | [Experimental("OPENAI001")] |
| 1969 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 1970 | [Experimental("OPENAI001")] |
| 1971 | protected virtual ChatOutputAudio PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 1972 | [Experimental("OPENAI001")] |
| 1973 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 1974 | } |
| 1975 | [Experimental("OPENAI001")] |
| 1976 | public readonly partial struct ChatOutputAudioFormat : IEquatable<ChatOutputAudioFormat> { |
| 1977 | public ChatOutputAudioFormat(string value); |
| 1978 | public static ChatOutputAudioFormat Aac { get; } |
| 1979 | public static ChatOutputAudioFormat Flac { get; } |
| 1980 | public static ChatOutputAudioFormat Mp3 { get; } |
| 1981 | public static ChatOutputAudioFormat Opus { get; } |
| 1982 | public static ChatOutputAudioFormat Pcm16 { get; } |
| 1983 | public static ChatOutputAudioFormat Wav { get; } |
| 1984 | public readonly bool Equals(ChatOutputAudioFormat other); |
| 1985 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1986 | public override readonly bool Equals(object obj); |
| 1987 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 1988 | public override readonly int GetHashCode(); |
| 1989 | public static bool operator ==(ChatOutputAudioFormat left, ChatOutputAudioFormat right); |
| 1990 | public static implicit operator ChatOutputAudioFormat(string value); |
| 1991 | public static bool operator !=(ChatOutputAudioFormat left, ChatOutputAudioFormat right); |
| 1992 | public override readonly string ToString(); |
| 1993 | } |
| 1994 | [Experimental("OPENAI001")] |
| 1995 | public class ChatOutputAudioReference : IJsonModel<ChatOutputAudioReference>, IPersistableModel<ChatOutputAudioReference> { |
| 1996 | public ChatOutputAudioReference(string id); |
| 1997 | public string Id { get; } |
| 1998 | [Experimental("OPENAI001")] |
| 1999 | protected virtual ChatOutputAudioReference JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2000 | [Experimental("OPENAI001")] |
| 2001 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2002 | [Experimental("OPENAI001")] |
| 2003 | protected virtual ChatOutputAudioReference PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2004 | [Experimental("OPENAI001")] |
| 2005 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2006 | } |
| 2007 | [Experimental("OPENAI001")] |
| 2008 | public readonly partial struct ChatOutputAudioVoice : IEquatable<ChatOutputAudioVoice> { |
| 2009 | public ChatOutputAudioVoice(string value); |
| 2010 | public static ChatOutputAudioVoice Alloy { get; } |
| 2011 | public static ChatOutputAudioVoice Ash { get; } |
| 2012 | public static ChatOutputAudioVoice Ballad { get; } |
| 2013 | public static ChatOutputAudioVoice Coral { get; } |
| 2014 | public static ChatOutputAudioVoice Echo { get; } |
| 2015 | public static ChatOutputAudioVoice Fable { get; } |
| 2016 | public static ChatOutputAudioVoice Nova { get; } |
| 2017 | public static ChatOutputAudioVoice Onyx { get; } |
| 2018 | public static ChatOutputAudioVoice Sage { get; } |
| 2019 | public static ChatOutputAudioVoice Shimmer { get; } |
| 2020 | public static ChatOutputAudioVoice Verse { get; } |
| 2021 | public readonly bool Equals(ChatOutputAudioVoice other); |
| 2022 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2023 | public override readonly bool Equals(object obj); |
| 2024 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2025 | public override readonly int GetHashCode(); |
| 2026 | public static bool operator ==(ChatOutputAudioVoice left, ChatOutputAudioVoice right); |
| 2027 | public static implicit operator ChatOutputAudioVoice(string value); |
| 2028 | public static bool operator !=(ChatOutputAudioVoice left, ChatOutputAudioVoice right); |
| 2029 | public override readonly string ToString(); |
| 2030 | } |
| 2031 | [Experimental("OPENAI001")] |
| 2032 | public class ChatOutputPrediction : IJsonModel<ChatOutputPrediction>, IPersistableModel<ChatOutputPrediction> { |
| 2033 | public static ChatOutputPrediction CreateStaticContentPrediction(IEnumerable<ChatMessageContentPart> staticContentParts); |
| 2034 | public static ChatOutputPrediction CreateStaticContentPrediction(string staticContent); |
| 2035 | [Experimental("OPENAI001")] |
| 2036 | protected virtual ChatOutputPrediction JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2037 | [Experimental("OPENAI001")] |
| 2038 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2039 | [Experimental("OPENAI001")] |
| 2040 | protected virtual ChatOutputPrediction PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2041 | [Experimental("OPENAI001")] |
| 2042 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2043 | } |
| 2044 | public class ChatOutputTokenUsageDetails : IJsonModel<ChatOutputTokenUsageDetails>, IPersistableModel<ChatOutputTokenUsageDetails> { |
| 2045 | [Experimental("OPENAI001")] |
| 2046 | public int AcceptedPredictionTokenCount { get; } |
| 2047 | public int AudioTokenCount { get; } |
| 2048 | public int ReasoningTokenCount { get; } |
| 2049 | [Experimental("OPENAI001")] |
| 2050 | public int RejectedPredictionTokenCount { get; } |
| 2051 | [Experimental("OPENAI001")] |
| 2052 | protected virtual ChatOutputTokenUsageDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2053 | [Experimental("OPENAI001")] |
| 2054 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2055 | [Experimental("OPENAI001")] |
| 2056 | protected virtual ChatOutputTokenUsageDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2057 | [Experimental("OPENAI001")] |
| 2058 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2059 | } |
| 2060 | [Experimental("OPENAI001")] |
| 2061 | public readonly partial struct ChatReasoningEffortLevel : IEquatable<ChatReasoningEffortLevel> { |
| 2062 | public ChatReasoningEffortLevel(string value); |
| 2063 | public static ChatReasoningEffortLevel High { get; } |
| 2064 | public static ChatReasoningEffortLevel Low { get; } |
| 2065 | public static ChatReasoningEffortLevel Medium { get; } |
| 2066 | public readonly bool Equals(ChatReasoningEffortLevel other); |
| 2067 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2068 | public override readonly bool Equals(object obj); |
| 2069 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2070 | public override readonly int GetHashCode(); |
| 2071 | public static bool operator ==(ChatReasoningEffortLevel left, ChatReasoningEffortLevel right); |
| 2072 | public static implicit operator ChatReasoningEffortLevel(string value); |
| 2073 | public static bool operator !=(ChatReasoningEffortLevel left, ChatReasoningEffortLevel right); |
| 2074 | public override readonly string ToString(); |
| 2075 | } |
| 2076 | public class ChatResponseFormat : IJsonModel<ChatResponseFormat>, IPersistableModel<ChatResponseFormat> { |
| 2077 | public static ChatResponseFormat CreateJsonObjectFormat(); |
| 2078 | public static ChatResponseFormat CreateJsonSchemaFormat(string jsonSchemaFormatName, BinaryData jsonSchema, string jsonSchemaFormatDescription = null, bool? jsonSchemaIsStrict = null); |
| 2079 | public static ChatResponseFormat CreateTextFormat(); |
| 2080 | [Experimental("OPENAI001")] |
| 2081 | protected virtual ChatResponseFormat JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2082 | [Experimental("OPENAI001")] |
| 2083 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2084 | [Experimental("OPENAI001")] |
| 2085 | protected virtual ChatResponseFormat PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2086 | [Experimental("OPENAI001")] |
| 2087 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2088 | } |
| 2089 | [Experimental("OPENAI001")] |
| 2090 | [Flags] |
| 2091 | public enum ChatResponseModalities { |
| 2092 | Default = 0, |
| 2093 | Text = 1, |
| 2094 | Audio = 2 |
| 2095 | } |
| 2096 | public class ChatTokenLogProbabilityDetails : IJsonModel<ChatTokenLogProbabilityDetails>, IPersistableModel<ChatTokenLogProbabilityDetails> { |
| 2097 | public float LogProbability { get; } |
| 2098 | public string Token { get; } |
| 2099 | public IReadOnlyList<ChatTokenTopLogProbabilityDetails> TopLogProbabilities { get; } |
| 2100 | public ReadOnlyMemory<byte>? Utf8Bytes { get; } |
| 2101 | [Experimental("OPENAI001")] |
| 2102 | protected virtual ChatTokenLogProbabilityDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2103 | [Experimental("OPENAI001")] |
| 2104 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2105 | [Experimental("OPENAI001")] |
| 2106 | protected virtual ChatTokenLogProbabilityDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2107 | [Experimental("OPENAI001")] |
| 2108 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2109 | } |
| 2110 | public class ChatTokenTopLogProbabilityDetails : IJsonModel<ChatTokenTopLogProbabilityDetails>, IPersistableModel<ChatTokenTopLogProbabilityDetails> { |
| 2111 | public float LogProbability { get; } |
| 2112 | public string Token { get; } |
| 2113 | public ReadOnlyMemory<byte>? Utf8Bytes { get; } |
| 2114 | [Experimental("OPENAI001")] |
| 2115 | protected virtual ChatTokenTopLogProbabilityDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2116 | [Experimental("OPENAI001")] |
| 2117 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2118 | [Experimental("OPENAI001")] |
| 2119 | protected virtual ChatTokenTopLogProbabilityDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2120 | [Experimental("OPENAI001")] |
| 2121 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2122 | } |
| 2123 | public class ChatTokenUsage : IJsonModel<ChatTokenUsage>, IPersistableModel<ChatTokenUsage> { |
| 2124 | public int InputTokenCount { get; } |
| 2125 | public ChatInputTokenUsageDetails InputTokenDetails { get; } |
| 2126 | public int OutputTokenCount { get; } |
| 2127 | public ChatOutputTokenUsageDetails OutputTokenDetails { get; } |
| 2128 | public int TotalTokenCount { get; } |
| 2129 | [Experimental("OPENAI001")] |
| 2130 | protected virtual ChatTokenUsage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2131 | [Experimental("OPENAI001")] |
| 2132 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2133 | [Experimental("OPENAI001")] |
| 2134 | protected virtual ChatTokenUsage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2135 | [Experimental("OPENAI001")] |
| 2136 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2137 | } |
| 2138 | public class ChatTool : IJsonModel<ChatTool>, IPersistableModel<ChatTool> { |
| 2139 | public string FunctionDescription { get; } |
| 2140 | public string FunctionName { get; } |
| 2141 | public BinaryData FunctionParameters { get; } |
| 2142 | public bool? FunctionSchemaIsStrict { get; } |
| 2143 | public ChatToolKind Kind { get; } |
| 2144 | public static ChatTool CreateFunctionTool(string functionName, string functionDescription = null, BinaryData functionParameters = null, bool? functionSchemaIsStrict = null); |
| 2145 | [Experimental("OPENAI001")] |
| 2146 | protected virtual ChatTool JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2147 | [Experimental("OPENAI001")] |
| 2148 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2149 | [Experimental("OPENAI001")] |
| 2150 | protected virtual ChatTool PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2151 | [Experimental("OPENAI001")] |
| 2152 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2153 | } |
| 2154 | public class ChatToolCall : IJsonModel<ChatToolCall>, IPersistableModel<ChatToolCall> { |
| 2155 | public BinaryData FunctionArguments { get; } |
| 2156 | public string FunctionName { get; } |
| 2157 | public string Id { get; set; } |
| 2158 | public ChatToolCallKind Kind { get; } |
| 2159 | public static ChatToolCall CreateFunctionToolCall(string id, string functionName, BinaryData functionArguments); |
| 2160 | [Experimental("OPENAI001")] |
| 2161 | protected virtual ChatToolCall JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2162 | [Experimental("OPENAI001")] |
| 2163 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2164 | [Experimental("OPENAI001")] |
| 2165 | protected virtual ChatToolCall PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2166 | [Experimental("OPENAI001")] |
| 2167 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2168 | } |
| 2169 | public enum ChatToolCallKind { |
| 2170 | Function = 0 |
| 2171 | } |
| 2172 | public class ChatToolChoice : IJsonModel<ChatToolChoice>, IPersistableModel<ChatToolChoice> { |
| 2173 | public static ChatToolChoice CreateAutoChoice(); |
| 2174 | public static ChatToolChoice CreateFunctionChoice(string functionName); |
| 2175 | public static ChatToolChoice CreateNoneChoice(); |
| 2176 | public static ChatToolChoice CreateRequiredChoice(); |
| 2177 | [Experimental("OPENAI001")] |
| 2178 | protected virtual ChatToolChoice JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2179 | [Experimental("OPENAI001")] |
| 2180 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2181 | [Experimental("OPENAI001")] |
| 2182 | protected virtual ChatToolChoice PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2183 | [Experimental("OPENAI001")] |
| 2184 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2185 | } |
| 2186 | public enum ChatToolKind { |
| 2187 | Function = 0 |
| 2188 | } |
| 2189 | [Experimental("OPENAI001")] |
| 2190 | public class ChatWebSearchOptions : IJsonModel<ChatWebSearchOptions>, IPersistableModel<ChatWebSearchOptions> { |
| 2191 | [Experimental("OPENAI001")] |
| 2192 | protected virtual ChatWebSearchOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2193 | [Experimental("OPENAI001")] |
| 2194 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2195 | [Experimental("OPENAI001")] |
| 2196 | protected virtual ChatWebSearchOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2197 | [Experimental("OPENAI001")] |
| 2198 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2199 | } |
| 2200 | [Experimental("OPENAI001")] |
| 2201 | public class DeveloperChatMessage : ChatMessage, IJsonModel<DeveloperChatMessage>, IPersistableModel<DeveloperChatMessage> { |
| 2202 | public DeveloperChatMessage(params ChatMessageContentPart[] contentParts); |
| 2203 | public DeveloperChatMessage(IEnumerable<ChatMessageContentPart> contentParts); |
| 2204 | public DeveloperChatMessage(string content); |
| 2205 | public string ParticipantName { get; set; } |
| 2206 | [Experimental("OPENAI001")] |
| 2207 | protected override ChatMessage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2208 | [Experimental("OPENAI001")] |
| 2209 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2210 | [Experimental("OPENAI001")] |
| 2211 | protected override ChatMessage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2212 | [Experimental("OPENAI001")] |
| 2213 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2214 | } |
| 2215 | [Obsolete("This class is obsolete. Please use ToolChatMessage instead.")] |
| 2216 | public class FunctionChatMessage : ChatMessage, IJsonModel<FunctionChatMessage>, IPersistableModel<FunctionChatMessage> { |
| 2217 | public FunctionChatMessage(string functionName, string content); |
| 2218 | public string FunctionName { get; } |
| 2219 | [Experimental("OPENAI001")] |
| 2220 | protected override ChatMessage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2221 | [Experimental("OPENAI001")] |
| 2222 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2223 | [Experimental("OPENAI001")] |
| 2224 | protected override ChatMessage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2225 | [Experimental("OPENAI001")] |
| 2226 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2227 | } |
| 2228 | public static class OpenAIChatModelFactory { |
| 2229 | [Experimental("OPENAI001")] |
| 2230 | public static ChatCompletion ChatCompletion(string id = null, ChatFinishReason finishReason = ChatFinishReason.Stop, ChatMessageContent content = null, string refusal = null, IEnumerable<ChatToolCall> toolCalls = null, ChatMessageRole role = ChatMessageRole.System, ChatFunctionCall functionCall = null, IEnumerable<ChatTokenLogProbabilityDetails> contentTokenLogProbabilities = null, IEnumerable<ChatTokenLogProbabilityDetails> refusalTokenLogProbabilities = null, DateTimeOffset createdAt = default, string model = null, string systemFingerprint = null, ChatTokenUsage usage = null, ChatOutputAudio outputAudio = null, IEnumerable<ChatMessageAnnotation> messageAnnotations = null); |
| 2231 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2232 | public static ChatCompletion ChatCompletion(string id, ChatFinishReason finishReason, ChatMessageContent content, string refusal, IEnumerable<ChatToolCall> toolCalls, ChatMessageRole role, ChatFunctionCall functionCall, IEnumerable<ChatTokenLogProbabilityDetails> contentTokenLogProbabilities, IEnumerable<ChatTokenLogProbabilityDetails> refusalTokenLogProbabilities, DateTimeOffset createdAt, string model, string systemFingerprint, ChatTokenUsage usage); |
| 2233 | public static ChatInputTokenUsageDetails ChatInputTokenUsageDetails(int audioTokenCount = 0, int cachedTokenCount = 0); |
| 2234 | [Experimental("OPENAI001")] |
| 2235 | public static ChatMessageAnnotation ChatMessageAnnotation(int startIndex = 0, int endIndex = 0, Uri webResourceUri = null, string webResourceTitle = null); |
| 2236 | [Experimental("OPENAI001")] |
| 2237 | public static ChatOutputAudio ChatOutputAudio(BinaryData audioBytes, string id = null, string transcript = null, DateTimeOffset expiresAt = default); |
| 2238 | [Experimental("OPENAI001")] |
| 2239 | public static ChatOutputTokenUsageDetails ChatOutputTokenUsageDetails(int reasoningTokenCount = 0, int audioTokenCount = 0, int acceptedPredictionTokenCount = 0, int rejectedPredictionTokenCount = 0); |
| 2240 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2241 | public static ChatOutputTokenUsageDetails ChatOutputTokenUsageDetails(int reasoningTokenCount, int audioTokenCount); |
| 2242 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2243 | public static ChatOutputTokenUsageDetails ChatOutputTokenUsageDetails(int reasoningTokenCount); |
| 2244 | public static ChatTokenLogProbabilityDetails ChatTokenLogProbabilityDetails(string token = null, float logProbability = 0, ReadOnlyMemory<byte>? utf8Bytes = null, IEnumerable<ChatTokenTopLogProbabilityDetails> topLogProbabilities = null); |
| 2245 | public static ChatTokenTopLogProbabilityDetails ChatTokenTopLogProbabilityDetails(string token = null, float logProbability = 0, ReadOnlyMemory<byte>? utf8Bytes = null); |
| 2246 | public static ChatTokenUsage ChatTokenUsage(int outputTokenCount = 0, int inputTokenCount = 0, int totalTokenCount = 0, ChatOutputTokenUsageDetails outputTokenDetails = null, ChatInputTokenUsageDetails inputTokenDetails = null); |
| 2247 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2248 | public static ChatTokenUsage ChatTokenUsage(int outputTokenCount, int inputTokenCount, int totalTokenCount, ChatOutputTokenUsageDetails outputTokenDetails); |
| 2249 | [Experimental("OPENAI001")] |
| 2250 | public static StreamingChatCompletionUpdate StreamingChatCompletionUpdate(string completionId = null, ChatMessageContent contentUpdate = null, StreamingChatFunctionCallUpdate functionCallUpdate = null, IEnumerable<StreamingChatToolCallUpdate> toolCallUpdates = null, ChatMessageRole? role = null, string refusalUpdate = null, IEnumerable<ChatTokenLogProbabilityDetails> contentTokenLogProbabilities = null, IEnumerable<ChatTokenLogProbabilityDetails> refusalTokenLogProbabilities = null, ChatFinishReason? finishReason = null, DateTimeOffset createdAt = default, string model = null, string systemFingerprint = null, ChatTokenUsage usage = null, StreamingChatOutputAudioUpdate outputAudioUpdate = null); |
| 2251 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2252 | public static StreamingChatCompletionUpdate StreamingChatCompletionUpdate(string completionId, ChatMessageContent contentUpdate, StreamingChatFunctionCallUpdate functionCallUpdate, IEnumerable<StreamingChatToolCallUpdate> toolCallUpdates, ChatMessageRole? role, string refusalUpdate, IEnumerable<ChatTokenLogProbabilityDetails> contentTokenLogProbabilities, IEnumerable<ChatTokenLogProbabilityDetails> refusalTokenLogProbabilities, ChatFinishReason? finishReason, DateTimeOffset createdAt, string model, string systemFingerprint, ChatTokenUsage usage); |
| 2253 | [Obsolete("This class is obsolete. Please use StreamingChatToolCallUpdate instead.")] |
| 2254 | public static StreamingChatFunctionCallUpdate StreamingChatFunctionCallUpdate(string functionName = null, BinaryData functionArgumentsUpdate = null); |
| 2255 | [Experimental("OPENAI001")] |
| 2256 | public static StreamingChatOutputAudioUpdate StreamingChatOutputAudioUpdate(string id = null, DateTimeOffset? expiresAt = null, string transcriptUpdate = null, BinaryData audioBytesUpdate = null); |
| 2257 | public static StreamingChatToolCallUpdate StreamingChatToolCallUpdate(int index = 0, string toolCallId = null, ChatToolCallKind kind = ChatToolCallKind.Function, string functionName = null, BinaryData functionArgumentsUpdate = null); |
| 2258 | } |
| 2259 | public class StreamingChatCompletionUpdate : IJsonModel<StreamingChatCompletionUpdate>, IPersistableModel<StreamingChatCompletionUpdate> { |
| 2260 | public string CompletionId { get; } |
| 2261 | public IReadOnlyList<ChatTokenLogProbabilityDetails> ContentTokenLogProbabilities { get; } |
| 2262 | public ChatMessageContent ContentUpdate { get; } |
| 2263 | public DateTimeOffset CreatedAt { get; } |
| 2264 | public ChatFinishReason? FinishReason { get; } |
| 2265 | [Obsolete("This property is obsolete. Please use ToolCallUpdates instead.")] |
| 2266 | public StreamingChatFunctionCallUpdate FunctionCallUpdate { get; } |
| 2267 | public string Model { get; } |
| 2268 | [Experimental("OPENAI001")] |
| 2269 | public StreamingChatOutputAudioUpdate OutputAudioUpdate { get; } |
| 2270 | public IReadOnlyList<ChatTokenLogProbabilityDetails> RefusalTokenLogProbabilities { get; } |
| 2271 | public string RefusalUpdate { get; } |
| 2272 | public ChatMessageRole? Role { get; } |
| 2273 | public string SystemFingerprint { get; } |
| 2274 | public IReadOnlyList<StreamingChatToolCallUpdate> ToolCallUpdates { get; } |
| 2275 | public ChatTokenUsage Usage { get; } |
| 2276 | [Experimental("OPENAI001")] |
| 2277 | protected virtual StreamingChatCompletionUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2278 | [Experimental("OPENAI001")] |
| 2279 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2280 | [Experimental("OPENAI001")] |
| 2281 | protected virtual StreamingChatCompletionUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2282 | [Experimental("OPENAI001")] |
| 2283 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2284 | } |
| 2285 | [Obsolete("This class is obsolete. Please use StreamingChatToolCallUpdate instead.")] |
| 2286 | public class StreamingChatFunctionCallUpdate : IJsonModel<StreamingChatFunctionCallUpdate>, IPersistableModel<StreamingChatFunctionCallUpdate> { |
| 2287 | public BinaryData FunctionArgumentsUpdate { get; } |
| 2288 | public string FunctionName { get; } |
| 2289 | [Experimental("OPENAI001")] |
| 2290 | protected virtual StreamingChatFunctionCallUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2291 | [Experimental("OPENAI001")] |
| 2292 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2293 | [Experimental("OPENAI001")] |
| 2294 | protected virtual StreamingChatFunctionCallUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2295 | [Experimental("OPENAI001")] |
| 2296 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2297 | } |
| 2298 | [Experimental("OPENAI001")] |
| 2299 | public class StreamingChatOutputAudioUpdate : IJsonModel<StreamingChatOutputAudioUpdate>, IPersistableModel<StreamingChatOutputAudioUpdate> { |
| 2300 | public BinaryData AudioBytesUpdate { get; } |
| 2301 | public DateTimeOffset? ExpiresAt { get; } |
| 2302 | public string Id { get; } |
| 2303 | public string TranscriptUpdate { get; } |
| 2304 | [Experimental("OPENAI001")] |
| 2305 | protected virtual StreamingChatOutputAudioUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2306 | [Experimental("OPENAI001")] |
| 2307 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2308 | [Experimental("OPENAI001")] |
| 2309 | protected virtual StreamingChatOutputAudioUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2310 | [Experimental("OPENAI001")] |
| 2311 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2312 | } |
| 2313 | public class StreamingChatToolCallUpdate : IJsonModel<StreamingChatToolCallUpdate>, IPersistableModel<StreamingChatToolCallUpdate> { |
| 2314 | public BinaryData FunctionArgumentsUpdate { get; } |
| 2315 | public string FunctionName { get; } |
| 2316 | public int Index { get; } |
| 2317 | public ChatToolCallKind Kind { get; } |
| 2318 | public string ToolCallId { get; } |
| 2319 | [Experimental("OPENAI001")] |
| 2320 | protected virtual StreamingChatToolCallUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2321 | [Experimental("OPENAI001")] |
| 2322 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2323 | [Experimental("OPENAI001")] |
| 2324 | protected virtual StreamingChatToolCallUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2325 | [Experimental("OPENAI001")] |
| 2326 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2327 | } |
| 2328 | public class SystemChatMessage : ChatMessage, IJsonModel<SystemChatMessage>, IPersistableModel<SystemChatMessage> { |
| 2329 | public SystemChatMessage(params ChatMessageContentPart[] contentParts); |
| 2330 | public SystemChatMessage(IEnumerable<ChatMessageContentPart> contentParts); |
| 2331 | public SystemChatMessage(string content); |
| 2332 | public string ParticipantName { get; set; } |
| 2333 | [Experimental("OPENAI001")] |
| 2334 | protected override ChatMessage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2335 | [Experimental("OPENAI001")] |
| 2336 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2337 | [Experimental("OPENAI001")] |
| 2338 | protected override ChatMessage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2339 | [Experimental("OPENAI001")] |
| 2340 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2341 | } |
| 2342 | public class ToolChatMessage : ChatMessage, IJsonModel<ToolChatMessage>, IPersistableModel<ToolChatMessage> { |
| 2343 | public ToolChatMessage(string toolCallId, params ChatMessageContentPart[] contentParts); |
| 2344 | public ToolChatMessage(string toolCallId, IEnumerable<ChatMessageContentPart> contentParts); |
| 2345 | public ToolChatMessage(string toolCallId, string content); |
| 2346 | public string ToolCallId { get; } |
| 2347 | [Experimental("OPENAI001")] |
| 2348 | protected override ChatMessage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2349 | [Experimental("OPENAI001")] |
| 2350 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2351 | [Experimental("OPENAI001")] |
| 2352 | protected override ChatMessage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2353 | [Experimental("OPENAI001")] |
| 2354 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2355 | } |
| 2356 | public class UserChatMessage : ChatMessage, IJsonModel<UserChatMessage>, IPersistableModel<UserChatMessage> { |
| 2357 | public UserChatMessage(params ChatMessageContentPart[] contentParts); |
| 2358 | public UserChatMessage(IEnumerable<ChatMessageContentPart> contentParts); |
| 2359 | public UserChatMessage(string content); |
| 2360 | public string ParticipantName { get; set; } |
| 2361 | [Experimental("OPENAI001")] |
| 2362 | protected override ChatMessage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2363 | [Experimental("OPENAI001")] |
| 2364 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2365 | [Experimental("OPENAI001")] |
| 2366 | protected override ChatMessage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2367 | [Experimental("OPENAI001")] |
| 2368 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2369 | } |
| 2370 | } |
| 2371 | namespace OpenAI.Embeddings { |
| 2372 | public class EmbeddingClient { |
| 2373 | protected EmbeddingClient(); |
| 2374 | protected internal EmbeddingClient(ClientPipeline pipeline, string model, OpenAIClientOptions options); |
| 2375 | public EmbeddingClient(string model, ApiKeyCredential credential, OpenAIClientOptions options); |
| 2376 | public EmbeddingClient(string model, ApiKeyCredential credential); |
| 2377 | public EmbeddingClient(string model, string apiKey); |
| 2378 | public ClientPipeline Pipeline { get; } |
| 2379 | public virtual ClientResult<OpenAIEmbedding> GenerateEmbedding(string input, EmbeddingGenerationOptions options = null, CancellationToken cancellationToken = default); |
| 2380 | public virtual Task<ClientResult<OpenAIEmbedding>> GenerateEmbeddingAsync(string input, EmbeddingGenerationOptions options = null, CancellationToken cancellationToken = default); |
| 2381 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2382 | public virtual ClientResult GenerateEmbeddings(BinaryContent content, RequestOptions options = null); |
| 2383 | public virtual ClientResult<OpenAIEmbeddingCollection> GenerateEmbeddings(IEnumerable<ReadOnlyMemory<int>> inputs, EmbeddingGenerationOptions options = null, CancellationToken cancellationToken = default); |
| 2384 | public virtual ClientResult<OpenAIEmbeddingCollection> GenerateEmbeddings(IEnumerable<string> inputs, EmbeddingGenerationOptions options = null, CancellationToken cancellationToken = default); |
| 2385 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2386 | public virtual Task<ClientResult> GenerateEmbeddingsAsync(BinaryContent content, RequestOptions options = null); |
| 2387 | public virtual Task<ClientResult<OpenAIEmbeddingCollection>> GenerateEmbeddingsAsync(IEnumerable<ReadOnlyMemory<int>> inputs, EmbeddingGenerationOptions options = null, CancellationToken cancellationToken = default); |
| 2388 | public virtual Task<ClientResult<OpenAIEmbeddingCollection>> GenerateEmbeddingsAsync(IEnumerable<string> inputs, EmbeddingGenerationOptions options = null, CancellationToken cancellationToken = default); |
| 2389 | } |
| 2390 | public class EmbeddingGenerationOptions : IJsonModel<EmbeddingGenerationOptions>, IPersistableModel<EmbeddingGenerationOptions> { |
| 2391 | public int? Dimensions { get; set; } |
| 2392 | public string EndUserId { get; set; } |
| 2393 | [Experimental("OPENAI001")] |
| 2394 | protected virtual EmbeddingGenerationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2395 | [Experimental("OPENAI001")] |
| 2396 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2397 | [Experimental("OPENAI001")] |
| 2398 | protected virtual EmbeddingGenerationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2399 | [Experimental("OPENAI001")] |
| 2400 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2401 | } |
| 2402 | public class EmbeddingTokenUsage : IJsonModel<EmbeddingTokenUsage>, IPersistableModel<EmbeddingTokenUsage> { |
| 2403 | public int InputTokenCount { get; } |
| 2404 | public int TotalTokenCount { get; } |
| 2405 | [Experimental("OPENAI001")] |
| 2406 | protected virtual EmbeddingTokenUsage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2407 | [Experimental("OPENAI001")] |
| 2408 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2409 | [Experimental("OPENAI001")] |
| 2410 | protected virtual EmbeddingTokenUsage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2411 | [Experimental("OPENAI001")] |
| 2412 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2413 | } |
| 2414 | public class OpenAIEmbedding : IJsonModel<OpenAIEmbedding>, IPersistableModel<OpenAIEmbedding> { |
| 2415 | public int Index { get; } |
| 2416 | [Experimental("OPENAI001")] |
| 2417 | protected virtual OpenAIEmbedding JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2418 | [Experimental("OPENAI001")] |
| 2419 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2420 | [Experimental("OPENAI001")] |
| 2421 | protected virtual OpenAIEmbedding PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2422 | [Experimental("OPENAI001")] |
| 2423 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2424 | public ReadOnlyMemory<float> ToFloats(); |
| 2425 | } |
| 2426 | public class OpenAIEmbeddingCollection : ObjectModel.ReadOnlyCollection<OpenAIEmbedding>, IJsonModel<OpenAIEmbeddingCollection>, IPersistableModel<OpenAIEmbeddingCollection> { |
| 2427 | public string Model { get; } |
| 2428 | public EmbeddingTokenUsage Usage { get; } |
| 2429 | [Experimental("OPENAI001")] |
| 2430 | protected virtual OpenAIEmbeddingCollection JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2431 | [Experimental("OPENAI001")] |
| 2432 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2433 | [Experimental("OPENAI001")] |
| 2434 | protected virtual OpenAIEmbeddingCollection PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2435 | [Experimental("OPENAI001")] |
| 2436 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2437 | } |
| 2438 | public static class OpenAIEmbeddingsModelFactory { |
| 2439 | public static EmbeddingTokenUsage EmbeddingTokenUsage(int inputTokenCount = 0, int totalTokenCount = 0); |
| 2440 | public static OpenAIEmbedding OpenAIEmbedding(int index = 0, IEnumerable<float> vector = null); |
| 2441 | public static OpenAIEmbeddingCollection OpenAIEmbeddingCollection(IEnumerable<OpenAIEmbedding> items = null, string model = null, EmbeddingTokenUsage usage = null); |
| 2442 | } |
| 2443 | } |
| 2444 | namespace OpenAI.Evals { |
| 2445 | [Experimental("OPENAI001")] |
| 2446 | public class EvaluationClient { |
| 2447 | protected EvaluationClient(); |
| 2448 | public EvaluationClient(ApiKeyCredential credential, OpenAIClientOptions options); |
| 2449 | public EvaluationClient(ApiKeyCredential credential); |
| 2450 | protected internal EvaluationClient(ClientPipeline pipeline, OpenAIClientOptions options); |
| 2451 | public EvaluationClient(string apiKey); |
| 2452 | public ClientPipeline Pipeline { get; } |
| 2453 | public virtual ClientResult CancelEvaluationRun(string evaluationId, string evaluationRunId, RequestOptions options); |
| 2454 | public virtual Task<ClientResult> CancelEvaluationRunAsync(string evaluationId, string evaluationRunId, RequestOptions options); |
| 2455 | public virtual ClientResult CreateEvaluation(BinaryContent content, RequestOptions options = null); |
| 2456 | public virtual Task<ClientResult> CreateEvaluationAsync(BinaryContent content, RequestOptions options = null); |
| 2457 | public virtual ClientResult CreateEvaluationRun(string evaluationId, BinaryContent content, RequestOptions options = null); |
| 2458 | public virtual Task<ClientResult> CreateEvaluationRunAsync(string evaluationId, BinaryContent content, RequestOptions options = null); |
| 2459 | public virtual ClientResult DeleteEvaluation(string evaluationId, RequestOptions options); |
| 2460 | public virtual Task<ClientResult> DeleteEvaluationAsync(string evaluationId, RequestOptions options); |
| 2461 | public virtual ClientResult DeleteEvaluationRun(string evaluationId, string evaluationRunId, RequestOptions options); |
| 2462 | public virtual Task<ClientResult> DeleteEvaluationRunAsync(string evaluationId, string evaluationRunId, RequestOptions options); |
| 2463 | public virtual ClientResult GetEvaluation(string evaluationId, RequestOptions options); |
| 2464 | public virtual Task<ClientResult> GetEvaluationAsync(string evaluationId, RequestOptions options); |
| 2465 | public virtual ClientResult GetEvaluationRun(string evaluationId, string evaluationRunId, RequestOptions options); |
| 2466 | public virtual Task<ClientResult> GetEvaluationRunAsync(string evaluationId, string evaluationRunId, RequestOptions options); |
| 2467 | public virtual ClientResult GetEvaluationRunOutputItem(string evaluationId, string evaluationRunId, string outputItemId, RequestOptions options); |
| 2468 | public virtual Task<ClientResult> GetEvaluationRunOutputItemAsync(string evaluationId, string evaluationRunId, string outputItemId, RequestOptions options); |
| 2469 | public virtual ClientResult GetEvaluationRunOutputItems(string evaluationId, string evaluationRunId, int? limit, string order, string after, string outputItemStatus, RequestOptions options); |
| 2470 | public virtual Task<ClientResult> GetEvaluationRunOutputItemsAsync(string evaluationId, string evaluationRunId, int? limit, string order, string after, string outputItemStatus, RequestOptions options); |
| 2471 | public virtual ClientResult GetEvaluationRuns(string evaluationId, int? limit, string order, string after, string evaluationRunStatus, RequestOptions options); |
| 2472 | public virtual Task<ClientResult> GetEvaluationRunsAsync(string evaluationId, int? limit, string order, string after, string evaluationRunStatus, RequestOptions options); |
| 2473 | public virtual ClientResult GetEvaluations(int? limit, string orderBy, string order, string after, RequestOptions options); |
| 2474 | public virtual Task<ClientResult> GetEvaluationsAsync(int? limit, string orderBy, string order, string after, RequestOptions options); |
| 2475 | public virtual ClientResult UpdateEvaluation(string evaluationId, BinaryContent content, RequestOptions options = null); |
| 2476 | public virtual Task<ClientResult> UpdateEvaluationAsync(string evaluationId, BinaryContent content, RequestOptions options = null); |
| 2477 | } |
| 2478 | } |
| 2479 | namespace OpenAI.Files { |
| 2480 | public class FileDeletionResult : IJsonModel<FileDeletionResult>, IPersistableModel<FileDeletionResult> { |
| 2481 | public bool Deleted { get; } |
| 2482 | public string FileId { get; } |
| 2483 | [Experimental("OPENAI001")] |
| 2484 | protected virtual FileDeletionResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2485 | [Experimental("OPENAI001")] |
| 2486 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2487 | [Experimental("OPENAI001")] |
| 2488 | protected virtual FileDeletionResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2489 | [Experimental("OPENAI001")] |
| 2490 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2491 | } |
| 2492 | public enum FilePurpose { |
| 2493 | Assistants = 0, |
| 2494 | AssistantsOutput = 1, |
| 2495 | Batch = 2, |
| 2496 | BatchOutput = 3, |
| 2497 | FineTune = 4, |
| 2498 | FineTuneResults = 5, |
| 2499 | Vision = 6, |
| 2500 | UserData = 7, |
| 2501 | Evaluations = 8 |
| 2502 | } |
| 2503 | [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.")] |
| 2504 | public enum FileStatus { |
| 2505 | Uploaded = 0, |
| 2506 | Processed = 1, |
| 2507 | Error = 2 |
| 2508 | } |
| 2509 | public readonly partial struct FileUploadPurpose : IEquatable<FileUploadPurpose> { |
| 2510 | public FileUploadPurpose(string value); |
| 2511 | public static FileUploadPurpose Assistants { get; } |
| 2512 | public static FileUploadPurpose Batch { get; } |
| 2513 | [Experimental("OPENAI001")] |
| 2514 | public static FileUploadPurpose Evaluations { get; } |
| 2515 | public static FileUploadPurpose FineTune { get; } |
| 2516 | [Experimental("OPENAI001")] |
| 2517 | public static FileUploadPurpose UserData { get; } |
| 2518 | public static FileUploadPurpose Vision { get; } |
| 2519 | public readonly bool Equals(FileUploadPurpose other); |
| 2520 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2521 | public override readonly bool Equals(object obj); |
| 2522 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2523 | public override readonly int GetHashCode(); |
| 2524 | public static bool operator ==(FileUploadPurpose left, FileUploadPurpose right); |
| 2525 | public static implicit operator FileUploadPurpose(string value); |
| 2526 | public static bool operator !=(FileUploadPurpose left, FileUploadPurpose right); |
| 2527 | public override readonly string ToString(); |
| 2528 | } |
| 2529 | public class OpenAIFile : IJsonModel<OpenAIFile>, IPersistableModel<OpenAIFile> { |
| 2530 | public DateTimeOffset CreatedAt { get; } |
| 2531 | [Experimental("OPENAI001")] |
| 2532 | public DateTimeOffset? ExpiresAt { get; } |
| 2533 | public string Filename { get; } |
| 2534 | public string Id { get; } |
| 2535 | public FilePurpose Purpose { get; } |
| 2536 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2537 | public int? SizeInBytes { get; } |
| 2538 | [Experimental("OPENAI001")] |
| 2539 | public long? SizeInBytesLong { get; } |
| 2540 | [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.")] |
| 2541 | public FileStatus Status { get; } |
| 2542 | [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.")] |
| 2543 | public string StatusDetails { get; } |
| 2544 | [Experimental("OPENAI001")] |
| 2545 | protected virtual OpenAIFile JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2546 | [Experimental("OPENAI001")] |
| 2547 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2548 | [Experimental("OPENAI001")] |
| 2549 | protected virtual OpenAIFile PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2550 | [Experimental("OPENAI001")] |
| 2551 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2552 | } |
| 2553 | public class OpenAIFileClient { |
| 2554 | protected OpenAIFileClient(); |
| 2555 | public OpenAIFileClient(ApiKeyCredential credential, OpenAIClientOptions options); |
| 2556 | public OpenAIFileClient(ApiKeyCredential credential); |
| 2557 | protected internal OpenAIFileClient(ClientPipeline pipeline, OpenAIClientOptions options); |
| 2558 | public OpenAIFileClient(string apiKey); |
| 2559 | public ClientPipeline Pipeline { get; } |
| 2560 | [Experimental("OPENAI001")] |
| 2561 | public virtual ClientResult AddUploadPart(string uploadId, BinaryContent content, string contentType, RequestOptions options = null); |
| 2562 | [Experimental("OPENAI001")] |
| 2563 | public virtual Task<ClientResult> AddUploadPartAsync(string uploadId, BinaryContent content, string contentType, RequestOptions options = null); |
| 2564 | [Experimental("OPENAI001")] |
| 2565 | public virtual ClientResult CancelUpload(string uploadId, RequestOptions options = null); |
| 2566 | [Experimental("OPENAI001")] |
| 2567 | public virtual Task<ClientResult> CancelUploadAsync(string uploadId, RequestOptions options = null); |
| 2568 | [Experimental("OPENAI001")] |
| 2569 | public virtual ClientResult CompleteUpload(string uploadId, BinaryContent content, RequestOptions options = null); |
| 2570 | [Experimental("OPENAI001")] |
| 2571 | public virtual Task<ClientResult> CompleteUploadAsync(string uploadId, BinaryContent content, RequestOptions options = null); |
| 2572 | [Experimental("OPENAI001")] |
| 2573 | public virtual ClientResult CreateUpload(BinaryContent content, RequestOptions options = null); |
| 2574 | [Experimental("OPENAI001")] |
| 2575 | public virtual Task<ClientResult> CreateUploadAsync(BinaryContent content, RequestOptions options = null); |
| 2576 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2577 | public virtual ClientResult DeleteFile(string fileId, RequestOptions options); |
| 2578 | public virtual ClientResult<FileDeletionResult> DeleteFile(string fileId, CancellationToken cancellationToken = default); |
| 2579 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2580 | public virtual Task<ClientResult> DeleteFileAsync(string fileId, RequestOptions options); |
| 2581 | public virtual Task<ClientResult<FileDeletionResult>> DeleteFileAsync(string fileId, CancellationToken cancellationToken = default); |
| 2582 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2583 | public virtual ClientResult DownloadFile(string fileId, RequestOptions options); |
| 2584 | public virtual ClientResult<BinaryData> DownloadFile(string fileId, CancellationToken cancellationToken = default); |
| 2585 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2586 | public virtual Task<ClientResult> DownloadFileAsync(string fileId, RequestOptions options); |
| 2587 | public virtual Task<ClientResult<BinaryData>> DownloadFileAsync(string fileId, CancellationToken cancellationToken = default); |
| 2588 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2589 | public virtual ClientResult GetFile(string fileId, RequestOptions options); |
| 2590 | public virtual ClientResult<OpenAIFile> GetFile(string fileId, CancellationToken cancellationToken = default); |
| 2591 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2592 | public virtual Task<ClientResult> GetFileAsync(string fileId, RequestOptions options); |
| 2593 | public virtual Task<ClientResult<OpenAIFile>> GetFileAsync(string fileId, CancellationToken cancellationToken = default); |
| 2594 | public virtual ClientResult<OpenAIFileCollection> GetFiles(FilePurpose purpose, CancellationToken cancellationToken = default); |
| 2595 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2596 | public virtual ClientResult GetFiles(string purpose, RequestOptions options); |
| 2597 | public virtual ClientResult<OpenAIFileCollection> GetFiles(CancellationToken cancellationToken = default); |
| 2598 | public virtual Task<ClientResult<OpenAIFileCollection>> GetFilesAsync(FilePurpose purpose, CancellationToken cancellationToken = default); |
| 2599 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2600 | public virtual Task<ClientResult> GetFilesAsync(string purpose, RequestOptions options); |
| 2601 | public virtual Task<ClientResult<OpenAIFileCollection>> GetFilesAsync(CancellationToken cancellationToken = default); |
| 2602 | public virtual ClientResult<OpenAIFile> UploadFile(BinaryData file, string filename, FileUploadPurpose purpose); |
| 2603 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2604 | public virtual ClientResult UploadFile(BinaryContent content, string contentType, RequestOptions options = null); |
| 2605 | public virtual ClientResult<OpenAIFile> UploadFile(Stream file, string filename, FileUploadPurpose purpose, CancellationToken cancellationToken = default); |
| 2606 | public virtual ClientResult<OpenAIFile> UploadFile(string filePath, FileUploadPurpose purpose); |
| 2607 | public virtual Task<ClientResult<OpenAIFile>> UploadFileAsync(BinaryData file, string filename, FileUploadPurpose purpose); |
| 2608 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2609 | public virtual Task<ClientResult> UploadFileAsync(BinaryContent content, string contentType, RequestOptions options = null); |
| 2610 | public virtual Task<ClientResult<OpenAIFile>> UploadFileAsync(Stream file, string filename, FileUploadPurpose purpose, CancellationToken cancellationToken = default); |
| 2611 | public virtual Task<ClientResult<OpenAIFile>> UploadFileAsync(string filePath, FileUploadPurpose purpose); |
| 2612 | } |
| 2613 | public class OpenAIFileCollection : ObjectModel.ReadOnlyCollection<OpenAIFile>, IJsonModel<OpenAIFileCollection>, IPersistableModel<OpenAIFileCollection> { |
| 2614 | [Experimental("OPENAI001")] |
| 2615 | protected virtual OpenAIFileCollection JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2616 | [Experimental("OPENAI001")] |
| 2617 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2618 | [Experimental("OPENAI001")] |
| 2619 | protected virtual OpenAIFileCollection PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2620 | [Experimental("OPENAI001")] |
| 2621 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2622 | } |
| 2623 | public static class OpenAIFilesModelFactory { |
| 2624 | public static FileDeletionResult FileDeletionResult(string fileId = null, bool deleted = false); |
| 2625 | public static OpenAIFileCollection OpenAIFileCollection(IEnumerable<OpenAIFile> items = null); |
| 2626 | [Experimental("OPENAI001")] |
| 2627 | public static OpenAIFile OpenAIFileInfo(string id = null, int? sizeInBytes = null, DateTimeOffset createdAt = default, string filename = null, FilePurpose purpose = FilePurpose.Assistants, FileStatus status = FileStatus.Uploaded, string statusDetails = null, DateTimeOffset? expiresAt = null, long? sizeInBytesLong = null); |
| 2628 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2629 | public static OpenAIFile OpenAIFileInfo(string id, int? sizeInBytes, DateTimeOffset createdAt, string filename, FilePurpose purpose, FileStatus status, string statusDetails); |
| 2630 | } |
| 2631 | } |
| 2632 | namespace OpenAI.FineTuning { |
| 2633 | [Experimental("OPENAI001")] |
| 2634 | public class FineTuningCheckpoint : IJsonModel<FineTuningCheckpoint>, IPersistableModel<FineTuningCheckpoint> { |
| 2635 | public DateTimeOffset CreatedAt { get; } |
| 2636 | public string Id { get; } |
| 2637 | public string JobId { get; } |
| 2638 | public FineTuningCheckpointMetrics Metrics { get; } |
| 2639 | public string ModelId { get; } |
| 2640 | public int StepNumber { get; } |
| 2641 | [Experimental("OPENAI001")] |
| 2642 | protected virtual FineTuningCheckpoint JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2643 | [Experimental("OPENAI001")] |
| 2644 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2645 | [Experimental("OPENAI001")] |
| 2646 | protected virtual FineTuningCheckpoint PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2647 | [Experimental("OPENAI001")] |
| 2648 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2649 | public override string ToString(); |
| 2650 | } |
| 2651 | [Experimental("OPENAI001")] |
| 2652 | public class FineTuningCheckpointMetrics : IJsonModel<FineTuningCheckpointMetrics>, IPersistableModel<FineTuningCheckpointMetrics> { |
| 2653 | public float? FullValidLoss { get; } |
| 2654 | public float? FullValidMeanTokenAccuracy { get; } |
| 2655 | public int StepNumber { get; } |
| 2656 | public float? TrainLoss { get; } |
| 2657 | public float? TrainMeanTokenAccuracy { get; } |
| 2658 | public float? ValidLoss { get; } |
| 2659 | public float? ValidMeanTokenAccuracy { get; } |
| 2660 | [Experimental("OPENAI001")] |
| 2661 | protected virtual FineTuningCheckpointMetrics JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2662 | [Experimental("OPENAI001")] |
| 2663 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2664 | [Experimental("OPENAI001")] |
| 2665 | protected virtual FineTuningCheckpointMetrics PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2666 | [Experimental("OPENAI001")] |
| 2667 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2668 | } |
| 2669 | [Experimental("OPENAI001")] |
| 2670 | public class FineTuningClient { |
| 2671 | protected FineTuningClient(); |
| 2672 | public FineTuningClient(ApiKeyCredential credential, OpenAIClientOptions options); |
| 2673 | public FineTuningClient(ApiKeyCredential credential); |
| 2674 | protected internal FineTuningClient(ClientPipeline pipeline, OpenAIClientOptions options); |
| 2675 | protected internal FineTuningClient(ClientPipeline pipeline, Uri endpoint); |
| 2676 | public FineTuningClient(string apiKey); |
| 2677 | public ClientPipeline Pipeline { get; } |
| 2678 | public virtual ClientResult CreateFineTuningCheckpointPermission(string fineTunedModelCheckpoint, BinaryContent content, RequestOptions options = null); |
| 2679 | public virtual Task<ClientResult> CreateFineTuningCheckpointPermissionAsync(string fineTunedModelCheckpoint, BinaryContent content, RequestOptions options = null); |
| 2680 | public virtual ClientResult DeleteFineTuningCheckpointPermission(string fineTunedModelCheckpoint, string permissionId, RequestOptions options); |
| 2681 | public virtual Task<ClientResult> DeleteFineTuningCheckpointPermissionAsync(string fineTunedModelCheckpoint, string permissionId, RequestOptions options); |
| 2682 | public virtual FineTuningJob FineTune(BinaryContent content, bool waitUntilCompleted, RequestOptions options); |
| 2683 | public virtual FineTuningJob FineTune(string baseModel, string trainingFileId, bool waitUntilCompleted, FineTuningOptions options = null, CancellationToken cancellationToken = default); |
| 2684 | public virtual Task<FineTuningJob> FineTuneAsync(BinaryContent content, bool waitUntilCompleted, RequestOptions options); |
| 2685 | public virtual Task<FineTuningJob> FineTuneAsync(string baseModel, string trainingFileId, bool waitUntilCompleted, FineTuningOptions options = null, CancellationToken cancellationToken = default); |
| 2686 | public virtual ClientResult GetFineTuningCheckpointPermissions(string fineTunedModelCheckpoint, string after, int? limit, string order, string projectId, RequestOptions options); |
| 2687 | public virtual Task<ClientResult> GetFineTuningCheckpointPermissionsAsync(string fineTunedModelCheckpoint, string after, int? limit, string order, string projectId, RequestOptions options); |
| 2688 | public virtual FineTuningJob GetJob(string jobId, CancellationToken cancellationToken = default); |
| 2689 | public virtual Task<FineTuningJob> GetJobAsync(string jobId, CancellationToken cancellationToken = default); |
| 2690 | public virtual CollectionResult<FineTuningJob> GetJobs(FineTuningJobCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 2691 | public virtual AsyncCollectionResult<FineTuningJob> GetJobsAsync(FineTuningJobCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 2692 | public virtual ClientResult PauseFineTuningJob(string fineTuningJobId, RequestOptions options); |
| 2693 | public virtual Task<ClientResult> PauseFineTuningJobAsync(string fineTuningJobId, RequestOptions options); |
| 2694 | public virtual ClientResult ResumeFineTuningJob(string fineTuningJobId, RequestOptions options); |
| 2695 | public virtual Task<ClientResult> ResumeFineTuningJobAsync(string fineTuningJobId, RequestOptions options); |
| 2696 | } |
| 2697 | [Experimental("OPENAI001")] |
| 2698 | public class FineTuningError : IJsonModel<FineTuningError>, IPersistableModel<FineTuningError> { |
| 2699 | public string Code { get; } |
| 2700 | public string InvalidParameter { get; } |
| 2701 | public string Message { get; } |
| 2702 | [Experimental("OPENAI001")] |
| 2703 | protected virtual FineTuningError JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2704 | [Experimental("OPENAI001")] |
| 2705 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2706 | [Experimental("OPENAI001")] |
| 2707 | protected virtual FineTuningError PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2708 | [Experimental("OPENAI001")] |
| 2709 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2710 | } |
| 2711 | [Experimental("OPENAI001")] |
| 2712 | public class FineTuningEvent : IJsonModel<FineTuningEvent>, IPersistableModel<FineTuningEvent> { |
| 2713 | public string Level; |
| 2714 | public DateTimeOffset CreatedAt { get; } |
| 2715 | public BinaryData Data { get; } |
| 2716 | public string Id { get; } |
| 2717 | public FineTuningJobEventKind? Kind { get; } |
| 2718 | public string Message { get; } |
| 2719 | [Experimental("OPENAI001")] |
| 2720 | protected virtual FineTuningEvent JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2721 | [Experimental("OPENAI001")] |
| 2722 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2723 | [Experimental("OPENAI001")] |
| 2724 | protected virtual FineTuningEvent PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2725 | [Experimental("OPENAI001")] |
| 2726 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2727 | } |
| 2728 | [Experimental("OPENAI001")] |
| 2729 | public readonly partial struct FineTuningHyperparameters : IJsonModel<FineTuningHyperparameters>, IPersistableModel<FineTuningHyperparameters>, IJsonModel<object>, IPersistableModel<object> { |
| 2730 | public int BatchSize { get; } |
| 2731 | public int EpochCount { get; } |
| 2732 | public float LearningRateMultiplier { get; } |
| 2733 | } |
| 2734 | [Experimental("OPENAI001")] |
| 2735 | public class FineTuningIntegration : IJsonModel<FineTuningIntegration>, IPersistableModel<FineTuningIntegration> { |
| 2736 | [Experimental("OPENAI001")] |
| 2737 | protected virtual FineTuningIntegration JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2738 | [Experimental("OPENAI001")] |
| 2739 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2740 | [Experimental("OPENAI001")] |
| 2741 | protected virtual FineTuningIntegration PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2742 | [Experimental("OPENAI001")] |
| 2743 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2744 | } |
| 2745 | [Experimental("OPENAI001")] |
| 2746 | public class FineTuningJob : OperationResult { |
| 2747 | public string? Value; |
| 2748 | public string BaseModel { get; } |
| 2749 | public int BillableTrainedTokenCount { get; } |
| 2750 | public DateTimeOffset? EstimatedFinishAt { get; } |
| 2751 | [Obsolete("This property is deprecated. Use the MethodHyperparameters property instead.")] |
| 2752 | public FineTuningHyperparameters Hyperparameters { get; } |
| 2753 | public IReadOnlyList<FineTuningIntegration> Integrations { get; } |
| 2754 | public string JobId { get; } |
| 2755 | public IDictionary<string, string> Metadata { get; } |
| 2756 | public MethodHyperparameters? MethodHyperparameters { get; } |
| 2757 | public override ContinuationToken? RehydrationToken { get; protected set; } |
| 2758 | public IReadOnlyList<string> ResultFileIds { get; } |
| 2759 | public int? Seed { get; } |
| 2760 | public FineTuningStatus Status { get; } |
| 2761 | public string TrainingFileId { get; } |
| 2762 | public FineTuningTrainingMethod? TrainingMethod { get; } |
| 2763 | public string? UserProvidedSuffix { get; } |
| 2764 | public string ValidationFileId { get; } |
| 2765 | public virtual ClientResult Cancel(RequestOptions options); |
| 2766 | public virtual ClientResult CancelAndUpdate(CancellationToken cancellationToken = default); |
| 2767 | public virtual Task<ClientResult> CancelAndUpdateAsync(CancellationToken cancellationToken = default); |
| 2768 | public virtual Task<ClientResult> CancelAsync(RequestOptions options); |
| 2769 | public virtual CollectionResult<FineTuningCheckpoint> GetCheckpoints(GetCheckpointsOptions? options = null, CancellationToken cancellationToken = default); |
| 2770 | public virtual CollectionResult GetCheckpoints(string? after, int? limit, RequestOptions? options); |
| 2771 | public virtual AsyncCollectionResult<FineTuningCheckpoint> GetCheckpointsAsync(GetCheckpointsOptions? options = null, CancellationToken cancellationToken = default); |
| 2772 | public virtual AsyncCollectionResult GetCheckpointsAsync(string? after, int? limit, RequestOptions? options); |
| 2773 | public virtual CollectionResult<FineTuningEvent> GetEvents(GetEventsOptions options, CancellationToken cancellationToken = default); |
| 2774 | public virtual CollectionResult GetEvents(string? after, int? limit, RequestOptions options); |
| 2775 | public virtual AsyncCollectionResult<FineTuningEvent> GetEventsAsync(GetEventsOptions options, CancellationToken cancellationToken = default); |
| 2776 | public virtual AsyncCollectionResult GetEventsAsync(string? after, int? limit, RequestOptions options); |
| 2777 | public static FineTuningJob Rehydrate(FineTuningClient client, ContinuationToken rehydrationToken, RequestOptions options); |
| 2778 | public static FineTuningJob Rehydrate(FineTuningClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default); |
| 2779 | public static FineTuningJob Rehydrate(FineTuningClient client, string JobId, RequestOptions options); |
| 2780 | public static FineTuningJob Rehydrate(FineTuningClient client, string JobId, CancellationToken cancellationToken = default); |
| 2781 | public static Task<FineTuningJob> RehydrateAsync(FineTuningClient client, ContinuationToken rehydrationToken, RequestOptions options); |
| 2782 | public static Task<FineTuningJob> RehydrateAsync(FineTuningClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default); |
| 2783 | public static Task<FineTuningJob> RehydrateAsync(FineTuningClient client, string JobId, RequestOptions options); |
| 2784 | public static Task<FineTuningJob> RehydrateAsync(FineTuningClient client, string JobId, CancellationToken cancellationToken = default); |
| 2785 | public override ClientResult UpdateStatus(RequestOptions? options); |
| 2786 | public ClientResult UpdateStatus(CancellationToken cancellationToken = default); |
| 2787 | public override ValueTask<ClientResult> UpdateStatusAsync(RequestOptions? options); |
| 2788 | public ValueTask<ClientResult> UpdateStatusAsync(CancellationToken cancellationToken = default); |
| 2789 | public override void WaitForCompletion(CancellationToken cancellationToken = default); |
| 2790 | public override ValueTask WaitForCompletionAsync(CancellationToken cancellationToken = default); |
| 2791 | } |
| 2792 | [Experimental("OPENAI001")] |
| 2793 | public class FineTuningJobCollectionOptions { |
| 2794 | public string AfterJobId { get; set; } |
| 2795 | public int? PageSize { get; set; } |
| 2796 | } |
| 2797 | [Experimental("OPENAI001")] |
| 2798 | public readonly partial struct FineTuningJobEventKind : IEquatable<FineTuningJobEventKind> { |
| 2799 | public FineTuningJobEventKind(string value); |
| 2800 | public static FineTuningJobEventKind Message { get; } |
| 2801 | public static FineTuningJobEventKind Metrics { get; } |
| 2802 | public readonly bool Equals(FineTuningJobEventKind other); |
| 2803 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2804 | public override readonly bool Equals(object obj); |
| 2805 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2806 | public override readonly int GetHashCode(); |
| 2807 | public static bool operator ==(FineTuningJobEventKind left, FineTuningJobEventKind right); |
| 2808 | public static implicit operator FineTuningJobEventKind(string value); |
| 2809 | public static bool operator !=(FineTuningJobEventKind left, FineTuningJobEventKind right); |
| 2810 | public override readonly string ToString(); |
| 2811 | } |
| 2812 | [Experimental("OPENAI001")] |
| 2813 | public class FineTuningOptions : IJsonModel<FineTuningOptions>, IPersistableModel<FineTuningOptions> { |
| 2814 | public IList<FineTuningIntegration> Integrations { get; } |
| 2815 | public IDictionary<string, string> Metadata { get; } |
| 2816 | public int? Seed { get; set; } |
| 2817 | public string Suffix { get; set; } |
| 2818 | public FineTuningTrainingMethod TrainingMethod { get; set; } |
| 2819 | public string ValidationFile { get; set; } |
| 2820 | [Experimental("OPENAI001")] |
| 2821 | protected virtual FineTuningOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2822 | [Experimental("OPENAI001")] |
| 2823 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2824 | [Experimental("OPENAI001")] |
| 2825 | protected virtual FineTuningOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2826 | [Experimental("OPENAI001")] |
| 2827 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2828 | } |
| 2829 | [Experimental("OPENAI001")] |
| 2830 | public readonly partial struct FineTuningStatus : IEquatable<string>, IEquatable<FineTuningStatus> { |
| 2831 | public FineTuningStatus(string value); |
| 2832 | public static FineTuningStatus Cancelled { get; } |
| 2833 | public static FineTuningStatus Failed { get; } |
| 2834 | public bool InProgress { get; } |
| 2835 | public static FineTuningStatus Queued { get; } |
| 2836 | public static FineTuningStatus Running { get; } |
| 2837 | public static FineTuningStatus Succeeded { get; } |
| 2838 | public static FineTuningStatus ValidatingFiles { get; } |
| 2839 | public readonly bool Equals(FineTuningStatus other); |
| 2840 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2841 | public override readonly bool Equals(object obj); |
| 2842 | public readonly bool Equals(string other); |
| 2843 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2844 | public override readonly int GetHashCode(); |
| 2845 | public static bool operator ==(FineTuningStatus left, FineTuningStatus right); |
| 2846 | public static implicit operator FineTuningStatus(string value); |
| 2847 | public static bool operator !=(FineTuningStatus left, FineTuningStatus right); |
| 2848 | public override readonly string ToString(); |
| 2849 | } |
| 2850 | [Experimental("OPENAI001")] |
| 2851 | public class FineTuningTrainingMethod : IJsonModel<FineTuningTrainingMethod>, IPersistableModel<FineTuningTrainingMethod> { |
| 2852 | public static FineTuningTrainingMethod CreateDirectPreferenceOptimization(HyperparameterBatchSize batchSize = null, HyperparameterEpochCount epochCount = null, HyperparameterLearningRate learningRate = null, HyperparameterBetaFactor betaFactor = null); |
| 2853 | public static FineTuningTrainingMethod CreateSupervised(HyperparameterBatchSize batchSize = null, HyperparameterEpochCount epochCount = null, HyperparameterLearningRate learningRate = null); |
| 2854 | [Experimental("OPENAI001")] |
| 2855 | protected virtual FineTuningTrainingMethod JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2856 | [Experimental("OPENAI001")] |
| 2857 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2858 | [Experimental("OPENAI001")] |
| 2859 | protected virtual FineTuningTrainingMethod PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2860 | [Experimental("OPENAI001")] |
| 2861 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2862 | } |
| 2863 | [Experimental("OPENAI001")] |
| 2864 | public class GetCheckpointsOptions { |
| 2865 | public string AfterCheckpointId { get; set; } |
| 2866 | public int? PageSize { get; set; } |
| 2867 | } |
| 2868 | [Experimental("OPENAI001")] |
| 2869 | public class GetEventsOptions { |
| 2870 | public string AfterEventId { get; set; } |
| 2871 | public int? PageSize { get; set; } |
| 2872 | } |
| 2873 | [Experimental("OPENAI001")] |
| 2874 | public class HyperparameterBatchSize : IEquatable<int>, IEquatable<string>, IJsonModel<HyperparameterBatchSize>, IPersistableModel<HyperparameterBatchSize> { |
| 2875 | public HyperparameterBatchSize(int batchSize); |
| 2876 | public static HyperparameterBatchSize CreateAuto(); |
| 2877 | public static HyperparameterBatchSize CreateSize(int batchSize); |
| 2878 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2879 | public bool Equals(int other); |
| 2880 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2881 | public override bool Equals(object other); |
| 2882 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2883 | public bool Equals(string other); |
| 2884 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2885 | public override int GetHashCode(); |
| 2886 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2887 | public static bool operator ==(HyperparameterBatchSize first, HyperparameterBatchSize second); |
| 2888 | public static implicit operator HyperparameterBatchSize(int batchSize); |
| 2889 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2890 | public static bool operator !=(HyperparameterBatchSize first, HyperparameterBatchSize second); |
| 2891 | } |
| 2892 | [Experimental("OPENAI001")] |
| 2893 | public class HyperparameterBetaFactor : IEquatable<int>, IEquatable<string>, IJsonModel<HyperparameterBetaFactor>, IPersistableModel<HyperparameterBetaFactor> { |
| 2894 | public HyperparameterBetaFactor(int beta); |
| 2895 | public static HyperparameterBetaFactor CreateAuto(); |
| 2896 | public static HyperparameterBetaFactor CreateBeta(int beta); |
| 2897 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2898 | public bool Equals(int other); |
| 2899 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2900 | public override bool Equals(object other); |
| 2901 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2902 | public bool Equals(string other); |
| 2903 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2904 | public override int GetHashCode(); |
| 2905 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2906 | public static bool operator ==(HyperparameterBetaFactor first, HyperparameterBetaFactor second); |
| 2907 | public static implicit operator HyperparameterBetaFactor(int beta); |
| 2908 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2909 | public static bool operator !=(HyperparameterBetaFactor first, HyperparameterBetaFactor second); |
| 2910 | } |
| 2911 | [Experimental("OPENAI001")] |
| 2912 | public class HyperparameterEpochCount : IEquatable<int>, IEquatable<string>, IJsonModel<HyperparameterEpochCount>, IPersistableModel<HyperparameterEpochCount> { |
| 2913 | public HyperparameterEpochCount(int epochCount); |
| 2914 | public static HyperparameterEpochCount CreateAuto(); |
| 2915 | public static HyperparameterEpochCount CreateEpochCount(int epochCount); |
| 2916 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2917 | public bool Equals(int other); |
| 2918 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2919 | public override bool Equals(object other); |
| 2920 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2921 | public bool Equals(string other); |
| 2922 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2923 | public override int GetHashCode(); |
| 2924 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2925 | public static bool operator ==(HyperparameterEpochCount first, HyperparameterEpochCount second); |
| 2926 | public static implicit operator HyperparameterEpochCount(int epochCount); |
| 2927 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2928 | public static bool operator !=(HyperparameterEpochCount first, HyperparameterEpochCount second); |
| 2929 | } |
| 2930 | [Experimental("OPENAI001")] |
| 2931 | public class HyperparameterLearningRate : IEquatable<double>, IEquatable<int>, IEquatable<string>, IJsonModel<HyperparameterLearningRate>, IPersistableModel<HyperparameterLearningRate> { |
| 2932 | public HyperparameterLearningRate(double learningRateMultiplier); |
| 2933 | public static HyperparameterLearningRate CreateAuto(); |
| 2934 | public static HyperparameterLearningRate CreateMultiplier(double learningRateMultiplier); |
| 2935 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2936 | public bool Equals(double other); |
| 2937 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2938 | public bool Equals(int other); |
| 2939 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2940 | public override bool Equals(object other); |
| 2941 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2942 | public bool Equals(string other); |
| 2943 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2944 | public override int GetHashCode(); |
| 2945 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2946 | public static bool operator ==(HyperparameterLearningRate first, HyperparameterLearningRate second); |
| 2947 | public static implicit operator HyperparameterLearningRate(double learningRateMultiplier); |
| 2948 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 2949 | public static bool operator !=(HyperparameterLearningRate first, HyperparameterLearningRate second); |
| 2950 | } |
| 2951 | [Experimental("OPENAI001")] |
| 2952 | public class HyperparametersForDPO : MethodHyperparameters, IJsonModel<HyperparametersForDPO>, IPersistableModel<HyperparametersForDPO> { |
| 2953 | public int BatchSize { get; } |
| 2954 | public float Beta { get; } |
| 2955 | public int EpochCount { get; } |
| 2956 | public float LearningRateMultiplier { get; } |
| 2957 | [Experimental("OPENAI001")] |
| 2958 | protected virtual HyperparametersForDPO JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2959 | [Experimental("OPENAI001")] |
| 2960 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2961 | [Experimental("OPENAI001")] |
| 2962 | protected virtual HyperparametersForDPO PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2963 | [Experimental("OPENAI001")] |
| 2964 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2965 | } |
| 2966 | [Experimental("OPENAI001")] |
| 2967 | public class HyperparametersForSupervised : MethodHyperparameters, IJsonModel<HyperparametersForSupervised>, IPersistableModel<HyperparametersForSupervised> { |
| 2968 | public int BatchSize { get; } |
| 2969 | public int EpochCount { get; } |
| 2970 | public float LearningRateMultiplier { get; } |
| 2971 | [Experimental("OPENAI001")] |
| 2972 | protected virtual HyperparametersForSupervised JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2973 | [Experimental("OPENAI001")] |
| 2974 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2975 | [Experimental("OPENAI001")] |
| 2976 | protected virtual HyperparametersForSupervised PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2977 | [Experimental("OPENAI001")] |
| 2978 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2979 | } |
| 2980 | [Experimental("OPENAI001")] |
| 2981 | public class MethodHyperparameters { |
| 2982 | } |
| 2983 | [Experimental("OPENAI001")] |
| 2984 | public class WeightsAndBiasesIntegration : FineTuningIntegration, IJsonModel<WeightsAndBiasesIntegration>, IPersistableModel<WeightsAndBiasesIntegration> { |
| 2985 | public WeightsAndBiasesIntegration(string projectName); |
| 2986 | public string DisplayName { get; set; } |
| 2987 | public string EntityName { get; set; } |
| 2988 | public string ProjectName { get; set; } |
| 2989 | public IList<string> Tags { get; } |
| 2990 | [Experimental("OPENAI001")] |
| 2991 | protected override FineTuningIntegration JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 2992 | [Experimental("OPENAI001")] |
| 2993 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 2994 | [Experimental("OPENAI001")] |
| 2995 | protected override FineTuningIntegration PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 2996 | [Experimental("OPENAI001")] |
| 2997 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 2998 | } |
| 2999 | } |
| 3000 | namespace OpenAI.Images { |
| 3001 | public class GeneratedImage : IJsonModel<GeneratedImage>, IPersistableModel<GeneratedImage> { |
| 3002 | public BinaryData ImageBytes { get; } |
| 3003 | public Uri ImageUri { get; } |
| 3004 | public string RevisedPrompt { get; } |
| 3005 | [Experimental("OPENAI001")] |
| 3006 | protected virtual GeneratedImage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3007 | [Experimental("OPENAI001")] |
| 3008 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3009 | [Experimental("OPENAI001")] |
| 3010 | protected virtual GeneratedImage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3011 | [Experimental("OPENAI001")] |
| 3012 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3013 | } |
| 3014 | [Experimental("OPENAI001")] |
| 3015 | public readonly partial struct GeneratedImageBackground : IEquatable<GeneratedImageBackground> { |
| 3016 | public GeneratedImageBackground(string value); |
| 3017 | public static GeneratedImageBackground Auto { get; } |
| 3018 | public static GeneratedImageBackground Opaque { get; } |
| 3019 | public static GeneratedImageBackground Transparent { get; } |
| 3020 | public readonly bool Equals(GeneratedImageBackground other); |
| 3021 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3022 | public override readonly bool Equals(object obj); |
| 3023 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3024 | public override readonly int GetHashCode(); |
| 3025 | public static bool operator ==(GeneratedImageBackground left, GeneratedImageBackground right); |
| 3026 | public static implicit operator GeneratedImageBackground(string value); |
| 3027 | public static bool operator !=(GeneratedImageBackground left, GeneratedImageBackground right); |
| 3028 | public override readonly string ToString(); |
| 3029 | } |
| 3030 | public class GeneratedImageCollection : ObjectModel.ReadOnlyCollection<GeneratedImage>, IJsonModel<GeneratedImageCollection>, IPersistableModel<GeneratedImageCollection> { |
| 3031 | public DateTimeOffset CreatedAt { get; } |
| 3032 | [Experimental("OPENAI001")] |
| 3033 | public ImageTokenUsage Usage { get; } |
| 3034 | [Experimental("OPENAI001")] |
| 3035 | protected virtual GeneratedImageCollection JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3036 | [Experimental("OPENAI001")] |
| 3037 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3038 | [Experimental("OPENAI001")] |
| 3039 | protected virtual GeneratedImageCollection PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3040 | [Experimental("OPENAI001")] |
| 3041 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3042 | } |
| 3043 | [Experimental("OPENAI001")] |
| 3044 | public readonly partial struct GeneratedImageFileFormat : IEquatable<GeneratedImageFileFormat> { |
| 3045 | public GeneratedImageFileFormat(string value); |
| 3046 | public static GeneratedImageFileFormat Jpeg { get; } |
| 3047 | public static GeneratedImageFileFormat Png { get; } |
| 3048 | public static GeneratedImageFileFormat Webp { get; } |
| 3049 | public readonly bool Equals(GeneratedImageFileFormat other); |
| 3050 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3051 | public override readonly bool Equals(object obj); |
| 3052 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3053 | public override readonly int GetHashCode(); |
| 3054 | public static bool operator ==(GeneratedImageFileFormat left, GeneratedImageFileFormat right); |
| 3055 | public static implicit operator GeneratedImageFileFormat(string value); |
| 3056 | public static bool operator !=(GeneratedImageFileFormat left, GeneratedImageFileFormat right); |
| 3057 | public override readonly string ToString(); |
| 3058 | } |
| 3059 | public readonly partial struct GeneratedImageFormat : IEquatable<GeneratedImageFormat> { |
| 3060 | public GeneratedImageFormat(string value); |
| 3061 | public static GeneratedImageFormat Bytes { get; } |
| 3062 | public static GeneratedImageFormat Uri { get; } |
| 3063 | public readonly bool Equals(GeneratedImageFormat other); |
| 3064 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3065 | public override readonly bool Equals(object obj); |
| 3066 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3067 | public override readonly int GetHashCode(); |
| 3068 | public static bool operator ==(GeneratedImageFormat left, GeneratedImageFormat right); |
| 3069 | public static implicit operator GeneratedImageFormat(string value); |
| 3070 | public static bool operator !=(GeneratedImageFormat left, GeneratedImageFormat right); |
| 3071 | public override readonly string ToString(); |
| 3072 | } |
| 3073 | [Experimental("OPENAI001")] |
| 3074 | public readonly partial struct GeneratedImageModerationLevel : IEquatable<GeneratedImageModerationLevel> { |
| 3075 | public GeneratedImageModerationLevel(string value); |
| 3076 | public static GeneratedImageModerationLevel Auto { get; } |
| 3077 | public static GeneratedImageModerationLevel Low { get; } |
| 3078 | public readonly bool Equals(GeneratedImageModerationLevel other); |
| 3079 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3080 | public override readonly bool Equals(object obj); |
| 3081 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3082 | public override readonly int GetHashCode(); |
| 3083 | public static bool operator ==(GeneratedImageModerationLevel left, GeneratedImageModerationLevel right); |
| 3084 | public static implicit operator GeneratedImageModerationLevel(string value); |
| 3085 | public static bool operator !=(GeneratedImageModerationLevel left, GeneratedImageModerationLevel right); |
| 3086 | public override readonly string ToString(); |
| 3087 | } |
| 3088 | public readonly partial struct GeneratedImageQuality : IEquatable<GeneratedImageQuality> { |
| 3089 | public GeneratedImageQuality(string value); |
| 3090 | [Experimental("OPENAI001")] |
| 3091 | public static GeneratedImageQuality Auto { get; } |
| 3092 | public static GeneratedImageQuality High { get; } |
| 3093 | [Experimental("OPENAI001")] |
| 3094 | public static GeneratedImageQuality Low { get; } |
| 3095 | [Experimental("OPENAI001")] |
| 3096 | public static GeneratedImageQuality Medium { get; } |
| 3097 | public static GeneratedImageQuality Standard { get; } |
| 3098 | public readonly bool Equals(GeneratedImageQuality other); |
| 3099 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3100 | public override readonly bool Equals(object obj); |
| 3101 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3102 | public override readonly int GetHashCode(); |
| 3103 | public static bool operator ==(GeneratedImageQuality left, GeneratedImageQuality right); |
| 3104 | public static implicit operator GeneratedImageQuality(string value); |
| 3105 | public static bool operator !=(GeneratedImageQuality left, GeneratedImageQuality right); |
| 3106 | public override readonly string ToString(); |
| 3107 | } |
| 3108 | public readonly partial struct GeneratedImageSize : IEquatable<GeneratedImageSize> { |
| 3109 | public static readonly GeneratedImageSize W1024xH1024; |
| 3110 | [Experimental("OPENAI001")] |
| 3111 | public static readonly GeneratedImageSize W1024xH1536; |
| 3112 | public static readonly GeneratedImageSize W1024xH1792; |
| 3113 | [Experimental("OPENAI001")] |
| 3114 | public static readonly GeneratedImageSize W1536xH1024; |
| 3115 | public static readonly GeneratedImageSize W1792xH1024; |
| 3116 | public static readonly GeneratedImageSize W256xH256; |
| 3117 | public static readonly GeneratedImageSize W512xH512; |
| 3118 | public GeneratedImageSize(int width, int height); |
| 3119 | [Experimental("OPENAI001")] |
| 3120 | public static GeneratedImageSize Auto { get; } |
| 3121 | public readonly bool Equals(GeneratedImageSize other); |
| 3122 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3123 | public override readonly bool Equals(object obj); |
| 3124 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3125 | public override readonly int GetHashCode(); |
| 3126 | public static bool operator ==(GeneratedImageSize left, GeneratedImageSize right); |
| 3127 | public static bool operator !=(GeneratedImageSize left, GeneratedImageSize right); |
| 3128 | public override readonly string ToString(); |
| 3129 | } |
| 3130 | public readonly partial struct GeneratedImageStyle : IEquatable<GeneratedImageStyle> { |
| 3131 | public GeneratedImageStyle(string value); |
| 3132 | public static GeneratedImageStyle Natural { get; } |
| 3133 | public static GeneratedImageStyle Vivid { get; } |
| 3134 | public readonly bool Equals(GeneratedImageStyle other); |
| 3135 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3136 | public override readonly bool Equals(object obj); |
| 3137 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3138 | public override readonly int GetHashCode(); |
| 3139 | public static bool operator ==(GeneratedImageStyle left, GeneratedImageStyle right); |
| 3140 | public static implicit operator GeneratedImageStyle(string value); |
| 3141 | public static bool operator !=(GeneratedImageStyle left, GeneratedImageStyle right); |
| 3142 | public override readonly string ToString(); |
| 3143 | } |
| 3144 | public class ImageClient { |
| 3145 | protected ImageClient(); |
| 3146 | protected internal ImageClient(ClientPipeline pipeline, string model, OpenAIClientOptions options); |
| 3147 | public ImageClient(string model, ApiKeyCredential credential, OpenAIClientOptions options); |
| 3148 | public ImageClient(string model, ApiKeyCredential credential); |
| 3149 | public ImageClient(string model, string apiKey); |
| 3150 | public ClientPipeline Pipeline { get; } |
| 3151 | public virtual ClientResult<GeneratedImage> GenerateImage(string prompt, ImageGenerationOptions options = null, CancellationToken cancellationToken = default); |
| 3152 | public virtual Task<ClientResult<GeneratedImage>> GenerateImageAsync(string prompt, ImageGenerationOptions options = null, CancellationToken cancellationToken = default); |
| 3153 | public virtual ClientResult<GeneratedImage> GenerateImageEdit(Stream image, string imageFilename, string prompt, ImageEditOptions options = null, CancellationToken cancellationToken = default); |
| 3154 | public virtual ClientResult<GeneratedImage> GenerateImageEdit(Stream image, string imageFilename, string prompt, Stream mask, string maskFilename, ImageEditOptions options = null, CancellationToken cancellationToken = default); |
| 3155 | public virtual ClientResult<GeneratedImage> GenerateImageEdit(string imageFilePath, string prompt, ImageEditOptions options = null); |
| 3156 | public virtual ClientResult<GeneratedImage> GenerateImageEdit(string imageFilePath, string prompt, string maskFilePath, ImageEditOptions options = null); |
| 3157 | public virtual Task<ClientResult<GeneratedImage>> GenerateImageEditAsync(Stream image, string imageFilename, string prompt, ImageEditOptions options = null, CancellationToken cancellationToken = default); |
| 3158 | public virtual Task<ClientResult<GeneratedImage>> GenerateImageEditAsync(Stream image, string imageFilename, string prompt, Stream mask, string maskFilename, ImageEditOptions options = null, CancellationToken cancellationToken = default); |
| 3159 | public virtual Task<ClientResult<GeneratedImage>> GenerateImageEditAsync(string imageFilePath, string prompt, ImageEditOptions options = null); |
| 3160 | public virtual Task<ClientResult<GeneratedImage>> GenerateImageEditAsync(string imageFilePath, string prompt, string maskFilePath, ImageEditOptions options = null); |
| 3161 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3162 | public virtual ClientResult GenerateImageEdits(BinaryContent content, string contentType, RequestOptions options = null); |
| 3163 | public virtual ClientResult<GeneratedImageCollection> GenerateImageEdits(Stream image, string imageFilename, string prompt, int imageCount, ImageEditOptions options = null, CancellationToken cancellationToken = default); |
| 3164 | public virtual ClientResult<GeneratedImageCollection> GenerateImageEdits(Stream image, string imageFilename, string prompt, Stream mask, string maskFilename, int imageCount, ImageEditOptions options = null, CancellationToken cancellationToken = default); |
| 3165 | public virtual ClientResult<GeneratedImageCollection> GenerateImageEdits(string imageFilePath, string prompt, int imageCount, ImageEditOptions options = null); |
| 3166 | public virtual ClientResult<GeneratedImageCollection> GenerateImageEdits(string imageFilePath, string prompt, string maskFilePath, int imageCount, ImageEditOptions options = null); |
| 3167 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3168 | public virtual Task<ClientResult> GenerateImageEditsAsync(BinaryContent content, string contentType, RequestOptions options = null); |
| 3169 | public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImageEditsAsync(Stream image, string imageFilename, string prompt, int imageCount, ImageEditOptions options = null, CancellationToken cancellationToken = default); |
| 3170 | public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImageEditsAsync(Stream image, string imageFilename, string prompt, Stream mask, string maskFilename, int imageCount, ImageEditOptions options = null, CancellationToken cancellationToken = default); |
| 3171 | public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImageEditsAsync(string imageFilePath, string prompt, int imageCount, ImageEditOptions options = null); |
| 3172 | public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImageEditsAsync(string imageFilePath, string prompt, string maskFilePath, int imageCount, ImageEditOptions options = null); |
| 3173 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3174 | public virtual ClientResult GenerateImages(BinaryContent content, RequestOptions options = null); |
| 3175 | public virtual ClientResult<GeneratedImageCollection> GenerateImages(string prompt, int imageCount, ImageGenerationOptions options = null, CancellationToken cancellationToken = default); |
| 3176 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3177 | public virtual Task<ClientResult> GenerateImagesAsync(BinaryContent content, RequestOptions options = null); |
| 3178 | public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImagesAsync(string prompt, int imageCount, ImageGenerationOptions options = null, CancellationToken cancellationToken = default); |
| 3179 | public virtual ClientResult<GeneratedImage> GenerateImageVariation(Stream image, string imageFilename, ImageVariationOptions options = null, CancellationToken cancellationToken = default); |
| 3180 | public virtual ClientResult<GeneratedImage> GenerateImageVariation(string imageFilePath, ImageVariationOptions options = null); |
| 3181 | public virtual Task<ClientResult<GeneratedImage>> GenerateImageVariationAsync(Stream image, string imageFilename, ImageVariationOptions options = null, CancellationToken cancellationToken = default); |
| 3182 | public virtual Task<ClientResult<GeneratedImage>> GenerateImageVariationAsync(string imageFilePath, ImageVariationOptions options = null); |
| 3183 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3184 | public virtual ClientResult GenerateImageVariations(BinaryContent content, string contentType, RequestOptions options = null); |
| 3185 | public virtual ClientResult<GeneratedImageCollection> GenerateImageVariations(Stream image, string imageFilename, int imageCount, ImageVariationOptions options = null, CancellationToken cancellationToken = default); |
| 3186 | public virtual ClientResult<GeneratedImageCollection> GenerateImageVariations(string imageFilePath, int imageCount, ImageVariationOptions options = null); |
| 3187 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3188 | public virtual Task<ClientResult> GenerateImageVariationsAsync(BinaryContent content, string contentType, RequestOptions options = null); |
| 3189 | public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImageVariationsAsync(Stream image, string imageFilename, int imageCount, ImageVariationOptions options = null, CancellationToken cancellationToken = default); |
| 3190 | public virtual Task<ClientResult<GeneratedImageCollection>> GenerateImageVariationsAsync(string imageFilePath, int imageCount, ImageVariationOptions options = null); |
| 3191 | } |
| 3192 | public class ImageEditOptions : IJsonModel<ImageEditOptions>, IPersistableModel<ImageEditOptions> { |
| 3193 | public string EndUserId { get; set; } |
| 3194 | public GeneratedImageFormat? ResponseFormat { get; set; } |
| 3195 | public GeneratedImageSize? Size { get; set; } |
| 3196 | [Experimental("OPENAI001")] |
| 3197 | protected virtual ImageEditOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3198 | [Experimental("OPENAI001")] |
| 3199 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3200 | [Experimental("OPENAI001")] |
| 3201 | protected virtual ImageEditOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3202 | [Experimental("OPENAI001")] |
| 3203 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3204 | } |
| 3205 | public class ImageGenerationOptions : IJsonModel<ImageGenerationOptions>, IPersistableModel<ImageGenerationOptions> { |
| 3206 | [Experimental("OPENAI001")] |
| 3207 | public GeneratedImageBackground? Background { get; set; } |
| 3208 | public string EndUserId { get; set; } |
| 3209 | [Experimental("OPENAI001")] |
| 3210 | public GeneratedImageModerationLevel? ModerationLevel { get; set; } |
| 3211 | [Experimental("OPENAI001")] |
| 3212 | public int? OutputCompressionFactor { get; set; } |
| 3213 | [Experimental("OPENAI001")] |
| 3214 | public GeneratedImageFileFormat? OutputFileFormat { get; set; } |
| 3215 | public GeneratedImageQuality? Quality { get; set; } |
| 3216 | public GeneratedImageFormat? ResponseFormat { get; set; } |
| 3217 | public GeneratedImageSize? Size { get; set; } |
| 3218 | public GeneratedImageStyle? Style { get; set; } |
| 3219 | [Experimental("OPENAI001")] |
| 3220 | protected virtual ImageGenerationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3221 | [Experimental("OPENAI001")] |
| 3222 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3223 | [Experimental("OPENAI001")] |
| 3224 | protected virtual ImageGenerationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3225 | [Experimental("OPENAI001")] |
| 3226 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3227 | } |
| 3228 | [Experimental("OPENAI001")] |
| 3229 | public class ImageInputTokenUsageDetails : IJsonModel<ImageInputTokenUsageDetails>, IPersistableModel<ImageInputTokenUsageDetails> { |
| 3230 | public int ImageTokenCount { get; } |
| 3231 | public int TextTokenCount { get; } |
| 3232 | [Experimental("OPENAI001")] |
| 3233 | protected virtual ImageInputTokenUsageDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3234 | [Experimental("OPENAI001")] |
| 3235 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3236 | [Experimental("OPENAI001")] |
| 3237 | protected virtual ImageInputTokenUsageDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3238 | [Experimental("OPENAI001")] |
| 3239 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3240 | } |
| 3241 | [Experimental("OPENAI001")] |
| 3242 | public class ImageTokenUsage : IJsonModel<ImageTokenUsage>, IPersistableModel<ImageTokenUsage> { |
| 3243 | public int InputTokenCount { get; } |
| 3244 | public ImageInputTokenUsageDetails InputTokenDetails { get; } |
| 3245 | public int OutputTokenCount { get; } |
| 3246 | public int TotalTokenCount { get; } |
| 3247 | [Experimental("OPENAI001")] |
| 3248 | protected virtual ImageTokenUsage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3249 | [Experimental("OPENAI001")] |
| 3250 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3251 | [Experimental("OPENAI001")] |
| 3252 | protected virtual ImageTokenUsage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3253 | [Experimental("OPENAI001")] |
| 3254 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3255 | } |
| 3256 | public class ImageVariationOptions : IJsonModel<ImageVariationOptions>, IPersistableModel<ImageVariationOptions> { |
| 3257 | public string EndUserId { get; set; } |
| 3258 | public GeneratedImageFormat? ResponseFormat { get; set; } |
| 3259 | public GeneratedImageSize? Size { get; set; } |
| 3260 | [Experimental("OPENAI001")] |
| 3261 | protected virtual ImageVariationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3262 | [Experimental("OPENAI001")] |
| 3263 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3264 | [Experimental("OPENAI001")] |
| 3265 | protected virtual ImageVariationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3266 | [Experimental("OPENAI001")] |
| 3267 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3268 | } |
| 3269 | public static class OpenAIImagesModelFactory { |
| 3270 | public static GeneratedImage GeneratedImage(BinaryData imageBytes = null, Uri imageUri = null, string revisedPrompt = null); |
| 3271 | [Experimental("OPENAI001")] |
| 3272 | public static GeneratedImageCollection GeneratedImageCollection(DateTimeOffset createdAt = default, IEnumerable<GeneratedImage> items = null, ImageTokenUsage usage = null); |
| 3273 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3274 | public static GeneratedImageCollection GeneratedImageCollection(DateTimeOffset createdAt, IEnumerable<GeneratedImage> items); |
| 3275 | } |
| 3276 | } |
| 3277 | namespace OpenAI.Models { |
| 3278 | public class ModelDeletionResult : IJsonModel<ModelDeletionResult>, IPersistableModel<ModelDeletionResult> { |
| 3279 | public bool Deleted { get; } |
| 3280 | public string ModelId { get; } |
| 3281 | [Experimental("OPENAI001")] |
| 3282 | protected virtual ModelDeletionResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3283 | [Experimental("OPENAI001")] |
| 3284 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3285 | [Experimental("OPENAI001")] |
| 3286 | protected virtual ModelDeletionResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3287 | [Experimental("OPENAI001")] |
| 3288 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3289 | } |
| 3290 | public class OpenAIModel : IJsonModel<OpenAIModel>, IPersistableModel<OpenAIModel> { |
| 3291 | public DateTimeOffset CreatedAt { get; } |
| 3292 | public string Id { get; } |
| 3293 | public string OwnedBy { get; } |
| 3294 | [Experimental("OPENAI001")] |
| 3295 | protected virtual OpenAIModel JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3296 | [Experimental("OPENAI001")] |
| 3297 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3298 | [Experimental("OPENAI001")] |
| 3299 | protected virtual OpenAIModel PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3300 | [Experimental("OPENAI001")] |
| 3301 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3302 | } |
| 3303 | public class OpenAIModelClient { |
| 3304 | protected OpenAIModelClient(); |
| 3305 | public OpenAIModelClient(ApiKeyCredential credential, OpenAIClientOptions options); |
| 3306 | public OpenAIModelClient(ApiKeyCredential credential); |
| 3307 | protected internal OpenAIModelClient(ClientPipeline pipeline, OpenAIClientOptions options); |
| 3308 | public OpenAIModelClient(string apiKey); |
| 3309 | public ClientPipeline Pipeline { get; } |
| 3310 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3311 | public virtual ClientResult DeleteModel(string model, RequestOptions options); |
| 3312 | public virtual ClientResult<ModelDeletionResult> DeleteModel(string model, CancellationToken cancellationToken = default); |
| 3313 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3314 | public virtual Task<ClientResult> DeleteModelAsync(string model, RequestOptions options); |
| 3315 | public virtual Task<ClientResult<ModelDeletionResult>> DeleteModelAsync(string model, CancellationToken cancellationToken = default); |
| 3316 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3317 | public virtual ClientResult GetModel(string model, RequestOptions options); |
| 3318 | public virtual ClientResult<OpenAIModel> GetModel(string model, CancellationToken cancellationToken = default); |
| 3319 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3320 | public virtual Task<ClientResult> GetModelAsync(string model, RequestOptions options); |
| 3321 | public virtual Task<ClientResult<OpenAIModel>> GetModelAsync(string model, CancellationToken cancellationToken = default); |
| 3322 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3323 | public virtual ClientResult GetModels(RequestOptions options); |
| 3324 | public virtual ClientResult<OpenAIModelCollection> GetModels(CancellationToken cancellationToken = default); |
| 3325 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3326 | public virtual Task<ClientResult> GetModelsAsync(RequestOptions options); |
| 3327 | public virtual Task<ClientResult<OpenAIModelCollection>> GetModelsAsync(CancellationToken cancellationToken = default); |
| 3328 | } |
| 3329 | public class OpenAIModelCollection : ObjectModel.ReadOnlyCollection<OpenAIModel>, IJsonModel<OpenAIModelCollection>, IPersistableModel<OpenAIModelCollection> { |
| 3330 | [Experimental("OPENAI001")] |
| 3331 | protected virtual OpenAIModelCollection JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3332 | [Experimental("OPENAI001")] |
| 3333 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3334 | [Experimental("OPENAI001")] |
| 3335 | protected virtual OpenAIModelCollection PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3336 | [Experimental("OPENAI001")] |
| 3337 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3338 | } |
| 3339 | public static class OpenAIModelsModelFactory { |
| 3340 | public static ModelDeletionResult ModelDeletionResult(string modelId = null, bool deleted = false); |
| 3341 | public static OpenAIModel OpenAIModel(string id = null, DateTimeOffset createdAt = default, string ownedBy = null); |
| 3342 | public static OpenAIModelCollection OpenAIModelCollection(IEnumerable<OpenAIModel> items = null); |
| 3343 | } |
| 3344 | } |
| 3345 | namespace OpenAI.Moderations { |
| 3346 | public class ModerationCategory { |
| 3347 | public bool Flagged { get; } |
| 3348 | public float Score { get; } |
| 3349 | } |
| 3350 | public class ModerationClient { |
| 3351 | protected ModerationClient(); |
| 3352 | protected internal ModerationClient(ClientPipeline pipeline, string model, OpenAIClientOptions options); |
| 3353 | public ModerationClient(string model, ApiKeyCredential credential, OpenAIClientOptions options); |
| 3354 | public ModerationClient(string model, ApiKeyCredential credential); |
| 3355 | public ModerationClient(string model, string apiKey); |
| 3356 | public ClientPipeline Pipeline { get; } |
| 3357 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3358 | public virtual ClientResult ClassifyText(BinaryContent content, RequestOptions options = null); |
| 3359 | public virtual ClientResult<ModerationResultCollection> ClassifyText(IEnumerable<string> inputs, CancellationToken cancellationToken = default); |
| 3360 | public virtual ClientResult<ModerationResult> ClassifyText(string input, CancellationToken cancellationToken = default); |
| 3361 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3362 | public virtual Task<ClientResult> ClassifyTextAsync(BinaryContent content, RequestOptions options = null); |
| 3363 | public virtual Task<ClientResult<ModerationResultCollection>> ClassifyTextAsync(IEnumerable<string> inputs, CancellationToken cancellationToken = default); |
| 3364 | public virtual Task<ClientResult<ModerationResult>> ClassifyTextAsync(string input, CancellationToken cancellationToken = default); |
| 3365 | } |
| 3366 | public class ModerationResult : IJsonModel<ModerationResult>, IPersistableModel<ModerationResult> { |
| 3367 | public bool Flagged { get; } |
| 3368 | public ModerationCategory Harassment { get; } |
| 3369 | public ModerationCategory HarassmentThreatening { get; } |
| 3370 | public ModerationCategory Hate { get; } |
| 3371 | public ModerationCategory HateThreatening { get; } |
| 3372 | public ModerationCategory Illicit { get; } |
| 3373 | public ModerationCategory IllicitViolent { get; } |
| 3374 | public ModerationCategory SelfHarm { get; } |
| 3375 | public ModerationCategory SelfHarmInstructions { get; } |
| 3376 | public ModerationCategory SelfHarmIntent { get; } |
| 3377 | public ModerationCategory Sexual { get; } |
| 3378 | public ModerationCategory SexualMinors { get; } |
| 3379 | public ModerationCategory Violence { get; } |
| 3380 | public ModerationCategory ViolenceGraphic { get; } |
| 3381 | [Experimental("OPENAI001")] |
| 3382 | protected virtual ModerationResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3383 | [Experimental("OPENAI001")] |
| 3384 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3385 | [Experimental("OPENAI001")] |
| 3386 | protected virtual ModerationResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3387 | [Experimental("OPENAI001")] |
| 3388 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3389 | } |
| 3390 | public class ModerationResultCollection : ObjectModel.ReadOnlyCollection<ModerationResult>, IJsonModel<ModerationResultCollection>, IPersistableModel<ModerationResultCollection> { |
| 3391 | public string Id { get; } |
| 3392 | public string Model { get; } |
| 3393 | [Experimental("OPENAI001")] |
| 3394 | protected virtual ModerationResultCollection JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3395 | [Experimental("OPENAI001")] |
| 3396 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3397 | [Experimental("OPENAI001")] |
| 3398 | protected virtual ModerationResultCollection PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3399 | [Experimental("OPENAI001")] |
| 3400 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3401 | } |
| 3402 | public static class OpenAIModerationsModelFactory { |
| 3403 | public static ModerationCategory ModerationCategory(bool flagged = false, float score = 0); |
| 3404 | [Experimental("OPENAI001")] |
| 3405 | public static ModerationResult ModerationResult(bool flagged = false, ModerationCategory hate = null, ModerationCategory hateThreatening = null, ModerationCategory harassment = null, ModerationCategory harassmentThreatening = null, ModerationCategory selfHarm = null, ModerationCategory selfHarmIntent = null, ModerationCategory selfHarmInstructions = null, ModerationCategory sexual = null, ModerationCategory sexualMinors = null, ModerationCategory violence = null, ModerationCategory violenceGraphic = null, ModerationCategory illicit = null, ModerationCategory illicitViolent = null); |
| 3406 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3407 | public static ModerationResult ModerationResult(bool flagged, ModerationCategory hate, ModerationCategory hateThreatening, ModerationCategory harassment, ModerationCategory harassmentThreatening, ModerationCategory selfHarm, ModerationCategory selfHarmIntent, ModerationCategory selfHarmInstructions, ModerationCategory sexual, ModerationCategory sexualMinors, ModerationCategory violence, ModerationCategory violenceGraphic); |
| 3408 | public static ModerationResultCollection ModerationResultCollection(string id = null, string model = null, IEnumerable<ModerationResult> items = null); |
| 3409 | } |
| 3410 | } |
| 3411 | namespace OpenAI.Realtime { |
| 3412 | [Experimental("OPENAI002")] |
| 3413 | public class ConversationContentPart : IJsonModel<ConversationContentPart>, IPersistableModel<ConversationContentPart> { |
| 3414 | public string AudioTranscript { get; } |
| 3415 | public string Text { get; } |
| 3416 | public static ConversationContentPart CreateInputAudioTranscriptPart(string transcript = null); |
| 3417 | public static ConversationContentPart CreateInputTextPart(string text); |
| 3418 | public static ConversationContentPart CreateOutputAudioTranscriptPart(string transcript = null); |
| 3419 | public static ConversationContentPart CreateOutputTextPart(string text); |
| 3420 | [Experimental("OPENAI001")] |
| 3421 | protected virtual ConversationContentPart JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3422 | [Experimental("OPENAI001")] |
| 3423 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3424 | public static implicit operator ConversationContentPart(string text); |
| 3425 | [Experimental("OPENAI001")] |
| 3426 | protected virtual ConversationContentPart PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3427 | [Experimental("OPENAI001")] |
| 3428 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3429 | } |
| 3430 | [Experimental("OPENAI002")] |
| 3431 | public readonly partial struct ConversationContentPartKind : IEquatable<ConversationContentPartKind> { |
| 3432 | public ConversationContentPartKind(string value); |
| 3433 | public static ConversationContentPartKind InputAudio { get; } |
| 3434 | public static ConversationContentPartKind InputText { get; } |
| 3435 | public static ConversationContentPartKind OutputAudio { get; } |
| 3436 | public static ConversationContentPartKind OutputText { get; } |
| 3437 | public readonly bool Equals(ConversationContentPartKind other); |
| 3438 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3439 | public override readonly bool Equals(object obj); |
| 3440 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3441 | public override readonly int GetHashCode(); |
| 3442 | public static bool operator ==(ConversationContentPartKind left, ConversationContentPartKind right); |
| 3443 | public static implicit operator ConversationContentPartKind(string value); |
| 3444 | public static bool operator !=(ConversationContentPartKind left, ConversationContentPartKind right); |
| 3445 | public override readonly string ToString(); |
| 3446 | } |
| 3447 | [Experimental("OPENAI002")] |
| 3448 | public class ConversationFunctionTool : ConversationTool, IJsonModel<ConversationFunctionTool>, IPersistableModel<ConversationFunctionTool> { |
| 3449 | public ConversationFunctionTool(string name); |
| 3450 | public string Description { get; set; } |
| 3451 | public string Name { get; set; } |
| 3452 | public BinaryData Parameters { get; set; } |
| 3453 | [Experimental("OPENAI001")] |
| 3454 | protected override ConversationTool JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3455 | [Experimental("OPENAI001")] |
| 3456 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3457 | [Experimental("OPENAI001")] |
| 3458 | protected override ConversationTool PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3459 | [Experimental("OPENAI001")] |
| 3460 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3461 | } |
| 3462 | [Experimental("OPENAI002")] |
| 3463 | public readonly partial struct ConversationIncompleteReason : IEquatable<ConversationIncompleteReason> { |
| 3464 | public ConversationIncompleteReason(string value); |
| 3465 | public static ConversationIncompleteReason ClientCancelled { get; } |
| 3466 | public static ConversationIncompleteReason ContentFilter { get; } |
| 3467 | public static ConversationIncompleteReason MaxOutputTokens { get; } |
| 3468 | public static ConversationIncompleteReason TurnDetected { get; } |
| 3469 | public readonly bool Equals(ConversationIncompleteReason other); |
| 3470 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3471 | public override readonly bool Equals(object obj); |
| 3472 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3473 | public override readonly int GetHashCode(); |
| 3474 | public static bool operator ==(ConversationIncompleteReason left, ConversationIncompleteReason right); |
| 3475 | public static implicit operator ConversationIncompleteReason(string value); |
| 3476 | public static bool operator !=(ConversationIncompleteReason left, ConversationIncompleteReason right); |
| 3477 | public override readonly string ToString(); |
| 3478 | } |
| 3479 | [Experimental("OPENAI002")] |
| 3480 | public class ConversationInputTokenUsageDetails : IJsonModel<ConversationInputTokenUsageDetails>, IPersistableModel<ConversationInputTokenUsageDetails> { |
| 3481 | public int AudioTokenCount { get; } |
| 3482 | public int CachedTokenCount { get; } |
| 3483 | public int TextTokenCount { get; } |
| 3484 | [Experimental("OPENAI001")] |
| 3485 | protected virtual ConversationInputTokenUsageDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3486 | [Experimental("OPENAI001")] |
| 3487 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3488 | [Experimental("OPENAI001")] |
| 3489 | protected virtual ConversationInputTokenUsageDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3490 | [Experimental("OPENAI001")] |
| 3491 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3492 | } |
| 3493 | [Experimental("OPENAI002")] |
| 3494 | public readonly partial struct ConversationItemStatus : IEquatable<ConversationItemStatus> { |
| 3495 | public ConversationItemStatus(string value); |
| 3496 | public static ConversationItemStatus Completed { get; } |
| 3497 | public static ConversationItemStatus Incomplete { get; } |
| 3498 | public static ConversationItemStatus InProgress { get; } |
| 3499 | public readonly bool Equals(ConversationItemStatus other); |
| 3500 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3501 | public override readonly bool Equals(object obj); |
| 3502 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3503 | public override readonly int GetHashCode(); |
| 3504 | public static bool operator ==(ConversationItemStatus left, ConversationItemStatus right); |
| 3505 | public static implicit operator ConversationItemStatus(string value); |
| 3506 | public static bool operator !=(ConversationItemStatus left, ConversationItemStatus right); |
| 3507 | public override readonly string ToString(); |
| 3508 | } |
| 3509 | [Experimental("OPENAI002")] |
| 3510 | public class ConversationMaxTokensChoice : IJsonModel<ConversationMaxTokensChoice>, IPersistableModel<ConversationMaxTokensChoice> { |
| 3511 | public ConversationMaxTokensChoice(int numberValue); |
| 3512 | public int? NumericValue { get; } |
| 3513 | public static ConversationMaxTokensChoice CreateDefaultMaxTokensChoice(); |
| 3514 | public static ConversationMaxTokensChoice CreateInfiniteMaxTokensChoice(); |
| 3515 | public static ConversationMaxTokensChoice CreateNumericMaxTokensChoice(int maxTokens); |
| 3516 | public static implicit operator ConversationMaxTokensChoice(int maxTokens); |
| 3517 | } |
| 3518 | [Experimental("OPENAI002")] |
| 3519 | public readonly partial struct ConversationMessageRole : IEquatable<ConversationMessageRole> { |
| 3520 | public ConversationMessageRole(string value); |
| 3521 | public static ConversationMessageRole Assistant { get; } |
| 3522 | public static ConversationMessageRole System { get; } |
| 3523 | public static ConversationMessageRole User { get; } |
| 3524 | public readonly bool Equals(ConversationMessageRole other); |
| 3525 | [EditorBrowsable(global::EditorBrowsableState.Never)] |
| 3526 | public override readonly bool Equals(object obj); |
| 3527 | [EditorBrowsable(global::EditorBrowsableState.Never)] |
| 3528 | public override readonly int GetHashCode(); |
| 3529 | public static bool operator ==(ConversationMessageRole left, ConversationMessageRole right); |
| 3530 | public static implicit operator ConversationMessageRole(string value); |
| 3531 | public static bool operator !=(ConversationMessageRole left, ConversationMessageRole right); |
| 3532 | public override readonly string ToString(); |
| 3533 | } |
| 3534 | [Experimental("OPENAI002")] |
| 3535 | public class ConversationOutputTokenUsageDetails : IJsonModel<ConversationOutputTokenUsageDetails>, IPersistableModel<ConversationOutputTokenUsageDetails> { |
| 3536 | public int AudioTokenCount { get; } |
| 3537 | public int TextTokenCount { get; } |
| 3538 | [Experimental("OPENAI001")] |
| 3539 | protected virtual ConversationOutputTokenUsageDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3540 | [Experimental("OPENAI001")] |
| 3541 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3542 | [Experimental("OPENAI001")] |
| 3543 | protected virtual ConversationOutputTokenUsageDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3544 | [Experimental("OPENAI001")] |
| 3545 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3546 | } |
| 3547 | [Experimental("OPENAI002")] |
| 3548 | public class ConversationRateLimitDetailsItem : IJsonModel<ConversationRateLimitDetailsItem>, IPersistableModel<ConversationRateLimitDetailsItem> { |
| 3549 | public int MaximumCount { get; } |
| 3550 | public string Name { get; } |
| 3551 | public int RemainingCount { get; } |
| 3552 | public TimeSpan TimeUntilReset { get; } |
| 3553 | [Experimental("OPENAI001")] |
| 3554 | protected virtual ConversationRateLimitDetailsItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3555 | [Experimental("OPENAI001")] |
| 3556 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3557 | [Experimental("OPENAI001")] |
| 3558 | protected virtual ConversationRateLimitDetailsItem PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3559 | [Experimental("OPENAI001")] |
| 3560 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3561 | } |
| 3562 | [Experimental("OPENAI002")] |
| 3563 | public class ConversationResponseOptions : IJsonModel<ConversationResponseOptions>, IPersistableModel<ConversationResponseOptions> { |
| 3564 | public ConversationVoice? Voice; |
| 3565 | public RealtimeContentModalities ContentModalities { get; set; } |
| 3566 | public ResponseConversationSelection? ConversationSelection { get; set; } |
| 3567 | public string Instructions { get; set; } |
| 3568 | public ConversationMaxTokensChoice MaxOutputTokens { get; set; } |
| 3569 | public IDictionary<string, string> Metadata { get; } |
| 3570 | public RealtimeAudioFormat? OutputAudioFormat { get; set; } |
| 3571 | public IList<RealtimeItem> OverrideItems { get; } |
| 3572 | public float? Temperature { get; set; } |
| 3573 | public ConversationToolChoice ToolChoice { get; set; } |
| 3574 | public IList<ConversationTool> Tools { get; } |
| 3575 | [Experimental("OPENAI001")] |
| 3576 | protected virtual ConversationResponseOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3577 | [Experimental("OPENAI001")] |
| 3578 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3579 | [Experimental("OPENAI001")] |
| 3580 | protected virtual ConversationResponseOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3581 | [Experimental("OPENAI001")] |
| 3582 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3583 | } |
| 3584 | [Experimental("OPENAI002")] |
| 3585 | public class ConversationSessionConfiguredUpdate : RealtimeUpdate, IJsonModel<ConversationSessionConfiguredUpdate>, IPersistableModel<ConversationSessionConfiguredUpdate> { |
| 3586 | public RealtimeContentModalities ContentModalities { get; } |
| 3587 | public RealtimeAudioFormat InputAudioFormat { get; } |
| 3588 | public InputTranscriptionOptions InputTranscriptionOptions { get; } |
| 3589 | public string Instructions { get; } |
| 3590 | public ConversationMaxTokensChoice MaxOutputTokens { get; } |
| 3591 | public string Model { get; } |
| 3592 | public RealtimeAudioFormat OutputAudioFormat { get; } |
| 3593 | public string SessionId { get; } |
| 3594 | public float Temperature { get; } |
| 3595 | public ConversationToolChoice ToolChoice { get; } |
| 3596 | public IReadOnlyList<ConversationTool> Tools { get; } |
| 3597 | public TurnDetectionOptions TurnDetectionOptions { get; } |
| 3598 | public ConversationVoice Voice { get; } |
| 3599 | [Experimental("OPENAI001")] |
| 3600 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3601 | [Experimental("OPENAI001")] |
| 3602 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3603 | [Experimental("OPENAI001")] |
| 3604 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3605 | [Experimental("OPENAI001")] |
| 3606 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3607 | } |
| 3608 | [Experimental("OPENAI002")] |
| 3609 | public class ConversationSessionOptions : IJsonModel<ConversationSessionOptions>, IPersistableModel<ConversationSessionOptions> { |
| 3610 | public RealtimeContentModalities ContentModalities { get; set; } |
| 3611 | public RealtimeAudioFormat? InputAudioFormat { get; set; } |
| 3612 | public InputNoiseReductionOptions InputNoiseReductionOptions { get; set; } |
| 3613 | public InputTranscriptionOptions InputTranscriptionOptions { get; set; } |
| 3614 | public string Instructions { get; set; } |
| 3615 | public ConversationMaxTokensChoice MaxOutputTokens { get; set; } |
| 3616 | public RealtimeAudioFormat? OutputAudioFormat { get; set; } |
| 3617 | public float? Temperature { get; set; } |
| 3618 | public ConversationToolChoice ToolChoice { get; set; } |
| 3619 | public IList<ConversationTool> Tools { get; } |
| 3620 | public TurnDetectionOptions TurnDetectionOptions { get; set; } |
| 3621 | public ConversationVoice? Voice { get; set; } |
| 3622 | [Experimental("OPENAI001")] |
| 3623 | protected virtual ConversationSessionOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3624 | [Experimental("OPENAI001")] |
| 3625 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3626 | [Experimental("OPENAI001")] |
| 3627 | protected virtual ConversationSessionOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3628 | [Experimental("OPENAI001")] |
| 3629 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3630 | } |
| 3631 | [Experimental("OPENAI002")] |
| 3632 | public class ConversationSessionStartedUpdate : RealtimeUpdate, IJsonModel<ConversationSessionStartedUpdate>, IPersistableModel<ConversationSessionStartedUpdate> { |
| 3633 | public RealtimeContentModalities ContentModalities { get; } |
| 3634 | public RealtimeAudioFormat InputAudioFormat { get; } |
| 3635 | public InputTranscriptionOptions InputTranscriptionOptions { get; } |
| 3636 | public string Instructions { get; } |
| 3637 | public ConversationMaxTokensChoice MaxOutputTokens { get; } |
| 3638 | public string Model { get; } |
| 3639 | public RealtimeAudioFormat OutputAudioFormat { get; } |
| 3640 | public string SessionId { get; } |
| 3641 | public float Temperature { get; } |
| 3642 | public ConversationToolChoice ToolChoice { get; } |
| 3643 | public IReadOnlyList<ConversationTool> Tools { get; } |
| 3644 | public TurnDetectionOptions TurnDetectionOptions { get; } |
| 3645 | public ConversationVoice Voice { get; } |
| 3646 | [Experimental("OPENAI001")] |
| 3647 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3648 | [Experimental("OPENAI001")] |
| 3649 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3650 | [Experimental("OPENAI001")] |
| 3651 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3652 | [Experimental("OPENAI001")] |
| 3653 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3654 | } |
| 3655 | [Experimental("OPENAI002")] |
| 3656 | public readonly partial struct ConversationStatus : IEquatable<ConversationStatus> { |
| 3657 | public ConversationStatus(string value); |
| 3658 | public static ConversationStatus Cancelled { get; } |
| 3659 | public static ConversationStatus Completed { get; } |
| 3660 | public static ConversationStatus Failed { get; } |
| 3661 | public static ConversationStatus Incomplete { get; } |
| 3662 | public readonly bool Equals(ConversationStatus other); |
| 3663 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3664 | public override readonly bool Equals(object obj); |
| 3665 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3666 | public override readonly int GetHashCode(); |
| 3667 | public static bool operator ==(ConversationStatus left, ConversationStatus right); |
| 3668 | public static implicit operator ConversationStatus(string value); |
| 3669 | public static bool operator !=(ConversationStatus left, ConversationStatus right); |
| 3670 | public override readonly string ToString(); |
| 3671 | } |
| 3672 | [Experimental("OPENAI002")] |
| 3673 | public class ConversationStatusDetails : IJsonModel<ConversationStatusDetails>, IPersistableModel<ConversationStatusDetails> { |
| 3674 | public string ErrorCode { get; } |
| 3675 | public string ErrorKind { get; } |
| 3676 | public ConversationIncompleteReason? IncompleteReason { get; } |
| 3677 | public ConversationStatus StatusKind { get; } |
| 3678 | [Experimental("OPENAI001")] |
| 3679 | protected virtual ConversationStatusDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3680 | [Experimental("OPENAI001")] |
| 3681 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3682 | [Experimental("OPENAI001")] |
| 3683 | protected virtual ConversationStatusDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3684 | [Experimental("OPENAI001")] |
| 3685 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3686 | } |
| 3687 | [Experimental("OPENAI002")] |
| 3688 | public class ConversationTokenUsage : IJsonModel<ConversationTokenUsage>, IPersistableModel<ConversationTokenUsage> { |
| 3689 | public int InputTokenCount { get; } |
| 3690 | public ConversationInputTokenUsageDetails InputTokenDetails { get; } |
| 3691 | public int OutputTokenCount { get; } |
| 3692 | public ConversationOutputTokenUsageDetails OutputTokenDetails { get; } |
| 3693 | public int TotalTokenCount { get; } |
| 3694 | [Experimental("OPENAI001")] |
| 3695 | protected virtual ConversationTokenUsage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3696 | [Experimental("OPENAI001")] |
| 3697 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3698 | [Experimental("OPENAI001")] |
| 3699 | protected virtual ConversationTokenUsage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3700 | [Experimental("OPENAI001")] |
| 3701 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3702 | } |
| 3703 | [Experimental("OPENAI002")] |
| 3704 | public class ConversationTool : IJsonModel<ConversationTool>, IPersistableModel<ConversationTool> { |
| 3705 | public ConversationToolKind Kind { get; } |
| 3706 | public static ConversationTool CreateFunctionTool(string name, string description = null, BinaryData parameters = null); |
| 3707 | [Experimental("OPENAI001")] |
| 3708 | protected virtual ConversationTool JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3709 | [Experimental("OPENAI001")] |
| 3710 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3711 | [Experimental("OPENAI001")] |
| 3712 | protected virtual ConversationTool PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3713 | [Experimental("OPENAI001")] |
| 3714 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3715 | } |
| 3716 | [Experimental("OPENAI002")] |
| 3717 | public class ConversationToolChoice : IJsonModel<ConversationToolChoice>, IPersistableModel<ConversationToolChoice> { |
| 3718 | public string FunctionName { get; } |
| 3719 | public ConversationToolChoiceKind Kind { get; } |
| 3720 | public static ConversationToolChoice CreateAutoToolChoice(); |
| 3721 | public static ConversationToolChoice CreateFunctionToolChoice(string functionName); |
| 3722 | public static ConversationToolChoice CreateNoneToolChoice(); |
| 3723 | public static ConversationToolChoice CreateRequiredToolChoice(); |
| 3724 | } |
| 3725 | [Experimental("OPENAI002")] |
| 3726 | public enum ConversationToolChoiceKind { |
| 3727 | Unknown = 0, |
| 3728 | Auto = 1, |
| 3729 | None = 2, |
| 3730 | Required = 3, |
| 3731 | Function = 4 |
| 3732 | } |
| 3733 | [Experimental("OPENAI002")] |
| 3734 | public readonly partial struct ConversationToolKind : IEquatable<ConversationToolKind> { |
| 3735 | public ConversationToolKind(string value); |
| 3736 | public static ConversationToolKind Function { get; } |
| 3737 | public readonly bool Equals(ConversationToolKind other); |
| 3738 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3739 | public override readonly bool Equals(object obj); |
| 3740 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3741 | public override readonly int GetHashCode(); |
| 3742 | public static bool operator ==(ConversationToolKind left, ConversationToolKind right); |
| 3743 | public static implicit operator ConversationToolKind(string value); |
| 3744 | public static bool operator !=(ConversationToolKind left, ConversationToolKind right); |
| 3745 | public override readonly string ToString(); |
| 3746 | } |
| 3747 | [Experimental("OPENAI002")] |
| 3748 | public readonly partial struct ConversationVoice : IEquatable<ConversationVoice> { |
| 3749 | public ConversationVoice(string value); |
| 3750 | public static ConversationVoice Alloy { get; } |
| 3751 | public static ConversationVoice Ash { get; } |
| 3752 | public static ConversationVoice Ballad { get; } |
| 3753 | public static ConversationVoice Coral { get; } |
| 3754 | public static ConversationVoice Echo { get; } |
| 3755 | public static ConversationVoice Fable { get; } |
| 3756 | public static ConversationVoice Nova { get; } |
| 3757 | public static ConversationVoice Onyx { get; } |
| 3758 | public static ConversationVoice Sage { get; } |
| 3759 | public static ConversationVoice Shimmer { get; } |
| 3760 | public static ConversationVoice Verse { get; } |
| 3761 | public readonly bool Equals(ConversationVoice other); |
| 3762 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3763 | public override readonly bool Equals(object obj); |
| 3764 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3765 | public override readonly int GetHashCode(); |
| 3766 | public static bool operator ==(ConversationVoice left, ConversationVoice right); |
| 3767 | public static implicit operator ConversationVoice(string value); |
| 3768 | public static bool operator !=(ConversationVoice left, ConversationVoice right); |
| 3769 | public override readonly string ToString(); |
| 3770 | } |
| 3771 | [Experimental("OPENAI002")] |
| 3772 | public class InputAudioClearedUpdate : RealtimeUpdate, IJsonModel<InputAudioClearedUpdate>, IPersistableModel<InputAudioClearedUpdate> { |
| 3773 | [Experimental("OPENAI001")] |
| 3774 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3775 | [Experimental("OPENAI001")] |
| 3776 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3777 | [Experimental("OPENAI001")] |
| 3778 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3779 | [Experimental("OPENAI001")] |
| 3780 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3781 | } |
| 3782 | [Experimental("OPENAI002")] |
| 3783 | public class InputAudioCommittedUpdate : RealtimeUpdate, IJsonModel<InputAudioCommittedUpdate>, IPersistableModel<InputAudioCommittedUpdate> { |
| 3784 | public string ItemId { get; } |
| 3785 | public string PreviousItemId { get; } |
| 3786 | [Experimental("OPENAI001")] |
| 3787 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3788 | [Experimental("OPENAI001")] |
| 3789 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3790 | [Experimental("OPENAI001")] |
| 3791 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3792 | [Experimental("OPENAI001")] |
| 3793 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3794 | } |
| 3795 | [Experimental("OPENAI002")] |
| 3796 | public class InputAudioSpeechFinishedUpdate : RealtimeUpdate, IJsonModel<InputAudioSpeechFinishedUpdate>, IPersistableModel<InputAudioSpeechFinishedUpdate> { |
| 3797 | public TimeSpan AudioEndTime { get; } |
| 3798 | public string ItemId { get; } |
| 3799 | [Experimental("OPENAI001")] |
| 3800 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3801 | [Experimental("OPENAI001")] |
| 3802 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3803 | [Experimental("OPENAI001")] |
| 3804 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3805 | [Experimental("OPENAI001")] |
| 3806 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3807 | } |
| 3808 | [Experimental("OPENAI002")] |
| 3809 | public class InputAudioSpeechStartedUpdate : RealtimeUpdate, IJsonModel<InputAudioSpeechStartedUpdate>, IPersistableModel<InputAudioSpeechStartedUpdate> { |
| 3810 | public TimeSpan AudioStartTime { get; } |
| 3811 | public string ItemId { get; } |
| 3812 | [Experimental("OPENAI001")] |
| 3813 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3814 | [Experimental("OPENAI001")] |
| 3815 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3816 | [Experimental("OPENAI001")] |
| 3817 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3818 | [Experimental("OPENAI001")] |
| 3819 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3820 | } |
| 3821 | [Experimental("OPENAI002")] |
| 3822 | public class InputAudioTranscriptionDeltaUpdate : RealtimeUpdate, IJsonModel<InputAudioTranscriptionDeltaUpdate>, IPersistableModel<InputAudioTranscriptionDeltaUpdate> { |
| 3823 | public int? ContentIndex { get; } |
| 3824 | public string Delta { get; } |
| 3825 | public string ItemId { get; } |
| 3826 | [Experimental("OPENAI001")] |
| 3827 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3828 | [Experimental("OPENAI001")] |
| 3829 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3830 | [Experimental("OPENAI001")] |
| 3831 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3832 | [Experimental("OPENAI001")] |
| 3833 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3834 | } |
| 3835 | [Experimental("OPENAI002")] |
| 3836 | public class InputAudioTranscriptionFailedUpdate : RealtimeUpdate, IJsonModel<InputAudioTranscriptionFailedUpdate>, IPersistableModel<InputAudioTranscriptionFailedUpdate> { |
| 3837 | public int ContentIndex { get; } |
| 3838 | public string ErrorCode { get; } |
| 3839 | public string ErrorMessage { get; } |
| 3840 | public string ErrorParameterName { get; } |
| 3841 | public string ItemId { get; } |
| 3842 | [Experimental("OPENAI001")] |
| 3843 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3844 | [Experimental("OPENAI001")] |
| 3845 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3846 | [Experimental("OPENAI001")] |
| 3847 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3848 | [Experimental("OPENAI001")] |
| 3849 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3850 | } |
| 3851 | [Experimental("OPENAI002")] |
| 3852 | public class InputAudioTranscriptionFinishedUpdate : RealtimeUpdate, IJsonModel<InputAudioTranscriptionFinishedUpdate>, IPersistableModel<InputAudioTranscriptionFinishedUpdate> { |
| 3853 | public int ContentIndex { get; } |
| 3854 | public string ItemId { get; } |
| 3855 | public string Transcript { get; } |
| 3856 | [Experimental("OPENAI001")] |
| 3857 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3858 | [Experimental("OPENAI001")] |
| 3859 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3860 | [Experimental("OPENAI001")] |
| 3861 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3862 | [Experimental("OPENAI001")] |
| 3863 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3864 | } |
| 3865 | [Experimental("OPENAI002")] |
| 3866 | public enum InputNoiseReductionKind { |
| 3867 | Unknown = 0, |
| 3868 | NearField = 1, |
| 3869 | FarField = 2, |
| 3870 | Disabled = 3 |
| 3871 | } |
| 3872 | [Experimental("OPENAI002")] |
| 3873 | public class InputNoiseReductionOptions : IJsonModel<InputNoiseReductionOptions>, IPersistableModel<InputNoiseReductionOptions> { |
| 3874 | public InputNoiseReductionKind Kind { get; set; } |
| 3875 | public static InputNoiseReductionOptions CreateDisabledOptions(); |
| 3876 | public static InputNoiseReductionOptions CreateFarFieldOptions(); |
| 3877 | public static InputNoiseReductionOptions CreateNearFieldOptions(); |
| 3878 | [Experimental("OPENAI001")] |
| 3879 | protected virtual InputNoiseReductionOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3880 | [Experimental("OPENAI001")] |
| 3881 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3882 | [Experimental("OPENAI001")] |
| 3883 | protected virtual InputNoiseReductionOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3884 | [Experimental("OPENAI001")] |
| 3885 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3886 | } |
| 3887 | [Experimental("OPENAI002")] |
| 3888 | public readonly partial struct InputTranscriptionModel : IEquatable<InputTranscriptionModel> { |
| 3889 | public InputTranscriptionModel(string value); |
| 3890 | public static InputTranscriptionModel Whisper1 { get; } |
| 3891 | public readonly bool Equals(InputTranscriptionModel other); |
| 3892 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3893 | public override readonly bool Equals(object obj); |
| 3894 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 3895 | public override readonly int GetHashCode(); |
| 3896 | public static bool operator ==(InputTranscriptionModel left, InputTranscriptionModel right); |
| 3897 | public static implicit operator InputTranscriptionModel(string value); |
| 3898 | public static bool operator !=(InputTranscriptionModel left, InputTranscriptionModel right); |
| 3899 | public override readonly string ToString(); |
| 3900 | } |
| 3901 | [Experimental("OPENAI002")] |
| 3902 | public class InputTranscriptionOptions : IJsonModel<InputTranscriptionOptions>, IPersistableModel<InputTranscriptionOptions> { |
| 3903 | public string Language { get; set; } |
| 3904 | public InputTranscriptionModel? Model { get; set; } |
| 3905 | public string Prompt { get; set; } |
| 3906 | [Experimental("OPENAI001")] |
| 3907 | protected virtual InputTranscriptionOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3908 | [Experimental("OPENAI001")] |
| 3909 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3910 | [Experimental("OPENAI001")] |
| 3911 | protected virtual InputTranscriptionOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3912 | [Experimental("OPENAI001")] |
| 3913 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3914 | } |
| 3915 | [Experimental("OPENAI002")] |
| 3916 | public class ItemCreatedUpdate : RealtimeUpdate, IJsonModel<ItemCreatedUpdate>, IPersistableModel<ItemCreatedUpdate> { |
| 3917 | public string FunctionCallArguments { get; } |
| 3918 | public string FunctionCallId { get; } |
| 3919 | public string FunctionCallOutput { get; } |
| 3920 | public string FunctionName { get; } |
| 3921 | public string ItemId { get; } |
| 3922 | public IReadOnlyList<ConversationContentPart> MessageContentParts { get; } |
| 3923 | public ConversationMessageRole? MessageRole { get; } |
| 3924 | public string PreviousItemId { get; } |
| 3925 | [Experimental("OPENAI001")] |
| 3926 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3927 | [Experimental("OPENAI001")] |
| 3928 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3929 | [Experimental("OPENAI001")] |
| 3930 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3931 | [Experimental("OPENAI001")] |
| 3932 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3933 | } |
| 3934 | [Experimental("OPENAI002")] |
| 3935 | public class ItemDeletedUpdate : RealtimeUpdate, IJsonModel<ItemDeletedUpdate>, IPersistableModel<ItemDeletedUpdate> { |
| 3936 | public string ItemId { get; } |
| 3937 | [Experimental("OPENAI001")] |
| 3938 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3939 | [Experimental("OPENAI001")] |
| 3940 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3941 | [Experimental("OPENAI001")] |
| 3942 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3943 | [Experimental("OPENAI001")] |
| 3944 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3945 | } |
| 3946 | [Experimental("OPENAI002")] |
| 3947 | public class ItemRetrievedUpdate : RealtimeUpdate, IJsonModel<ItemRetrievedUpdate>, IPersistableModel<ItemRetrievedUpdate> { |
| 3948 | public RealtimeItem Item { get; } |
| 3949 | [Experimental("OPENAI001")] |
| 3950 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3951 | [Experimental("OPENAI001")] |
| 3952 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3953 | [Experimental("OPENAI001")] |
| 3954 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3955 | [Experimental("OPENAI001")] |
| 3956 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3957 | } |
| 3958 | [Experimental("OPENAI002")] |
| 3959 | public class ItemTruncatedUpdate : RealtimeUpdate, IJsonModel<ItemTruncatedUpdate>, IPersistableModel<ItemTruncatedUpdate> { |
| 3960 | public int AudioEndMs { get; } |
| 3961 | public int ContentIndex { get; } |
| 3962 | public string ItemId { get; } |
| 3963 | [Experimental("OPENAI001")] |
| 3964 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3965 | [Experimental("OPENAI001")] |
| 3966 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3967 | [Experimental("OPENAI001")] |
| 3968 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3969 | [Experimental("OPENAI001")] |
| 3970 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3971 | } |
| 3972 | [Experimental("OPENAI002")] |
| 3973 | public class OutputAudioFinishedUpdate : RealtimeUpdate, IJsonModel<OutputAudioFinishedUpdate>, IPersistableModel<OutputAudioFinishedUpdate> { |
| 3974 | public int ContentIndex { get; } |
| 3975 | public string ItemId { get; } |
| 3976 | public int OutputIndex { get; } |
| 3977 | public string ResponseId { get; } |
| 3978 | [Experimental("OPENAI001")] |
| 3979 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3980 | [Experimental("OPENAI001")] |
| 3981 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3982 | [Experimental("OPENAI001")] |
| 3983 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 3984 | [Experimental("OPENAI001")] |
| 3985 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 3986 | } |
| 3987 | [Experimental("OPENAI002")] |
| 3988 | public class OutputAudioTranscriptionFinishedUpdate : RealtimeUpdate, IJsonModel<OutputAudioTranscriptionFinishedUpdate>, IPersistableModel<OutputAudioTranscriptionFinishedUpdate> { |
| 3989 | public int ContentIndex { get; } |
| 3990 | public string ItemId { get; } |
| 3991 | public int OutputIndex { get; } |
| 3992 | public string ResponseId { get; } |
| 3993 | public string Transcript { get; } |
| 3994 | [Experimental("OPENAI001")] |
| 3995 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 3996 | [Experimental("OPENAI001")] |
| 3997 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 3998 | [Experimental("OPENAI001")] |
| 3999 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4000 | [Experimental("OPENAI001")] |
| 4001 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4002 | } |
| 4003 | [Experimental("OPENAI002")] |
| 4004 | public class OutputDeltaUpdate : RealtimeUpdate, IJsonModel<OutputDeltaUpdate>, IPersistableModel<OutputDeltaUpdate> { |
| 4005 | public BinaryData AudioBytes { get; } |
| 4006 | public string AudioTranscript { get; } |
| 4007 | public int ContentPartIndex { get; } |
| 4008 | public string FunctionArguments { get; } |
| 4009 | public string FunctionCallId { get; } |
| 4010 | public string ItemId { get; } |
| 4011 | public int ItemIndex { get; } |
| 4012 | public string ResponseId { get; } |
| 4013 | public string Text { get; } |
| 4014 | } |
| 4015 | [Experimental("OPENAI002")] |
| 4016 | public class OutputPartFinishedUpdate : RealtimeUpdate, IJsonModel<OutputPartFinishedUpdate>, IPersistableModel<OutputPartFinishedUpdate> { |
| 4017 | public string AudioTranscript { get; } |
| 4018 | public int ContentPartIndex { get; } |
| 4019 | public string FunctionArguments { get; } |
| 4020 | public string FunctionCallId { get; } |
| 4021 | public string ItemId { get; } |
| 4022 | public int ItemIndex { get; } |
| 4023 | public string ResponseId { get; } |
| 4024 | public string Text { get; } |
| 4025 | } |
| 4026 | [Experimental("OPENAI002")] |
| 4027 | public class OutputStreamingFinishedUpdate : RealtimeUpdate, IJsonModel<OutputStreamingFinishedUpdate>, IPersistableModel<OutputStreamingFinishedUpdate> { |
| 4028 | public string FunctionCallArguments { get; } |
| 4029 | public string FunctionCallId { get; } |
| 4030 | public string FunctionCallOutput { get; } |
| 4031 | public string FunctionName { get; } |
| 4032 | public string ItemId { get; } |
| 4033 | public IReadOnlyList<ConversationContentPart> MessageContentParts { get; } |
| 4034 | public ConversationMessageRole? MessageRole { get; } |
| 4035 | public int OutputIndex { get; } |
| 4036 | public string ResponseId { get; } |
| 4037 | [Experimental("OPENAI001")] |
| 4038 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4039 | [Experimental("OPENAI001")] |
| 4040 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4041 | [Experimental("OPENAI001")] |
| 4042 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4043 | [Experimental("OPENAI001")] |
| 4044 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4045 | } |
| 4046 | [Experimental("OPENAI002")] |
| 4047 | public class OutputStreamingStartedUpdate : RealtimeUpdate, IJsonModel<OutputStreamingStartedUpdate>, IPersistableModel<OutputStreamingStartedUpdate> { |
| 4048 | public string FunctionCallArguments { get; } |
| 4049 | public string FunctionCallId { get; } |
| 4050 | public string FunctionCallOutput { get; } |
| 4051 | public string FunctionName { get; } |
| 4052 | public string ItemId { get; } |
| 4053 | public int ItemIndex { get; } |
| 4054 | public IReadOnlyList<ConversationContentPart> MessageContentParts { get; } |
| 4055 | public ConversationMessageRole? MessageRole { get; } |
| 4056 | public string ResponseId { get; } |
| 4057 | [Experimental("OPENAI001")] |
| 4058 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4059 | [Experimental("OPENAI001")] |
| 4060 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4061 | [Experimental("OPENAI001")] |
| 4062 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4063 | [Experimental("OPENAI001")] |
| 4064 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4065 | } |
| 4066 | [Experimental("OPENAI002")] |
| 4067 | public class OutputTextFinishedUpdate : RealtimeUpdate, IJsonModel<OutputTextFinishedUpdate>, IPersistableModel<OutputTextFinishedUpdate> { |
| 4068 | public int ContentIndex { get; } |
| 4069 | public string ItemId { get; } |
| 4070 | public int OutputIndex { get; } |
| 4071 | public string ResponseId { get; } |
| 4072 | public string Text { get; } |
| 4073 | [Experimental("OPENAI001")] |
| 4074 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4075 | [Experimental("OPENAI001")] |
| 4076 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4077 | [Experimental("OPENAI001")] |
| 4078 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4079 | [Experimental("OPENAI001")] |
| 4080 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4081 | } |
| 4082 | [Experimental("OPENAI002")] |
| 4083 | public class RateLimitsUpdate : RealtimeUpdate, IJsonModel<RateLimitsUpdate>, IPersistableModel<RateLimitsUpdate> { |
| 4084 | public IReadOnlyList<ConversationRateLimitDetailsItem> AllDetails { get; } |
| 4085 | public ConversationRateLimitDetailsItem RequestDetails { get; } |
| 4086 | public ConversationRateLimitDetailsItem TokenDetails { get; } |
| 4087 | [Experimental("OPENAI001")] |
| 4088 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4089 | [Experimental("OPENAI001")] |
| 4090 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4091 | [Experimental("OPENAI001")] |
| 4092 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4093 | [Experimental("OPENAI001")] |
| 4094 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4095 | } |
| 4096 | [Experimental("OPENAI002")] |
| 4097 | public readonly partial struct RealtimeAudioFormat : IEquatable<RealtimeAudioFormat> { |
| 4098 | public RealtimeAudioFormat(string value); |
| 4099 | public static RealtimeAudioFormat G711Alaw { get; } |
| 4100 | public static RealtimeAudioFormat G711Ulaw { get; } |
| 4101 | public static RealtimeAudioFormat Pcm16 { get; } |
| 4102 | public readonly bool Equals(RealtimeAudioFormat other); |
| 4103 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4104 | public override readonly bool Equals(object obj); |
| 4105 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4106 | public override readonly int GetHashCode(); |
| 4107 | public static bool operator ==(RealtimeAudioFormat left, RealtimeAudioFormat right); |
| 4108 | public static implicit operator RealtimeAudioFormat(string value); |
| 4109 | public static bool operator !=(RealtimeAudioFormat left, RealtimeAudioFormat right); |
| 4110 | public override readonly string ToString(); |
| 4111 | } |
| 4112 | [Experimental("OPENAI002")] |
| 4113 | public class RealtimeClient { |
| 4114 | protected RealtimeClient(); |
| 4115 | public RealtimeClient(ApiKeyCredential credential, OpenAIClientOptions options); |
| 4116 | public RealtimeClient(ApiKeyCredential credential); |
| 4117 | protected internal RealtimeClient(ClientPipeline pipeline, OpenAIClientOptions options); |
| 4118 | public ClientPipeline Pipeline { get; } |
| 4119 | public event EventHandler<BinaryData> OnReceivingCommand { add; remove; } |
| 4120 | public event EventHandler<BinaryData> OnSendingCommand { add; remove; } |
| 4121 | public virtual ClientResult CreateEphemeralToken(BinaryContent content, RequestOptions options = null); |
| 4122 | public virtual Task<ClientResult> CreateEphemeralTokenAsync(BinaryContent content, RequestOptions options = null); |
| 4123 | public virtual ClientResult CreateEphemeralTranscriptionToken(BinaryContent content, RequestOptions options = null); |
| 4124 | public virtual Task<ClientResult> CreateEphemeralTranscriptionTokenAsync(BinaryContent content, RequestOptions options = null); |
| 4125 | public RealtimeSession StartConversationSession(string model, CancellationToken cancellationToken = default); |
| 4126 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4127 | public virtual Task<RealtimeSession> StartConversationSessionAsync(string model, RequestOptions options); |
| 4128 | public virtual Task<RealtimeSession> StartConversationSessionAsync(string model, CancellationToken cancellationToken = default); |
| 4129 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4130 | public virtual Task<RealtimeSession> StartSessionAsync(string model, string intent, RequestOptions options); |
| 4131 | public RealtimeSession StartTranscriptionSession(CancellationToken cancellationToken = default); |
| 4132 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4133 | public virtual Task<RealtimeSession> StartTranscriptionSessionAsync(RequestOptions options); |
| 4134 | public virtual Task<RealtimeSession> StartTranscriptionSessionAsync(CancellationToken cancellationToken = default); |
| 4135 | } |
| 4136 | [Experimental("OPENAI002")] |
| 4137 | [Flags] |
| 4138 | public enum RealtimeContentModalities { |
| 4139 | Default = 0, |
| 4140 | Text = 1, |
| 4141 | Audio = 2 |
| 4142 | } |
| 4143 | [Experimental("OPENAI002")] |
| 4144 | public class RealtimeErrorUpdate : RealtimeUpdate, IJsonModel<RealtimeErrorUpdate>, IPersistableModel<RealtimeErrorUpdate> { |
| 4145 | public string ErrorCode { get; } |
| 4146 | public string ErrorEventId { get; } |
| 4147 | public string Message { get; } |
| 4148 | public string ParameterName { get; } |
| 4149 | [Experimental("OPENAI001")] |
| 4150 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4151 | [Experimental("OPENAI001")] |
| 4152 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4153 | [Experimental("OPENAI001")] |
| 4154 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4155 | [Experimental("OPENAI001")] |
| 4156 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4157 | } |
| 4158 | [Experimental("OPENAI002")] |
| 4159 | public class RealtimeItem : IJsonModel<RealtimeItem>, IPersistableModel<RealtimeItem> { |
| 4160 | public string FunctionArguments { get; } |
| 4161 | public string FunctionCallId { get; } |
| 4162 | public string FunctionName { get; } |
| 4163 | public string Id { get; set; } |
| 4164 | public IReadOnlyList<ConversationContentPart> MessageContentParts { get; } |
| 4165 | public ConversationMessageRole? MessageRole { get; } |
| 4166 | public static RealtimeItem CreateAssistantMessage(IEnumerable<ConversationContentPart> contentItems); |
| 4167 | public static RealtimeItem CreateFunctionCall(string name, string callId, string arguments); |
| 4168 | public static RealtimeItem CreateFunctionCallOutput(string callId, string output); |
| 4169 | public static RealtimeItem CreateSystemMessage(IEnumerable<ConversationContentPart> contentItems); |
| 4170 | public static RealtimeItem CreateUserMessage(IEnumerable<ConversationContentPart> contentItems); |
| 4171 | [Experimental("OPENAI001")] |
| 4172 | protected virtual RealtimeItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4173 | [Experimental("OPENAI001")] |
| 4174 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4175 | [Experimental("OPENAI001")] |
| 4176 | protected virtual RealtimeItem PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4177 | [Experimental("OPENAI001")] |
| 4178 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4179 | } |
| 4180 | [Experimental("OPENAI002")] |
| 4181 | public class RealtimeSession : IDisposable { |
| 4182 | protected internal RealtimeSession(RealtimeClient parentClient, Uri endpoint, ApiKeyCredential credential); |
| 4183 | public Net.WebSockets.WebSocket WebSocket { get; protected set; } |
| 4184 | public virtual void AddItem(RealtimeItem item, string previousItemId, CancellationToken cancellationToken = default); |
| 4185 | public virtual void AddItem(RealtimeItem item, CancellationToken cancellationToken = default); |
| 4186 | public virtual Task AddItemAsync(RealtimeItem item, string previousItemId, CancellationToken cancellationToken = default); |
| 4187 | public virtual Task AddItemAsync(RealtimeItem item, CancellationToken cancellationToken = default); |
| 4188 | public virtual void CancelResponse(CancellationToken cancellationToken = default); |
| 4189 | public virtual Task CancelResponseAsync(CancellationToken cancellationToken = default); |
| 4190 | public virtual void ClearInputAudio(CancellationToken cancellationToken = default); |
| 4191 | public virtual Task ClearInputAudioAsync(CancellationToken cancellationToken = default); |
| 4192 | public virtual void CommitPendingAudio(CancellationToken cancellationToken = default); |
| 4193 | public virtual Task CommitPendingAudioAsync(CancellationToken cancellationToken = default); |
| 4194 | public virtual Task ConfigureConversationSessionAsync(ConversationSessionOptions sessionOptions, CancellationToken cancellationToken = default); |
| 4195 | public virtual void ConfigureSession(ConversationSessionOptions sessionOptions, CancellationToken cancellationToken = default); |
| 4196 | public virtual void ConfigureTranscriptionSession(TranscriptionSessionOptions sessionOptions, CancellationToken cancellationToken = default); |
| 4197 | public virtual Task ConfigureTranscriptionSessionAsync(TranscriptionSessionOptions sessionOptions, CancellationToken cancellationToken = default); |
| 4198 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4199 | protected internal virtual void Connect(RequestOptions options); |
| 4200 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4201 | protected internal virtual Task ConnectAsync(RequestOptions options); |
| 4202 | public virtual void DeleteItem(string itemId, CancellationToken cancellationToken = default); |
| 4203 | public virtual Task DeleteItemAsync(string itemId, CancellationToken cancellationToken = default); |
| 4204 | public void Dispose(); |
| 4205 | public virtual void InterruptResponse(CancellationToken cancellationToken = default); |
| 4206 | public virtual Task InterruptResponseAsync(CancellationToken cancellationToken = default); |
| 4207 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4208 | public virtual IEnumerable<ClientResult> ReceiveUpdates(RequestOptions options); |
| 4209 | public virtual IEnumerable<RealtimeUpdate> ReceiveUpdates(CancellationToken cancellationToken = default); |
| 4210 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4211 | public virtual IAsyncEnumerable<ClientResult> ReceiveUpdatesAsync(RequestOptions options); |
| 4212 | public virtual IAsyncEnumerable<RealtimeUpdate> ReceiveUpdatesAsync(CancellationToken cancellationToken = default); |
| 4213 | public virtual void RequestItemRetrieval(string itemId, CancellationToken cancellationToken = default); |
| 4214 | public virtual Task RequestItemRetrievalAsync(string itemId, CancellationToken cancellationToken = default); |
| 4215 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4216 | public virtual void SendCommand(BinaryData data, RequestOptions options); |
| 4217 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4218 | public virtual Task SendCommandAsync(BinaryData data, RequestOptions options); |
| 4219 | public virtual void SendInputAudio(BinaryData audio, CancellationToken cancellationToken = default); |
| 4220 | public virtual void SendInputAudio(Stream audio, CancellationToken cancellationToken = default); |
| 4221 | public virtual Task SendInputAudioAsync(BinaryData audio, CancellationToken cancellationToken = default); |
| 4222 | public virtual Task SendInputAudioAsync(Stream audio, CancellationToken cancellationToken = default); |
| 4223 | public virtual void StartResponse(ConversationResponseOptions options, CancellationToken cancellationToken = default); |
| 4224 | public void StartResponse(CancellationToken cancellationToken = default); |
| 4225 | public virtual Task StartResponseAsync(ConversationResponseOptions options, CancellationToken cancellationToken = default); |
| 4226 | public virtual Task StartResponseAsync(CancellationToken cancellationToken = default); |
| 4227 | public virtual void TruncateItem(string itemId, int contentPartIndex, TimeSpan audioDuration, CancellationToken cancellationToken = default); |
| 4228 | public virtual Task TruncateItemAsync(string itemId, int contentPartIndex, TimeSpan audioDuration, CancellationToken cancellationToken = default); |
| 4229 | } |
| 4230 | [Experimental("OPENAI002")] |
| 4231 | public class RealtimeUpdate : IJsonModel<RealtimeUpdate>, IPersistableModel<RealtimeUpdate> { |
| 4232 | public string EventId { get; } |
| 4233 | public RealtimeUpdateKind Kind { get; } |
| 4234 | public BinaryData GetRawContent(); |
| 4235 | [Experimental("OPENAI001")] |
| 4236 | protected virtual RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4237 | [Experimental("OPENAI001")] |
| 4238 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4239 | public static explicit operator RealtimeUpdate(ClientResult result); |
| 4240 | [Experimental("OPENAI001")] |
| 4241 | protected virtual RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4242 | [Experimental("OPENAI001")] |
| 4243 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4244 | } |
| 4245 | [Experimental("OPENAI002")] |
| 4246 | public enum RealtimeUpdateKind { |
| 4247 | Unknown = 0, |
| 4248 | SessionStarted = 1, |
| 4249 | SessionConfigured = 2, |
| 4250 | ItemCreated = 3, |
| 4251 | ConversationCreated = 4, |
| 4252 | ItemRetrieved = 5, |
| 4253 | ItemDeleted = 6, |
| 4254 | ItemTruncated = 7, |
| 4255 | ResponseStarted = 8, |
| 4256 | ResponseFinished = 9, |
| 4257 | RateLimitsUpdated = 10, |
| 4258 | ItemStreamingStarted = 11, |
| 4259 | ItemStreamingFinished = 12, |
| 4260 | ItemContentPartStarted = 13, |
| 4261 | ItemContentPartFinished = 14, |
| 4262 | ItemStreamingPartAudioDelta = 15, |
| 4263 | ItemStreamingPartAudioFinished = 16, |
| 4264 | ItemStreamingPartAudioTranscriptionDelta = 17, |
| 4265 | ItemStreamingPartAudioTranscriptionFinished = 18, |
| 4266 | ItemStreamingPartTextDelta = 19, |
| 4267 | ItemStreamingPartTextFinished = 20, |
| 4268 | ItemStreamingFunctionCallArgumentsDelta = 21, |
| 4269 | ItemStreamingFunctionCallArgumentsFinished = 22, |
| 4270 | InputSpeechStarted = 23, |
| 4271 | InputSpeechStopped = 24, |
| 4272 | InputTranscriptionFinished = 25, |
| 4273 | InputTranscriptionDelta = 26, |
| 4274 | InputTranscriptionFailed = 27, |
| 4275 | InputAudioCommitted = 28, |
| 4276 | InputAudioCleared = 29, |
| 4277 | OutputAudioBufferCleared = 30, |
| 4278 | OutputAudioBufferStarted = 31, |
| 4279 | OutputAudioBufferStopped = 32, |
| 4280 | TranscriptionSessionStarted = 33, |
| 4281 | TranscriptionSessionConfigured = 34, |
| 4282 | Error = 35 |
| 4283 | } |
| 4284 | [Experimental("OPENAI002")] |
| 4285 | public readonly partial struct ResponseConversationSelection : IEquatable<ResponseConversationSelection> { |
| 4286 | public ResponseConversationSelection(string value); |
| 4287 | public static ResponseConversationSelection Auto { get; } |
| 4288 | public static ResponseConversationSelection None { get; } |
| 4289 | public readonly bool Equals(ResponseConversationSelection other); |
| 4290 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4291 | public override readonly bool Equals(object obj); |
| 4292 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4293 | public override readonly int GetHashCode(); |
| 4294 | public static bool operator ==(ResponseConversationSelection left, ResponseConversationSelection right); |
| 4295 | public static implicit operator ResponseConversationSelection(string value); |
| 4296 | public static bool operator !=(ResponseConversationSelection left, ResponseConversationSelection right); |
| 4297 | public override readonly string ToString(); |
| 4298 | } |
| 4299 | [Experimental("OPENAI002")] |
| 4300 | public class ResponseFinishedUpdate : RealtimeUpdate, IJsonModel<ResponseFinishedUpdate>, IPersistableModel<ResponseFinishedUpdate> { |
| 4301 | public IReadOnlyList<RealtimeItem> CreatedItems { get; } |
| 4302 | public string ResponseId { get; } |
| 4303 | public ConversationStatus? Status { get; } |
| 4304 | public ConversationStatusDetails StatusDetails { get; } |
| 4305 | public ConversationTokenUsage Usage { get; } |
| 4306 | [Experimental("OPENAI001")] |
| 4307 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4308 | [Experimental("OPENAI001")] |
| 4309 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4310 | [Experimental("OPENAI001")] |
| 4311 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4312 | [Experimental("OPENAI001")] |
| 4313 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4314 | } |
| 4315 | [Experimental("OPENAI002")] |
| 4316 | public class ResponseStartedUpdate : RealtimeUpdate, IJsonModel<ResponseStartedUpdate>, IPersistableModel<ResponseStartedUpdate> { |
| 4317 | public IReadOnlyList<RealtimeItem> CreatedItems { get; } |
| 4318 | public string ResponseId { get; } |
| 4319 | public ConversationStatus Status { get; } |
| 4320 | public ConversationStatusDetails StatusDetails { get; } |
| 4321 | public ConversationTokenUsage Usage { get; } |
| 4322 | [Experimental("OPENAI001")] |
| 4323 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4324 | [Experimental("OPENAI001")] |
| 4325 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4326 | [Experimental("OPENAI001")] |
| 4327 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4328 | [Experimental("OPENAI001")] |
| 4329 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4330 | } |
| 4331 | [Experimental("OPENAI002")] |
| 4332 | public class TranscriptionSessionConfiguredUpdate : RealtimeUpdate, IJsonModel<TranscriptionSessionConfiguredUpdate>, IPersistableModel<TranscriptionSessionConfiguredUpdate> { |
| 4333 | public RealtimeContentModalities ContentModalities { get; } |
| 4334 | public RealtimeAudioFormat InputAudioFormat { get; } |
| 4335 | public InputTranscriptionOptions InputAudioTranscription { get; } |
| 4336 | public TurnDetectionOptions TurnDetection { get; } |
| 4337 | [Experimental("OPENAI001")] |
| 4338 | protected override RealtimeUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4339 | [Experimental("OPENAI001")] |
| 4340 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4341 | [Experimental("OPENAI001")] |
| 4342 | protected override RealtimeUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4343 | [Experimental("OPENAI001")] |
| 4344 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4345 | } |
| 4346 | [Experimental("OPENAI002")] |
| 4347 | public class TranscriptionSessionOptions : IJsonModel<TranscriptionSessionOptions>, IPersistableModel<TranscriptionSessionOptions> { |
| 4348 | public RealtimeContentModalities ContentModalities { get; set; } |
| 4349 | public IList<string> Include { get; } |
| 4350 | public RealtimeAudioFormat? InputAudioFormat { get; set; } |
| 4351 | public InputNoiseReductionOptions InputNoiseReductionOptions { get; set; } |
| 4352 | public InputTranscriptionOptions InputTranscriptionOptions { get; set; } |
| 4353 | public TurnDetectionOptions TurnDetectionOptions { get; set; } |
| 4354 | [Experimental("OPENAI001")] |
| 4355 | protected virtual TranscriptionSessionOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4356 | [Experimental("OPENAI001")] |
| 4357 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4358 | [Experimental("OPENAI001")] |
| 4359 | protected virtual TranscriptionSessionOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4360 | [Experimental("OPENAI001")] |
| 4361 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4362 | } |
| 4363 | [Experimental("OPENAI002")] |
| 4364 | public enum TurnDetectionKind { |
| 4365 | Unknown = 0, |
| 4366 | ServerVoiceActivityDetection = 1, |
| 4367 | SemanticVoiceActivityDetection = 2, |
| 4368 | Disabled = 3 |
| 4369 | } |
| 4370 | [Experimental("OPENAI002")] |
| 4371 | public class TurnDetectionOptions : IJsonModel<TurnDetectionOptions>, IPersistableModel<TurnDetectionOptions> { |
| 4372 | public TurnDetectionKind Kind { get; } |
| 4373 | public static TurnDetectionOptions CreateDisabledTurnDetectionOptions(); |
| 4374 | public static TurnDetectionOptions CreateServerVoiceActivityTurnDetectionOptions(float? detectionThreshold = null, TimeSpan? prefixPaddingDuration = null, TimeSpan? silenceDuration = null, bool? enableAutomaticResponseCreation = null, bool? enableResponseInterruption = null); |
| 4375 | [Experimental("OPENAI001")] |
| 4376 | protected virtual TurnDetectionOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4377 | [Experimental("OPENAI001")] |
| 4378 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4379 | [Experimental("OPENAI001")] |
| 4380 | protected virtual TurnDetectionOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4381 | [Experimental("OPENAI001")] |
| 4382 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4383 | } |
| 4384 | } |
| 4385 | namespace OpenAI.Responses { |
| 4386 | [Experimental("OPENAICUA001")] |
| 4387 | public class ComputerCallAction : IJsonModel<ComputerCallAction>, IPersistableModel<ComputerCallAction> { |
| 4388 | public Drawing.Point? ClickCoordinates { get; } |
| 4389 | public ComputerCallActionMouseButton? ClickMouseButton { get; } |
| 4390 | public Drawing.Point? DoubleClickCoordinates { get; } |
| 4391 | public IList<Drawing.Point> DragPath { get; } |
| 4392 | public IList<string> KeyPressKeyCodes { get; } |
| 4393 | public ComputerCallActionKind Kind { get; } |
| 4394 | public Drawing.Point? MoveCoordinates { get; } |
| 4395 | public Drawing.Point? ScrollCoordinates { get; } |
| 4396 | public int? ScrollHorizontalOffset { get; } |
| 4397 | public int? ScrollVerticalOffset { get; } |
| 4398 | public string TypeText { get; } |
| 4399 | public static ComputerCallAction CreateClickAction(Drawing.Point clickCoordinates, ComputerCallActionMouseButton clickMouseButton); |
| 4400 | public static ComputerCallAction CreateDoubleClickAction(Drawing.Point doubleClickCoordinates, ComputerCallActionMouseButton doubleClickMouseButton); |
| 4401 | public static ComputerCallAction CreateDragAction(IList<Drawing.Point> dragPath); |
| 4402 | public static ComputerCallAction CreateKeyPressAction(IList<string> keyCodes); |
| 4403 | public static ComputerCallAction CreateMoveAction(Drawing.Point moveCoordinates); |
| 4404 | public static ComputerCallAction CreateScreenshotAction(); |
| 4405 | public static ComputerCallAction CreateScrollAction(Drawing.Point scrollCoordinates, int horizontalOffset, int verticalOffset); |
| 4406 | public static ComputerCallAction CreateTypeAction(string typeText); |
| 4407 | public static ComputerCallAction CreateWaitAction(); |
| 4408 | [Experimental("OPENAI001")] |
| 4409 | protected virtual ComputerCallAction JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4410 | [Experimental("OPENAI001")] |
| 4411 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4412 | [Experimental("OPENAI001")] |
| 4413 | protected virtual ComputerCallAction PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4414 | [Experimental("OPENAI001")] |
| 4415 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4416 | } |
| 4417 | [Experimental("OPENAICUA001")] |
| 4418 | public enum ComputerCallActionKind { |
| 4419 | Click = 0, |
| 4420 | DoubleClick = 1, |
| 4421 | Drag = 2, |
| 4422 | KeyPress = 3, |
| 4423 | Move = 4, |
| 4424 | Screenshot = 5, |
| 4425 | Scroll = 6, |
| 4426 | Type = 7, |
| 4427 | Wait = 8 |
| 4428 | } |
| 4429 | [Experimental("OPENAICUA001")] |
| 4430 | public enum ComputerCallActionMouseButton { |
| 4431 | Left = 0, |
| 4432 | Right = 1, |
| 4433 | Wheel = 2, |
| 4434 | Back = 3, |
| 4435 | Forward = 4 |
| 4436 | } |
| 4437 | [Experimental("OPENAICUA001")] |
| 4438 | public class ComputerCallOutputResponseItem : ResponseItem, IJsonModel<ComputerCallOutputResponseItem>, IPersistableModel<ComputerCallOutputResponseItem> { |
| 4439 | public IList<ComputerCallSafetyCheck> AcknowledgedSafetyChecks { get; } |
| 4440 | public string CallId { get; } |
| 4441 | public ComputerOutput Output { get; } |
| 4442 | public ComputerCallOutputStatus? Status { get; } |
| 4443 | [Experimental("OPENAI001")] |
| 4444 | protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4445 | [Experimental("OPENAI001")] |
| 4446 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4447 | [Experimental("OPENAI001")] |
| 4448 | protected override ResponseItem PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4449 | [Experimental("OPENAI001")] |
| 4450 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4451 | } |
| 4452 | [Experimental("OPENAICUA001")] |
| 4453 | public enum ComputerCallOutputStatus { |
| 4454 | InProgress = 0, |
| 4455 | Completed = 1, |
| 4456 | Incomplete = 2 |
| 4457 | } |
| 4458 | [Experimental("OPENAICUA001")] |
| 4459 | public class ComputerCallResponseItem : ResponseItem, IJsonModel<ComputerCallResponseItem>, IPersistableModel<ComputerCallResponseItem> { |
| 4460 | public ComputerCallResponseItem(string callId, ComputerCallAction action, IEnumerable<ComputerCallSafetyCheck> pendingSafetyChecks); |
| 4461 | public ComputerCallAction Action { get; } |
| 4462 | public string CallId { get; } |
| 4463 | public IList<ComputerCallSafetyCheck> PendingSafetyChecks { get; } |
| 4464 | public ComputerCallStatus? Status { get; } |
| 4465 | [Experimental("OPENAI001")] |
| 4466 | protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4467 | [Experimental("OPENAI001")] |
| 4468 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4469 | [Experimental("OPENAI001")] |
| 4470 | protected override ResponseItem PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4471 | [Experimental("OPENAI001")] |
| 4472 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4473 | } |
| 4474 | [Experimental("OPENAICUA001")] |
| 4475 | public class ComputerCallSafetyCheck : IJsonModel<ComputerCallSafetyCheck>, IPersistableModel<ComputerCallSafetyCheck> { |
| 4476 | public ComputerCallSafetyCheck(string id, string code, string message); |
| 4477 | public string Code { get; set; } |
| 4478 | public string Id { get; set; } |
| 4479 | public string Message { get; set; } |
| 4480 | [Experimental("OPENAI001")] |
| 4481 | protected virtual ComputerCallSafetyCheck JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4482 | [Experimental("OPENAI001")] |
| 4483 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4484 | [Experimental("OPENAI001")] |
| 4485 | protected virtual ComputerCallSafetyCheck PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4486 | [Experimental("OPENAI001")] |
| 4487 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4488 | } |
| 4489 | [Experimental("OPENAICUA001")] |
| 4490 | public enum ComputerCallStatus { |
| 4491 | InProgress = 0, |
| 4492 | Completed = 1, |
| 4493 | Incomplete = 2 |
| 4494 | } |
| 4495 | [Experimental("OPENAICUA001")] |
| 4496 | public class ComputerOutput : IJsonModel<ComputerOutput>, IPersistableModel<ComputerOutput> { |
| 4497 | public static ComputerOutput CreateScreenshotOutput(BinaryData screenshotImageBytes, string screenshotImageBytesMediaType); |
| 4498 | public static ComputerOutput CreateScreenshotOutput(string screenshotImageFileId); |
| 4499 | public static ComputerOutput CreateScreenshotOutput(Uri screenshotImageUri); |
| 4500 | [Experimental("OPENAI001")] |
| 4501 | protected virtual ComputerOutput JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4502 | [Experimental("OPENAI001")] |
| 4503 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4504 | [Experimental("OPENAI001")] |
| 4505 | protected virtual ComputerOutput PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4506 | [Experimental("OPENAI001")] |
| 4507 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4508 | } |
| 4509 | [Experimental("OPENAICUA001")] |
| 4510 | public readonly partial struct ComputerToolEnvironment : IEquatable<ComputerToolEnvironment> { |
| 4511 | public ComputerToolEnvironment(string value); |
| 4512 | public static ComputerToolEnvironment Browser { get; } |
| 4513 | public static ComputerToolEnvironment Linux { get; } |
| 4514 | public static ComputerToolEnvironment Mac { get; } |
| 4515 | public static ComputerToolEnvironment Ubuntu { get; } |
| 4516 | public static ComputerToolEnvironment Windows { get; } |
| 4517 | public readonly bool Equals(ComputerToolEnvironment other); |
| 4518 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4519 | public override readonly bool Equals(object obj); |
| 4520 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4521 | public override readonly int GetHashCode(); |
| 4522 | public static bool operator ==(ComputerToolEnvironment left, ComputerToolEnvironment right); |
| 4523 | public static implicit operator ComputerToolEnvironment(string value); |
| 4524 | public static bool operator !=(ComputerToolEnvironment left, ComputerToolEnvironment right); |
| 4525 | public override readonly string ToString(); |
| 4526 | } |
| 4527 | [Experimental("OPENAI001")] |
| 4528 | public class FileSearchCallResponseItem : ResponseItem, IJsonModel<FileSearchCallResponseItem>, IPersistableModel<FileSearchCallResponseItem> { |
| 4529 | public IList<string> Queries { get; } |
| 4530 | public IList<FileSearchCallResult> Results { get; } |
| 4531 | public FileSearchCallStatus? Status { get; } |
| 4532 | [Experimental("OPENAI001")] |
| 4533 | protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4534 | [Experimental("OPENAI001")] |
| 4535 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4536 | [Experimental("OPENAI001")] |
| 4537 | protected override ResponseItem PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4538 | [Experimental("OPENAI001")] |
| 4539 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4540 | } |
| 4541 | [Experimental("OPENAI001")] |
| 4542 | public class FileSearchCallResult : IJsonModel<FileSearchCallResult>, IPersistableModel<FileSearchCallResult> { |
| 4543 | public IReadOnlyDictionary<string, BinaryData> Attributes { get; } |
| 4544 | public string FileId { get; set; } |
| 4545 | public string Filename { get; set; } |
| 4546 | public float? Score { get; set; } |
| 4547 | public string Text { get; set; } |
| 4548 | [Experimental("OPENAI001")] |
| 4549 | protected virtual FileSearchCallResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4550 | [Experimental("OPENAI001")] |
| 4551 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4552 | [Experimental("OPENAI001")] |
| 4553 | protected virtual FileSearchCallResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4554 | [Experimental("OPENAI001")] |
| 4555 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4556 | } |
| 4557 | [Experimental("OPENAI001")] |
| 4558 | public enum FileSearchCallStatus { |
| 4559 | InProgress = 0, |
| 4560 | Searching = 1, |
| 4561 | Completed = 2, |
| 4562 | Incomplete = 3, |
| 4563 | Failed = 4 |
| 4564 | } |
| 4565 | [Experimental("OPENAI001")] |
| 4566 | public readonly partial struct FileSearchToolRanker : IEquatable<FileSearchToolRanker> { |
| 4567 | public FileSearchToolRanker(string value); |
| 4568 | public static FileSearchToolRanker Auto { get; } |
| 4569 | public static FileSearchToolRanker Default20241115 { get; } |
| 4570 | public readonly bool Equals(FileSearchToolRanker other); |
| 4571 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4572 | public override readonly bool Equals(object obj); |
| 4573 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4574 | public override readonly int GetHashCode(); |
| 4575 | public static bool operator ==(FileSearchToolRanker left, FileSearchToolRanker right); |
| 4576 | public static implicit operator FileSearchToolRanker(string value); |
| 4577 | public static bool operator !=(FileSearchToolRanker left, FileSearchToolRanker right); |
| 4578 | public override readonly string ToString(); |
| 4579 | } |
| 4580 | [Experimental("OPENAI001")] |
| 4581 | public class FileSearchToolRankingOptions : IJsonModel<FileSearchToolRankingOptions>, IPersistableModel<FileSearchToolRankingOptions> { |
| 4582 | public FileSearchToolRanker? Ranker { get; set; } |
| 4583 | public float? ScoreThreshold { get; set; } |
| 4584 | [Experimental("OPENAI001")] |
| 4585 | protected virtual FileSearchToolRankingOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4586 | [Experimental("OPENAI001")] |
| 4587 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4588 | [Experimental("OPENAI001")] |
| 4589 | protected virtual FileSearchToolRankingOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4590 | [Experimental("OPENAI001")] |
| 4591 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4592 | } |
| 4593 | [Experimental("OPENAI001")] |
| 4594 | public class FunctionCallOutputResponseItem : ResponseItem, IJsonModel<FunctionCallOutputResponseItem>, IPersistableModel<FunctionCallOutputResponseItem> { |
| 4595 | public string CallId { get; } |
| 4596 | public string FunctionOutput { get; set; } |
| 4597 | public FunctionCallOutputStatus? Status { get; } |
| 4598 | [Experimental("OPENAI001")] |
| 4599 | protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4600 | [Experimental("OPENAI001")] |
| 4601 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4602 | [Experimental("OPENAI001")] |
| 4603 | protected override ResponseItem PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4604 | [Experimental("OPENAI001")] |
| 4605 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4606 | } |
| 4607 | [Experimental("OPENAI001")] |
| 4608 | public enum FunctionCallOutputStatus { |
| 4609 | InProgress = 0, |
| 4610 | Completed = 1, |
| 4611 | Incomplete = 2 |
| 4612 | } |
| 4613 | [Experimental("OPENAI001")] |
| 4614 | public class FunctionCallResponseItem : ResponseItem, IJsonModel<FunctionCallResponseItem>, IPersistableModel<FunctionCallResponseItem> { |
| 4615 | public string CallId { get; } |
| 4616 | public BinaryData FunctionArguments { get; set; } |
| 4617 | public string FunctionName { get; set; } |
| 4618 | public FunctionCallStatus? Status { get; } |
| 4619 | [Experimental("OPENAI001")] |
| 4620 | protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4621 | [Experimental("OPENAI001")] |
| 4622 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4623 | [Experimental("OPENAI001")] |
| 4624 | protected override ResponseItem PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4625 | [Experimental("OPENAI001")] |
| 4626 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4627 | } |
| 4628 | [Experimental("OPENAI001")] |
| 4629 | public enum FunctionCallStatus { |
| 4630 | InProgress = 0, |
| 4631 | Completed = 1, |
| 4632 | Incomplete = 2 |
| 4633 | } |
| 4634 | [Experimental("OPENAI001")] |
| 4635 | public class MessageResponseItem : ResponseItem, IJsonModel<MessageResponseItem>, IPersistableModel<MessageResponseItem> { |
| 4636 | public IList<ResponseContentPart> Content { get; } |
| 4637 | public MessageRole Role { get; } |
| 4638 | public MessageStatus? Status { get; } |
| 4639 | [Experimental("OPENAI001")] |
| 4640 | protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4641 | [Experimental("OPENAI001")] |
| 4642 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4643 | [Experimental("OPENAI001")] |
| 4644 | protected override ResponseItem PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4645 | [Experimental("OPENAI001")] |
| 4646 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4647 | } |
| 4648 | [Experimental("OPENAI001")] |
| 4649 | public enum MessageRole { |
| 4650 | Unknown = 0, |
| 4651 | Assistant = 1, |
| 4652 | Developer = 2, |
| 4653 | System = 3, |
| 4654 | User = 4 |
| 4655 | } |
| 4656 | [Experimental("OPENAI001")] |
| 4657 | public enum MessageStatus { |
| 4658 | InProgress = 0, |
| 4659 | Completed = 1, |
| 4660 | Incomplete = 2 |
| 4661 | } |
| 4662 | [Experimental("OPENAI001")] |
| 4663 | public class OpenAIResponse : IJsonModel<OpenAIResponse>, IPersistableModel<OpenAIResponse> { |
| 4664 | public bool? Background { get; } |
| 4665 | public DateTimeOffset CreatedAt { get; } |
| 4666 | public string EndUserId { get; } |
| 4667 | public ResponseError Error { get; } |
| 4668 | public string Id { get; } |
| 4669 | public ResponseIncompleteStatusDetails IncompleteStatusDetails { get; } |
| 4670 | public string Instructions { get; } |
| 4671 | public int? MaxOutputTokenCount { get; } |
| 4672 | public IDictionary<string, string> Metadata { get; } |
| 4673 | public string Model { get; } |
| 4674 | public IList<ResponseItem> OutputItems { get; } |
| 4675 | public bool ParallelToolCallsEnabled { get; } |
| 4676 | public string PreviousResponseId { get; } |
| 4677 | public ResponseReasoningOptions ReasoningOptions { get; } |
| 4678 | public ResponseStatus? Status { get; } |
| 4679 | public float? Temperature { get; } |
| 4680 | public ResponseTextOptions TextOptions { get; } |
| 4681 | public ResponseToolChoice ToolChoice { get; } |
| 4682 | public IList<ResponseTool> Tools { get; } |
| 4683 | public float? TopP { get; } |
| 4684 | public ResponseTruncationMode? TruncationMode { get; } |
| 4685 | public ResponseTokenUsage Usage { get; } |
| 4686 | public string GetOutputText(); |
| 4687 | [Experimental("OPENAI001")] |
| 4688 | protected virtual OpenAIResponse JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4689 | [Experimental("OPENAI001")] |
| 4690 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4691 | [Experimental("OPENAI001")] |
| 4692 | protected virtual OpenAIResponse PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4693 | [Experimental("OPENAI001")] |
| 4694 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4695 | } |
| 4696 | [Experimental("OPENAI001")] |
| 4697 | public class OpenAIResponseClient { |
| 4698 | protected OpenAIResponseClient(); |
| 4699 | protected internal OpenAIResponseClient(ClientPipeline pipeline, string model, OpenAIClientOptions options); |
| 4700 | public OpenAIResponseClient(string model, ApiKeyCredential credential, OpenAIClientOptions options); |
| 4701 | public OpenAIResponseClient(string model, ApiKeyCredential credential); |
| 4702 | public OpenAIResponseClient(string model, string apiKey); |
| 4703 | public ClientPipeline Pipeline { get; } |
| 4704 | public virtual ClientResult CancelResponse(string responseId, RequestOptions options); |
| 4705 | public virtual ClientResult<OpenAIResponse> CancelResponse(string responseId, CancellationToken cancellationToken = default); |
| 4706 | public virtual Task<ClientResult> CancelResponseAsync(string responseId, RequestOptions options); |
| 4707 | public virtual Task<ClientResult<OpenAIResponse>> CancelResponseAsync(string responseId, CancellationToken cancellationToken = default); |
| 4708 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4709 | public virtual ClientResult CreateResponse(BinaryContent content, RequestOptions options = null); |
| 4710 | public virtual ClientResult<OpenAIResponse> CreateResponse(IEnumerable<ResponseItem> inputItems, ResponseCreationOptions options = null, CancellationToken cancellationToken = default); |
| 4711 | public virtual ClientResult<OpenAIResponse> CreateResponse(string userInputText, ResponseCreationOptions options = null, CancellationToken cancellationToken = default); |
| 4712 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4713 | public virtual Task<ClientResult> CreateResponseAsync(BinaryContent content, RequestOptions options = null); |
| 4714 | public virtual Task<ClientResult<OpenAIResponse>> CreateResponseAsync(IEnumerable<ResponseItem> inputItems, ResponseCreationOptions options = null, CancellationToken cancellationToken = default); |
| 4715 | public virtual Task<ClientResult<OpenAIResponse>> CreateResponseAsync(string userInputText, ResponseCreationOptions options = null, CancellationToken cancellationToken = default); |
| 4716 | public virtual CollectionResult<StreamingResponseUpdate> CreateResponseStreaming(IEnumerable<ResponseItem> inputItems, ResponseCreationOptions options = null, CancellationToken cancellationToken = default); |
| 4717 | public virtual CollectionResult<StreamingResponseUpdate> CreateResponseStreaming(string userInputText, ResponseCreationOptions options = null, CancellationToken cancellationToken = default); |
| 4718 | public virtual AsyncCollectionResult<StreamingResponseUpdate> CreateResponseStreamingAsync(IEnumerable<ResponseItem> inputItems, ResponseCreationOptions options = null, CancellationToken cancellationToken = default); |
| 4719 | public virtual AsyncCollectionResult<StreamingResponseUpdate> CreateResponseStreamingAsync(string userInputText, ResponseCreationOptions options = null, CancellationToken cancellationToken = default); |
| 4720 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4721 | public virtual ClientResult DeleteResponse(string responseId, RequestOptions options); |
| 4722 | public virtual ClientResult<ResponseDeletionResult> DeleteResponse(string responseId, CancellationToken cancellationToken = default); |
| 4723 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4724 | public virtual Task<ClientResult> DeleteResponseAsync(string responseId, RequestOptions options); |
| 4725 | public virtual Task<ClientResult<ResponseDeletionResult>> DeleteResponseAsync(string responseId, CancellationToken cancellationToken = default); |
| 4726 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4727 | public virtual ClientResult GetResponse(string responseId, bool? stream, int? startingAfter, RequestOptions options); |
| 4728 | public virtual ClientResult<OpenAIResponse> GetResponse(string responseId, CancellationToken cancellationToken = default); |
| 4729 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4730 | public virtual Task<ClientResult> GetResponseAsync(string responseId, bool? stream, int? startingAfter, RequestOptions options); |
| 4731 | public virtual Task<ClientResult<OpenAIResponse>> GetResponseAsync(string responseId, CancellationToken cancellationToken = default); |
| 4732 | public virtual CollectionResult<ResponseItem> GetResponseInputItems(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 4733 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4734 | public virtual CollectionResult GetResponseInputItems(string responseId, int? limit, string order, string after, string before, RequestOptions options = null); |
| 4735 | public virtual AsyncCollectionResult<ResponseItem> GetResponseInputItemsAsync(string responseId, ResponseItemCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 4736 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4737 | public virtual AsyncCollectionResult GetResponseInputItemsAsync(string responseId, int? limit, string order, string after, string before, RequestOptions options = null); |
| 4738 | public virtual CollectionResult<StreamingResponseUpdate> GetResponseStreaming(string responseId, int? startingAfter = null, CancellationToken cancellationToken = default); |
| 4739 | public virtual AsyncCollectionResult<StreamingResponseUpdate> GetResponseStreamingAsync(string responseId, int? startingAfter = null, CancellationToken cancellationToken = default); |
| 4740 | } |
| 4741 | [Experimental("OPENAI001")] |
| 4742 | public class ReasoningResponseItem : ResponseItem, IJsonModel<ReasoningResponseItem>, IPersistableModel<ReasoningResponseItem> { |
| 4743 | public ReasoningResponseItem(IEnumerable<ReasoningSummaryPart> summaryParts); |
| 4744 | public ReasoningResponseItem(string summaryText); |
| 4745 | public string EncryptedContent { get; } |
| 4746 | public ReasoningStatus? Status { get; } |
| 4747 | public IReadOnlyList<ReasoningSummaryPart> SummaryParts { get; } |
| 4748 | public string GetSummaryText(); |
| 4749 | [Experimental("OPENAI001")] |
| 4750 | protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4751 | [Experimental("OPENAI001")] |
| 4752 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4753 | [Experimental("OPENAI001")] |
| 4754 | protected override ResponseItem PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4755 | [Experimental("OPENAI001")] |
| 4756 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4757 | } |
| 4758 | [Experimental("OPENAI001")] |
| 4759 | public enum ReasoningStatus { |
| 4760 | InProgress = 0, |
| 4761 | Completed = 1, |
| 4762 | Incomplete = 2 |
| 4763 | } |
| 4764 | [Experimental("OPENAI001")] |
| 4765 | public class ReasoningSummaryPart : IJsonModel<ReasoningSummaryPart>, IPersistableModel<ReasoningSummaryPart> { |
| 4766 | public static ReasoningSummaryPart CreateTextPart(string text); |
| 4767 | [Experimental("OPENAI001")] |
| 4768 | protected virtual ReasoningSummaryPart JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4769 | [Experimental("OPENAI001")] |
| 4770 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4771 | [Experimental("OPENAI001")] |
| 4772 | protected virtual ReasoningSummaryPart PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4773 | [Experimental("OPENAI001")] |
| 4774 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4775 | } |
| 4776 | [Experimental("OPENAI001")] |
| 4777 | public class ReasoningSummaryTextPart : ReasoningSummaryPart, IJsonModel<ReasoningSummaryTextPart>, IPersistableModel<ReasoningSummaryTextPart> { |
| 4778 | public ReasoningSummaryTextPart(string text); |
| 4779 | public string Text { get; set; } |
| 4780 | [Experimental("OPENAI001")] |
| 4781 | protected override ReasoningSummaryPart JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4782 | [Experimental("OPENAI001")] |
| 4783 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4784 | [Experimental("OPENAI001")] |
| 4785 | protected override ReasoningSummaryPart PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4786 | [Experimental("OPENAI001")] |
| 4787 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4788 | } |
| 4789 | [Experimental("OPENAI001")] |
| 4790 | public class ReferenceResponseItem : ResponseItem, IJsonModel<ReferenceResponseItem>, IPersistableModel<ReferenceResponseItem> { |
| 4791 | public ReferenceResponseItem(string id); |
| 4792 | [Experimental("OPENAI001")] |
| 4793 | protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4794 | [Experimental("OPENAI001")] |
| 4795 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4796 | [Experimental("OPENAI001")] |
| 4797 | protected override ResponseItem PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4798 | [Experimental("OPENAI001")] |
| 4799 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4800 | } |
| 4801 | [Experimental("OPENAI001")] |
| 4802 | public class ResponseContentPart : IJsonModel<ResponseContentPart>, IPersistableModel<ResponseContentPart> { |
| 4803 | public BinaryData InputFileBytes { get; } |
| 4804 | public string InputFileBytesMediaType { get; } |
| 4805 | public string InputFileId { get; } |
| 4806 | public string InputFilename { get; } |
| 4807 | public ResponseImageDetailLevel? InputImageDetailLevel { get; } |
| 4808 | public string InputImageFileId { get; } |
| 4809 | public ResponseContentPartKind Kind { get; } |
| 4810 | public IReadOnlyList<ResponseMessageAnnotation> OutputTextAnnotations { get; } |
| 4811 | public string Refusal { get; } |
| 4812 | public string Text { get; } |
| 4813 | public static ResponseContentPart CreateInputFilePart(BinaryData fileBytes, string fileBytesMediaType, string filename); |
| 4814 | public static ResponseContentPart CreateInputFilePart(string fileId); |
| 4815 | public static ResponseContentPart CreateInputImagePart(BinaryData imageBytes, string imageBytesMediaType, ResponseImageDetailLevel? imageDetailLevel = null); |
| 4816 | public static ResponseContentPart CreateInputImagePart(string imageFileId, ResponseImageDetailLevel? imageDetailLevel = null); |
| 4817 | public static ResponseContentPart CreateInputImagePart(Uri imageUri, ResponseImageDetailLevel? imageDetailLevel = null); |
| 4818 | public static ResponseContentPart CreateInputTextPart(string text); |
| 4819 | public static ResponseContentPart CreateOutputTextPart(string text, IEnumerable<ResponseMessageAnnotation> annotations); |
| 4820 | public static ResponseContentPart CreateRefusalPart(string refusal); |
| 4821 | [Experimental("OPENAI001")] |
| 4822 | protected virtual ResponseContentPart JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4823 | [Experimental("OPENAI001")] |
| 4824 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4825 | [Experimental("OPENAI001")] |
| 4826 | protected virtual ResponseContentPart PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4827 | [Experimental("OPENAI001")] |
| 4828 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4829 | } |
| 4830 | [Experimental("OPENAI001")] |
| 4831 | public enum ResponseContentPartKind { |
| 4832 | Unknown = 0, |
| 4833 | InputText = 1, |
| 4834 | InputImage = 2, |
| 4835 | InputFile = 3, |
| 4836 | OutputText = 4, |
| 4837 | Refusal = 5 |
| 4838 | } |
| 4839 | [Experimental("OPENAI001")] |
| 4840 | public class ResponseCreationOptions : IJsonModel<ResponseCreationOptions>, IPersistableModel<ResponseCreationOptions> { |
| 4841 | public bool? Background { get; set; } |
| 4842 | public string EndUserId { get; set; } |
| 4843 | public string Instructions { get; set; } |
| 4844 | public int? MaxOutputTokenCount { get; set; } |
| 4845 | public IDictionary<string, string> Metadata { get; } |
| 4846 | public bool? ParallelToolCallsEnabled { get; set; } |
| 4847 | public string PreviousResponseId { get; set; } |
| 4848 | public ResponseReasoningOptions ReasoningOptions { get; set; } |
| 4849 | public bool? StoredOutputEnabled { get; set; } |
| 4850 | public float? Temperature { get; set; } |
| 4851 | public ResponseTextOptions TextOptions { get; set; } |
| 4852 | public ResponseToolChoice ToolChoice { get; set; } |
| 4853 | public IList<ResponseTool> Tools { get; } |
| 4854 | public float? TopP { get; set; } |
| 4855 | public ResponseTruncationMode? TruncationMode { get; set; } |
| 4856 | [Experimental("OPENAI001")] |
| 4857 | protected virtual ResponseCreationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4858 | [Experimental("OPENAI001")] |
| 4859 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4860 | [Experimental("OPENAI001")] |
| 4861 | protected virtual ResponseCreationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4862 | [Experimental("OPENAI001")] |
| 4863 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4864 | } |
| 4865 | [Experimental("OPENAI001")] |
| 4866 | public class ResponseDeletionResult : IJsonModel<ResponseDeletionResult>, IPersistableModel<ResponseDeletionResult> { |
| 4867 | public bool Deleted { get; } |
| 4868 | public string Id { get; } |
| 4869 | [Experimental("OPENAI001")] |
| 4870 | protected virtual ResponseDeletionResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4871 | [Experimental("OPENAI001")] |
| 4872 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4873 | [Experimental("OPENAI001")] |
| 4874 | protected virtual ResponseDeletionResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4875 | [Experimental("OPENAI001")] |
| 4876 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4877 | } |
| 4878 | [Experimental("OPENAI001")] |
| 4879 | public class ResponseError : IJsonModel<ResponseError>, IPersistableModel<ResponseError> { |
| 4880 | public ResponseErrorCode Code { get; } |
| 4881 | public string Message { get; } |
| 4882 | [Experimental("OPENAI001")] |
| 4883 | protected virtual ResponseError JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4884 | [Experimental("OPENAI001")] |
| 4885 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4886 | [Experimental("OPENAI001")] |
| 4887 | protected virtual ResponseError PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4888 | [Experimental("OPENAI001")] |
| 4889 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4890 | } |
| 4891 | [Experimental("OPENAI001")] |
| 4892 | public readonly partial struct ResponseErrorCode : IEquatable<ResponseErrorCode> { |
| 4893 | public ResponseErrorCode(string value); |
| 4894 | public static ResponseErrorCode EmptyImageFile { get; } |
| 4895 | public static ResponseErrorCode FailedToDownloadImage { get; } |
| 4896 | public static ResponseErrorCode ImageContentPolicyViolation { get; } |
| 4897 | public static ResponseErrorCode ImageFileNotFound { get; } |
| 4898 | public static ResponseErrorCode ImageFileTooLarge { get; } |
| 4899 | public static ResponseErrorCode ImageParseError { get; } |
| 4900 | public static ResponseErrorCode ImageTooLarge { get; } |
| 4901 | public static ResponseErrorCode ImageTooSmall { get; } |
| 4902 | public static ResponseErrorCode InvalidBase64Image { get; } |
| 4903 | public static ResponseErrorCode InvalidImage { get; } |
| 4904 | public static ResponseErrorCode InvalidImageFormat { get; } |
| 4905 | public static ResponseErrorCode InvalidImageMode { get; } |
| 4906 | public static ResponseErrorCode InvalidImageUrl { get; } |
| 4907 | public static ResponseErrorCode InvalidPrompt { get; } |
| 4908 | public static ResponseErrorCode RateLimitExceeded { get; } |
| 4909 | public static ResponseErrorCode ServerError { get; } |
| 4910 | public static ResponseErrorCode UnsupportedImageMediaType { get; } |
| 4911 | public static ResponseErrorCode VectorStoreTimeout { get; } |
| 4912 | public readonly bool Equals(ResponseErrorCode other); |
| 4913 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4914 | public override readonly bool Equals(object obj); |
| 4915 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4916 | public override readonly int GetHashCode(); |
| 4917 | public static bool operator ==(ResponseErrorCode left, ResponseErrorCode right); |
| 4918 | public static implicit operator ResponseErrorCode(string value); |
| 4919 | public static bool operator !=(ResponseErrorCode left, ResponseErrorCode right); |
| 4920 | public override readonly string ToString(); |
| 4921 | } |
| 4922 | [Experimental("OPENAI001")] |
| 4923 | public readonly partial struct ResponseImageDetailLevel : IEquatable<ResponseImageDetailLevel> { |
| 4924 | public ResponseImageDetailLevel(string value); |
| 4925 | public static ResponseImageDetailLevel Auto { get; } |
| 4926 | public static ResponseImageDetailLevel High { get; } |
| 4927 | public static ResponseImageDetailLevel Low { get; } |
| 4928 | public readonly bool Equals(ResponseImageDetailLevel other); |
| 4929 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4930 | public override readonly bool Equals(object obj); |
| 4931 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4932 | public override readonly int GetHashCode(); |
| 4933 | public static bool operator ==(ResponseImageDetailLevel left, ResponseImageDetailLevel right); |
| 4934 | public static implicit operator ResponseImageDetailLevel(string value); |
| 4935 | public static bool operator !=(ResponseImageDetailLevel left, ResponseImageDetailLevel right); |
| 4936 | public override readonly string ToString(); |
| 4937 | } |
| 4938 | [Experimental("OPENAI001")] |
| 4939 | public class ResponseIncompleteStatusDetails : IJsonModel<ResponseIncompleteStatusDetails>, IPersistableModel<ResponseIncompleteStatusDetails> { |
| 4940 | public ResponseIncompleteStatusReason? Reason { get; } |
| 4941 | [Experimental("OPENAI001")] |
| 4942 | protected virtual ResponseIncompleteStatusDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4943 | [Experimental("OPENAI001")] |
| 4944 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4945 | [Experimental("OPENAI001")] |
| 4946 | protected virtual ResponseIncompleteStatusDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4947 | [Experimental("OPENAI001")] |
| 4948 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4949 | } |
| 4950 | [Experimental("OPENAI001")] |
| 4951 | public readonly partial struct ResponseIncompleteStatusReason : IEquatable<ResponseIncompleteStatusReason> { |
| 4952 | public ResponseIncompleteStatusReason(string value); |
| 4953 | public static ResponseIncompleteStatusReason ContentFilter { get; } |
| 4954 | public static ResponseIncompleteStatusReason MaxOutputTokens { get; } |
| 4955 | public readonly bool Equals(ResponseIncompleteStatusReason other); |
| 4956 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4957 | public override readonly bool Equals(object obj); |
| 4958 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 4959 | public override readonly int GetHashCode(); |
| 4960 | public static bool operator ==(ResponseIncompleteStatusReason left, ResponseIncompleteStatusReason right); |
| 4961 | public static implicit operator ResponseIncompleteStatusReason(string value); |
| 4962 | public static bool operator !=(ResponseIncompleteStatusReason left, ResponseIncompleteStatusReason right); |
| 4963 | public override readonly string ToString(); |
| 4964 | } |
| 4965 | [Experimental("OPENAI001")] |
| 4966 | public class ResponseInputTokenUsageDetails : IJsonModel<ResponseInputTokenUsageDetails>, IPersistableModel<ResponseInputTokenUsageDetails> { |
| 4967 | public int CachedTokenCount { get; } |
| 4968 | [Experimental("OPENAI001")] |
| 4969 | protected virtual ResponseInputTokenUsageDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 4970 | [Experimental("OPENAI001")] |
| 4971 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 4972 | [Experimental("OPENAI001")] |
| 4973 | protected virtual ResponseInputTokenUsageDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 4974 | [Experimental("OPENAI001")] |
| 4975 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 4976 | } |
| 4977 | [Experimental("OPENAI001")] |
| 4978 | public class ResponseItem : IJsonModel<ResponseItem>, IPersistableModel<ResponseItem> { |
| 4979 | public string Id { get; } |
| 4980 | public static MessageResponseItem CreateAssistantMessageItem(IEnumerable<ResponseContentPart> contentParts); |
| 4981 | public static MessageResponseItem CreateAssistantMessageItem(string outputTextContent, IEnumerable<ResponseMessageAnnotation> annotations = null); |
| 4982 | [Experimental("OPENAICUA001")] |
| 4983 | public static ComputerCallResponseItem CreateComputerCallItem(string callId, ComputerCallAction action, IEnumerable<ComputerCallSafetyCheck> pendingSafetyChecks); |
| 4984 | [Experimental("OPENAICUA001")] |
| 4985 | public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList<ComputerCallSafetyCheck> acknowledgedSafetyChecks, BinaryData screenshotImageBytes, string screenshotImageBytesMediaType); |
| 4986 | [Experimental("OPENAICUA001")] |
| 4987 | public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList<ComputerCallSafetyCheck> acknowledgedSafetyChecks, string screenshotImageFileId); |
| 4988 | [Experimental("OPENAICUA001")] |
| 4989 | public static ComputerCallOutputResponseItem CreateComputerCallOutputItem(string callId, IList<ComputerCallSafetyCheck> acknowledgedSafetyChecks, Uri screenshotImageUri); |
| 4990 | public static MessageResponseItem CreateDeveloperMessageItem(IEnumerable<ResponseContentPart> contentParts); |
| 4991 | public static MessageResponseItem CreateDeveloperMessageItem(string inputTextContent); |
| 4992 | public static FileSearchCallResponseItem CreateFileSearchCallItem(IEnumerable<string> queries, IEnumerable<FileSearchCallResult> results); |
| 4993 | public static FunctionCallResponseItem CreateFunctionCallItem(string callId, string functionName, BinaryData functionArguments); |
| 4994 | public static FunctionCallOutputResponseItem CreateFunctionCallOutputItem(string callId, string functionOutput); |
| 4995 | public static ReasoningResponseItem CreateReasoningItem(IEnumerable<ReasoningSummaryPart> summaryParts); |
| 4996 | public static ReasoningResponseItem CreateReasoningItem(string summaryText); |
| 4997 | public static ReferenceResponseItem CreateReferenceItem(string id); |
| 4998 | public static MessageResponseItem CreateSystemMessageItem(IEnumerable<ResponseContentPart> contentParts); |
| 4999 | public static MessageResponseItem CreateSystemMessageItem(string inputTextContent); |
| 5000 | public static MessageResponseItem CreateUserMessageItem(IEnumerable<ResponseContentPart> contentParts); |
| 5001 | public static MessageResponseItem CreateUserMessageItem(string inputTextContent); |
| 5002 | public static WebSearchCallResponseItem CreateWebSearchCallItem(); |
| 5003 | [Experimental("OPENAI001")] |
| 5004 | protected virtual ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5005 | [Experimental("OPENAI001")] |
| 5006 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5007 | [Experimental("OPENAI001")] |
| 5008 | protected virtual ResponseItem PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5009 | [Experimental("OPENAI001")] |
| 5010 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5011 | } |
| 5012 | [Experimental("OPENAI001")] |
| 5013 | public class ResponseItemCollectionOptions { |
| 5014 | public string AfterId { get; set; } |
| 5015 | public string BeforeId { get; set; } |
| 5016 | public ResponseItemCollectionOrder? Order { get; set; } |
| 5017 | public int? PageSizeLimit { get; set; } |
| 5018 | } |
| 5019 | [Experimental("OPENAI001")] |
| 5020 | public readonly partial struct ResponseItemCollectionOrder : IEquatable<ResponseItemCollectionOrder> { |
| 5021 | public ResponseItemCollectionOrder(string value); |
| 5022 | public static ResponseItemCollectionOrder Ascending { get; } |
| 5023 | public static ResponseItemCollectionOrder Descending { get; } |
| 5024 | public readonly bool Equals(ResponseItemCollectionOrder other); |
| 5025 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5026 | public override readonly bool Equals(object obj); |
| 5027 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5028 | public override readonly int GetHashCode(); |
| 5029 | public static bool operator ==(ResponseItemCollectionOrder left, ResponseItemCollectionOrder right); |
| 5030 | public static implicit operator ResponseItemCollectionOrder(string value); |
| 5031 | public static bool operator !=(ResponseItemCollectionOrder left, ResponseItemCollectionOrder right); |
| 5032 | public override readonly string ToString(); |
| 5033 | } |
| 5034 | [Experimental("OPENAI001")] |
| 5035 | public class ResponseMessageAnnotation : IJsonModel<ResponseMessageAnnotation>, IPersistableModel<ResponseMessageAnnotation> { |
| 5036 | public string FileCitationFileId { get; } |
| 5037 | public int? FileCitationIndex { get; } |
| 5038 | public string FilePathFileId { get; } |
| 5039 | public int? FilePathIndex { get; } |
| 5040 | public ResponseMessageAnnotationKind Kind { get; } |
| 5041 | public int? UriCitationEndIndex { get; } |
| 5042 | public int? UriCitationStartIndex { get; } |
| 5043 | public string UriCitationTitle { get; } |
| 5044 | public Uri UriCitationUri { get; } |
| 5045 | [Experimental("OPENAI001")] |
| 5046 | protected virtual ResponseMessageAnnotation JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5047 | [Experimental("OPENAI001")] |
| 5048 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5049 | [Experimental("OPENAI001")] |
| 5050 | protected virtual ResponseMessageAnnotation PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5051 | [Experimental("OPENAI001")] |
| 5052 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5053 | } |
| 5054 | [Experimental("OPENAI001")] |
| 5055 | public enum ResponseMessageAnnotationKind { |
| 5056 | FileCitation = 0, |
| 5057 | UriCitation = 1, |
| 5058 | FilePath = 2, |
| 5059 | ContainerFileCitation = 3 |
| 5060 | } |
| 5061 | [Experimental("OPENAI001")] |
| 5062 | public class ResponseOutputTokenUsageDetails : IJsonModel<ResponseOutputTokenUsageDetails>, IPersistableModel<ResponseOutputTokenUsageDetails> { |
| 5063 | public int ReasoningTokenCount { get; } |
| 5064 | [Experimental("OPENAI001")] |
| 5065 | protected virtual ResponseOutputTokenUsageDetails JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5066 | [Experimental("OPENAI001")] |
| 5067 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5068 | [Experimental("OPENAI001")] |
| 5069 | protected virtual ResponseOutputTokenUsageDetails PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5070 | [Experimental("OPENAI001")] |
| 5071 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5072 | } |
| 5073 | [Experimental("OPENAI001")] |
| 5074 | public readonly partial struct ResponseReasoningEffortLevel : IEquatable<ResponseReasoningEffortLevel> { |
| 5075 | public ResponseReasoningEffortLevel(string value); |
| 5076 | public static ResponseReasoningEffortLevel High { get; } |
| 5077 | public static ResponseReasoningEffortLevel Low { get; } |
| 5078 | public static ResponseReasoningEffortLevel Medium { get; } |
| 5079 | public readonly bool Equals(ResponseReasoningEffortLevel other); |
| 5080 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5081 | public override readonly bool Equals(object obj); |
| 5082 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5083 | public override readonly int GetHashCode(); |
| 5084 | public static bool operator ==(ResponseReasoningEffortLevel left, ResponseReasoningEffortLevel right); |
| 5085 | public static implicit operator ResponseReasoningEffortLevel(string value); |
| 5086 | public static bool operator !=(ResponseReasoningEffortLevel left, ResponseReasoningEffortLevel right); |
| 5087 | public override readonly string ToString(); |
| 5088 | } |
| 5089 | [Experimental("OPENAI001")] |
| 5090 | public class ResponseReasoningOptions : IJsonModel<ResponseReasoningOptions>, IPersistableModel<ResponseReasoningOptions> { |
| 5091 | public ResponseReasoningEffortLevel? ReasoningEffortLevel { get; set; } |
| 5092 | public ResponseReasoningSummaryVerbosity? ReasoningSummaryVerbosity { get; set; } |
| 5093 | [Experimental("OPENAI001")] |
| 5094 | protected virtual ResponseReasoningOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5095 | [Experimental("OPENAI001")] |
| 5096 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5097 | [Experimental("OPENAI001")] |
| 5098 | protected virtual ResponseReasoningOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5099 | [Experimental("OPENAI001")] |
| 5100 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5101 | } |
| 5102 | [Experimental("OPENAI001")] |
| 5103 | public readonly partial struct ResponseReasoningSummaryVerbosity : IEquatable<ResponseReasoningSummaryVerbosity> { |
| 5104 | public ResponseReasoningSummaryVerbosity(string value); |
| 5105 | public static ResponseReasoningSummaryVerbosity Auto { get; } |
| 5106 | public static ResponseReasoningSummaryVerbosity Concise { get; } |
| 5107 | public static ResponseReasoningSummaryVerbosity Detailed { get; } |
| 5108 | public readonly bool Equals(ResponseReasoningSummaryVerbosity other); |
| 5109 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5110 | public override readonly bool Equals(object obj); |
| 5111 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5112 | public override readonly int GetHashCode(); |
| 5113 | public static bool operator ==(ResponseReasoningSummaryVerbosity left, ResponseReasoningSummaryVerbosity right); |
| 5114 | public static implicit operator ResponseReasoningSummaryVerbosity(string value); |
| 5115 | public static bool operator !=(ResponseReasoningSummaryVerbosity left, ResponseReasoningSummaryVerbosity right); |
| 5116 | public override readonly string ToString(); |
| 5117 | } |
| 5118 | [Experimental("OPENAI001")] |
| 5119 | public enum ResponseStatus { |
| 5120 | InProgress = 0, |
| 5121 | Completed = 1, |
| 5122 | Cancelled = 2, |
| 5123 | Queued = 3, |
| 5124 | Incomplete = 4, |
| 5125 | Failed = 5 |
| 5126 | } |
| 5127 | [Experimental("OPENAI001")] |
| 5128 | public class ResponseTextFormat : IJsonModel<ResponseTextFormat>, IPersistableModel<ResponseTextFormat> { |
| 5129 | public ResponseTextFormatKind Kind { get; set; } |
| 5130 | public static ResponseTextFormat CreateJsonObjectFormat(); |
| 5131 | public static ResponseTextFormat CreateJsonSchemaFormat(string jsonSchemaFormatName, BinaryData jsonSchema, string jsonSchemaFormatDescription = null, bool? jsonSchemaIsStrict = null); |
| 5132 | public static ResponseTextFormat CreateTextFormat(); |
| 5133 | [Experimental("OPENAI001")] |
| 5134 | protected virtual ResponseTextFormat JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5135 | [Experimental("OPENAI001")] |
| 5136 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5137 | [Experimental("OPENAI001")] |
| 5138 | protected virtual ResponseTextFormat PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5139 | [Experimental("OPENAI001")] |
| 5140 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5141 | } |
| 5142 | [Experimental("OPENAI001")] |
| 5143 | public enum ResponseTextFormatKind { |
| 5144 | Unknown = 0, |
| 5145 | Text = 1, |
| 5146 | JsonObject = 2, |
| 5147 | JsonSchema = 3 |
| 5148 | } |
| 5149 | [Experimental("OPENAI001")] |
| 5150 | public class ResponseTextOptions : IJsonModel<ResponseTextOptions>, IPersistableModel<ResponseTextOptions> { |
| 5151 | public ResponseTextFormat TextFormat { get; set; } |
| 5152 | [Experimental("OPENAI001")] |
| 5153 | protected virtual ResponseTextOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5154 | [Experimental("OPENAI001")] |
| 5155 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5156 | [Experimental("OPENAI001")] |
| 5157 | protected virtual ResponseTextOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5158 | [Experimental("OPENAI001")] |
| 5159 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5160 | } |
| 5161 | [Experimental("OPENAI001")] |
| 5162 | public class ResponseTokenUsage : IJsonModel<ResponseTokenUsage>, IPersistableModel<ResponseTokenUsage> { |
| 5163 | public int InputTokenCount { get; } |
| 5164 | public ResponseInputTokenUsageDetails InputTokenDetails { get; } |
| 5165 | public int OutputTokenCount { get; } |
| 5166 | public ResponseOutputTokenUsageDetails OutputTokenDetails { get; } |
| 5167 | public int TotalTokenCount { get; } |
| 5168 | [Experimental("OPENAI001")] |
| 5169 | protected virtual ResponseTokenUsage JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5170 | [Experimental("OPENAI001")] |
| 5171 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5172 | [Experimental("OPENAI001")] |
| 5173 | protected virtual ResponseTokenUsage PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5174 | [Experimental("OPENAI001")] |
| 5175 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5176 | } |
| 5177 | [Experimental("OPENAI001")] |
| 5178 | public class ResponseTool : IJsonModel<ResponseTool>, IPersistableModel<ResponseTool> { |
| 5179 | [Experimental("OPENAICUA001")] |
| 5180 | public static ResponseTool CreateComputerTool(ComputerToolEnvironment environment, int displayWidth, int displayHeight); |
| 5181 | public static ResponseTool CreateFileSearchTool(IEnumerable<string> vectorStoreIds, int? maxResultCount = null, FileSearchToolRankingOptions rankingOptions = null, BinaryData filters = null); |
| 5182 | public static ResponseTool CreateFunctionTool(string functionName, string functionDescription, BinaryData functionParameters, bool functionSchemaIsStrict = false); |
| 5183 | public static ResponseTool CreateWebSearchTool(WebSearchUserLocation userLocation = null, WebSearchContextSize? searchContextSize = null); |
| 5184 | [Experimental("OPENAI001")] |
| 5185 | protected virtual ResponseTool JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5186 | [Experimental("OPENAI001")] |
| 5187 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5188 | [Experimental("OPENAI001")] |
| 5189 | protected virtual ResponseTool PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5190 | [Experimental("OPENAI001")] |
| 5191 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5192 | } |
| 5193 | [Experimental("OPENAI001")] |
| 5194 | public class ResponseToolChoice : IJsonModel<ResponseToolChoice>, IPersistableModel<ResponseToolChoice> { |
| 5195 | public string FunctionName { get; } |
| 5196 | public ResponseToolChoiceKind Kind { get; } |
| 5197 | public static ResponseToolChoice CreateAutoChoice(); |
| 5198 | [Experimental("OPENAICUA001")] |
| 5199 | public static ResponseToolChoice CreateComputerChoice(); |
| 5200 | public static ResponseToolChoice CreateFileSearchChoice(); |
| 5201 | public static ResponseToolChoice CreateFunctionChoice(string functionName); |
| 5202 | public static ResponseToolChoice CreateNoneChoice(); |
| 5203 | public static ResponseToolChoice CreateRequiredChoice(); |
| 5204 | public static ResponseToolChoice CreateWebSearchChoice(); |
| 5205 | } |
| 5206 | [Experimental("OPENAI001")] |
| 5207 | public enum ResponseToolChoiceKind { |
| 5208 | Unknown = 0, |
| 5209 | Auto = 1, |
| 5210 | None = 2, |
| 5211 | Required = 3, |
| 5212 | Function = 4, |
| 5213 | FileSearch = 5, |
| 5214 | WebSearch = 6, |
| 5215 | Computer = 7 |
| 5216 | } |
| 5217 | [Experimental("OPENAI001")] |
| 5218 | public readonly partial struct ResponseTruncationMode : IEquatable<ResponseTruncationMode> { |
| 5219 | public ResponseTruncationMode(string value); |
| 5220 | public static ResponseTruncationMode Auto { get; } |
| 5221 | public static ResponseTruncationMode Disabled { get; } |
| 5222 | public readonly bool Equals(ResponseTruncationMode other); |
| 5223 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5224 | public override readonly bool Equals(object obj); |
| 5225 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5226 | public override readonly int GetHashCode(); |
| 5227 | public static bool operator ==(ResponseTruncationMode left, ResponseTruncationMode right); |
| 5228 | public static implicit operator ResponseTruncationMode(string value); |
| 5229 | public static bool operator !=(ResponseTruncationMode left, ResponseTruncationMode right); |
| 5230 | public override readonly string ToString(); |
| 5231 | } |
| 5232 | [Experimental("OPENAI001")] |
| 5233 | public class StreamingResponseCompletedUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseCompletedUpdate>, IPersistableModel<StreamingResponseCompletedUpdate> { |
| 5234 | public OpenAIResponse Response { get; } |
| 5235 | [Experimental("OPENAI001")] |
| 5236 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5237 | [Experimental("OPENAI001")] |
| 5238 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5239 | [Experimental("OPENAI001")] |
| 5240 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5241 | [Experimental("OPENAI001")] |
| 5242 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5243 | } |
| 5244 | [Experimental("OPENAI001")] |
| 5245 | public class StreamingResponseContentPartAddedUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseContentPartAddedUpdate>, IPersistableModel<StreamingResponseContentPartAddedUpdate> { |
| 5246 | public int ContentIndex { get; } |
| 5247 | public string ItemId { get; } |
| 5248 | public int OutputIndex { get; } |
| 5249 | public ResponseContentPart Part { get; } |
| 5250 | [Experimental("OPENAI001")] |
| 5251 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5252 | [Experimental("OPENAI001")] |
| 5253 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5254 | [Experimental("OPENAI001")] |
| 5255 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5256 | [Experimental("OPENAI001")] |
| 5257 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5258 | } |
| 5259 | [Experimental("OPENAI001")] |
| 5260 | public class StreamingResponseContentPartDoneUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseContentPartDoneUpdate>, IPersistableModel<StreamingResponseContentPartDoneUpdate> { |
| 5261 | public int ContentIndex { get; } |
| 5262 | public string ItemId { get; } |
| 5263 | public int OutputIndex { get; } |
| 5264 | public ResponseContentPart Part { get; } |
| 5265 | [Experimental("OPENAI001")] |
| 5266 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5267 | [Experimental("OPENAI001")] |
| 5268 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5269 | [Experimental("OPENAI001")] |
| 5270 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5271 | [Experimental("OPENAI001")] |
| 5272 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5273 | } |
| 5274 | [Experimental("OPENAI001")] |
| 5275 | public class StreamingResponseCreatedUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseCreatedUpdate>, IPersistableModel<StreamingResponseCreatedUpdate> { |
| 5276 | public OpenAIResponse Response { get; } |
| 5277 | [Experimental("OPENAI001")] |
| 5278 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5279 | [Experimental("OPENAI001")] |
| 5280 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5281 | [Experimental("OPENAI001")] |
| 5282 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5283 | [Experimental("OPENAI001")] |
| 5284 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5285 | } |
| 5286 | [Experimental("OPENAI001")] |
| 5287 | public class StreamingResponseErrorUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseErrorUpdate>, IPersistableModel<StreamingResponseErrorUpdate> { |
| 5288 | public string Code { get; } |
| 5289 | public string Message { get; } |
| 5290 | public string Param { get; } |
| 5291 | [Experimental("OPENAI001")] |
| 5292 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5293 | [Experimental("OPENAI001")] |
| 5294 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5295 | [Experimental("OPENAI001")] |
| 5296 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5297 | [Experimental("OPENAI001")] |
| 5298 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5299 | } |
| 5300 | [Experimental("OPENAI001")] |
| 5301 | public class StreamingResponseFailedUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseFailedUpdate>, IPersistableModel<StreamingResponseFailedUpdate> { |
| 5302 | public OpenAIResponse Response { get; } |
| 5303 | [Experimental("OPENAI001")] |
| 5304 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5305 | [Experimental("OPENAI001")] |
| 5306 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5307 | [Experimental("OPENAI001")] |
| 5308 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5309 | [Experimental("OPENAI001")] |
| 5310 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5311 | } |
| 5312 | [Experimental("OPENAI001")] |
| 5313 | public class StreamingResponseFileSearchCallCompletedUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseFileSearchCallCompletedUpdate>, IPersistableModel<StreamingResponseFileSearchCallCompletedUpdate> { |
| 5314 | public string ItemId { get; } |
| 5315 | public int OutputIndex { get; } |
| 5316 | [Experimental("OPENAI001")] |
| 5317 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5318 | [Experimental("OPENAI001")] |
| 5319 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5320 | [Experimental("OPENAI001")] |
| 5321 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5322 | [Experimental("OPENAI001")] |
| 5323 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5324 | } |
| 5325 | [Experimental("OPENAI001")] |
| 5326 | public class StreamingResponseFileSearchCallInProgressUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseFileSearchCallInProgressUpdate>, IPersistableModel<StreamingResponseFileSearchCallInProgressUpdate> { |
| 5327 | public string ItemId { get; } |
| 5328 | public int OutputIndex { get; } |
| 5329 | [Experimental("OPENAI001")] |
| 5330 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5331 | [Experimental("OPENAI001")] |
| 5332 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5333 | [Experimental("OPENAI001")] |
| 5334 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5335 | [Experimental("OPENAI001")] |
| 5336 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5337 | } |
| 5338 | [Experimental("OPENAI001")] |
| 5339 | public class StreamingResponseFileSearchCallSearchingUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseFileSearchCallSearchingUpdate>, IPersistableModel<StreamingResponseFileSearchCallSearchingUpdate> { |
| 5340 | public string ItemId { get; } |
| 5341 | public int OutputIndex { get; } |
| 5342 | [Experimental("OPENAI001")] |
| 5343 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5344 | [Experimental("OPENAI001")] |
| 5345 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5346 | [Experimental("OPENAI001")] |
| 5347 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5348 | [Experimental("OPENAI001")] |
| 5349 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5350 | } |
| 5351 | [Experimental("OPENAI001")] |
| 5352 | public class StreamingResponseFunctionCallArgumentsDeltaUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseFunctionCallArgumentsDeltaUpdate>, IPersistableModel<StreamingResponseFunctionCallArgumentsDeltaUpdate> { |
| 5353 | public string Delta { get; } |
| 5354 | public string ItemId { get; } |
| 5355 | public int OutputIndex { get; } |
| 5356 | [Experimental("OPENAI001")] |
| 5357 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5358 | [Experimental("OPENAI001")] |
| 5359 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5360 | [Experimental("OPENAI001")] |
| 5361 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5362 | [Experimental("OPENAI001")] |
| 5363 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5364 | } |
| 5365 | [Experimental("OPENAI001")] |
| 5366 | public class StreamingResponseFunctionCallArgumentsDoneUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseFunctionCallArgumentsDoneUpdate>, IPersistableModel<StreamingResponseFunctionCallArgumentsDoneUpdate> { |
| 5367 | public string Arguments { get; } |
| 5368 | public string ItemId { get; } |
| 5369 | public int OutputIndex { get; } |
| 5370 | [Experimental("OPENAI001")] |
| 5371 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5372 | [Experimental("OPENAI001")] |
| 5373 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5374 | [Experimental("OPENAI001")] |
| 5375 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5376 | [Experimental("OPENAI001")] |
| 5377 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5378 | } |
| 5379 | [Experimental("OPENAI001")] |
| 5380 | public class StreamingResponseIncompleteUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseIncompleteUpdate>, IPersistableModel<StreamingResponseIncompleteUpdate> { |
| 5381 | public OpenAIResponse Response { get; } |
| 5382 | [Experimental("OPENAI001")] |
| 5383 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5384 | [Experimental("OPENAI001")] |
| 5385 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5386 | [Experimental("OPENAI001")] |
| 5387 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5388 | [Experimental("OPENAI001")] |
| 5389 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5390 | } |
| 5391 | [Experimental("OPENAI001")] |
| 5392 | public class StreamingResponseInProgressUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseInProgressUpdate>, IPersistableModel<StreamingResponseInProgressUpdate> { |
| 5393 | public OpenAIResponse Response { get; } |
| 5394 | [Experimental("OPENAI001")] |
| 5395 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5396 | [Experimental("OPENAI001")] |
| 5397 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5398 | [Experimental("OPENAI001")] |
| 5399 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5400 | [Experimental("OPENAI001")] |
| 5401 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5402 | } |
| 5403 | [Experimental("OPENAI001")] |
| 5404 | public class StreamingResponseOutputItemAddedUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseOutputItemAddedUpdate>, IPersistableModel<StreamingResponseOutputItemAddedUpdate> { |
| 5405 | public ResponseItem Item { get; } |
| 5406 | public int OutputIndex { get; } |
| 5407 | [Experimental("OPENAI001")] |
| 5408 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5409 | [Experimental("OPENAI001")] |
| 5410 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5411 | [Experimental("OPENAI001")] |
| 5412 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5413 | [Experimental("OPENAI001")] |
| 5414 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5415 | } |
| 5416 | [Experimental("OPENAI001")] |
| 5417 | public class StreamingResponseOutputItemDoneUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseOutputItemDoneUpdate>, IPersistableModel<StreamingResponseOutputItemDoneUpdate> { |
| 5418 | public ResponseItem Item { get; } |
| 5419 | public int OutputIndex { get; } |
| 5420 | [Experimental("OPENAI001")] |
| 5421 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5422 | [Experimental("OPENAI001")] |
| 5423 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5424 | [Experimental("OPENAI001")] |
| 5425 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5426 | [Experimental("OPENAI001")] |
| 5427 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5428 | } |
| 5429 | [Experimental("OPENAI001")] |
| 5430 | public class StreamingResponseOutputTextDeltaUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseOutputTextDeltaUpdate>, IPersistableModel<StreamingResponseOutputTextDeltaUpdate> { |
| 5431 | public int ContentIndex { get; } |
| 5432 | public string Delta { get; } |
| 5433 | public string ItemId { get; } |
| 5434 | public int OutputIndex { get; } |
| 5435 | [Experimental("OPENAI001")] |
| 5436 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5437 | [Experimental("OPENAI001")] |
| 5438 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5439 | [Experimental("OPENAI001")] |
| 5440 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5441 | [Experimental("OPENAI001")] |
| 5442 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5443 | } |
| 5444 | [Experimental("OPENAI001")] |
| 5445 | public class StreamingResponseOutputTextDoneUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseOutputTextDoneUpdate>, IPersistableModel<StreamingResponseOutputTextDoneUpdate> { |
| 5446 | public int ContentIndex { get; } |
| 5447 | public string ItemId { get; } |
| 5448 | public int OutputIndex { get; } |
| 5449 | public string Text { get; } |
| 5450 | [Experimental("OPENAI001")] |
| 5451 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5452 | [Experimental("OPENAI001")] |
| 5453 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5454 | [Experimental("OPENAI001")] |
| 5455 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5456 | [Experimental("OPENAI001")] |
| 5457 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5458 | } |
| 5459 | [Experimental("OPENAI001")] |
| 5460 | public class StreamingResponseQueuedUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseQueuedUpdate>, IPersistableModel<StreamingResponseQueuedUpdate> { |
| 5461 | public OpenAIResponse Response { get; } |
| 5462 | [Experimental("OPENAI001")] |
| 5463 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5464 | [Experimental("OPENAI001")] |
| 5465 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5466 | [Experimental("OPENAI001")] |
| 5467 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5468 | [Experimental("OPENAI001")] |
| 5469 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5470 | } |
| 5471 | [Experimental("OPENAI001")] |
| 5472 | public class StreamingResponseRefusalDeltaUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseRefusalDeltaUpdate>, IPersistableModel<StreamingResponseRefusalDeltaUpdate> { |
| 5473 | public int ContentIndex { get; } |
| 5474 | public string Delta { get; } |
| 5475 | public string ItemId { get; } |
| 5476 | public int OutputIndex { get; } |
| 5477 | [Experimental("OPENAI001")] |
| 5478 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5479 | [Experimental("OPENAI001")] |
| 5480 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5481 | [Experimental("OPENAI001")] |
| 5482 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5483 | [Experimental("OPENAI001")] |
| 5484 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5485 | } |
| 5486 | [Experimental("OPENAI001")] |
| 5487 | public class StreamingResponseRefusalDoneUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseRefusalDoneUpdate>, IPersistableModel<StreamingResponseRefusalDoneUpdate> { |
| 5488 | public int ContentIndex { get; } |
| 5489 | public string ItemId { get; } |
| 5490 | public int OutputIndex { get; } |
| 5491 | public string Refusal { get; } |
| 5492 | [Experimental("OPENAI001")] |
| 5493 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5494 | [Experimental("OPENAI001")] |
| 5495 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5496 | [Experimental("OPENAI001")] |
| 5497 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5498 | [Experimental("OPENAI001")] |
| 5499 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5500 | } |
| 5501 | [Experimental("OPENAI001")] |
| 5502 | public class StreamingResponseTextAnnotationAddedUpdate { |
| 5503 | } |
| 5504 | [Experimental("OPENAI001")] |
| 5505 | public class StreamingResponseUpdate : IJsonModel<StreamingResponseUpdate>, IPersistableModel<StreamingResponseUpdate> { |
| 5506 | public int SequenceNumber { get; } |
| 5507 | [Experimental("OPENAI001")] |
| 5508 | protected virtual StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5509 | [Experimental("OPENAI001")] |
| 5510 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5511 | [Experimental("OPENAI001")] |
| 5512 | protected virtual StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5513 | [Experimental("OPENAI001")] |
| 5514 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5515 | } |
| 5516 | [Experimental("OPENAI001")] |
| 5517 | public class StreamingResponseWebSearchCallCompletedUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseWebSearchCallCompletedUpdate>, IPersistableModel<StreamingResponseWebSearchCallCompletedUpdate> { |
| 5518 | public string ItemId { get; } |
| 5519 | public int OutputIndex { get; } |
| 5520 | [Experimental("OPENAI001")] |
| 5521 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5522 | [Experimental("OPENAI001")] |
| 5523 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5524 | [Experimental("OPENAI001")] |
| 5525 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5526 | [Experimental("OPENAI001")] |
| 5527 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5528 | } |
| 5529 | [Experimental("OPENAI001")] |
| 5530 | public class StreamingResponseWebSearchCallInProgressUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseWebSearchCallInProgressUpdate>, IPersistableModel<StreamingResponseWebSearchCallInProgressUpdate> { |
| 5531 | public string ItemId { get; } |
| 5532 | public int OutputIndex { get; } |
| 5533 | [Experimental("OPENAI001")] |
| 5534 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5535 | [Experimental("OPENAI001")] |
| 5536 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5537 | [Experimental("OPENAI001")] |
| 5538 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5539 | [Experimental("OPENAI001")] |
| 5540 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5541 | } |
| 5542 | [Experimental("OPENAI001")] |
| 5543 | public class StreamingResponseWebSearchCallSearchingUpdate : StreamingResponseUpdate, IJsonModel<StreamingResponseWebSearchCallSearchingUpdate>, IPersistableModel<StreamingResponseWebSearchCallSearchingUpdate> { |
| 5544 | public string ItemId { get; } |
| 5545 | public int OutputIndex { get; } |
| 5546 | [Experimental("OPENAI001")] |
| 5547 | protected override StreamingResponseUpdate JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5548 | [Experimental("OPENAI001")] |
| 5549 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5550 | [Experimental("OPENAI001")] |
| 5551 | protected override StreamingResponseUpdate PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5552 | [Experimental("OPENAI001")] |
| 5553 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5554 | } |
| 5555 | [Experimental("OPENAI001")] |
| 5556 | public class WebSearchCallResponseItem : ResponseItem, IJsonModel<WebSearchCallResponseItem>, IPersistableModel<WebSearchCallResponseItem> { |
| 5557 | public WebSearchCallStatus? Status { get; } |
| 5558 | [Experimental("OPENAI001")] |
| 5559 | protected override ResponseItem JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5560 | [Experimental("OPENAI001")] |
| 5561 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5562 | [Experimental("OPENAI001")] |
| 5563 | protected override ResponseItem PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5564 | [Experimental("OPENAI001")] |
| 5565 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5566 | } |
| 5567 | [Experimental("OPENAI001")] |
| 5568 | public enum WebSearchCallStatus { |
| 5569 | InProgress = 0, |
| 5570 | Searching = 1, |
| 5571 | Completed = 2, |
| 5572 | Failed = 3 |
| 5573 | } |
| 5574 | [Experimental("OPENAI001")] |
| 5575 | public readonly partial struct WebSearchContextSize : IEquatable<WebSearchContextSize> { |
| 5576 | public WebSearchContextSize(string value); |
| 5577 | public static WebSearchContextSize High { get; } |
| 5578 | public static WebSearchContextSize Low { get; } |
| 5579 | public static WebSearchContextSize Medium { get; } |
| 5580 | public readonly bool Equals(WebSearchContextSize other); |
| 5581 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5582 | public override readonly bool Equals(object obj); |
| 5583 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5584 | public override readonly int GetHashCode(); |
| 5585 | public static bool operator ==(WebSearchContextSize left, WebSearchContextSize right); |
| 5586 | public static implicit operator WebSearchContextSize(string value); |
| 5587 | public static bool operator !=(WebSearchContextSize left, WebSearchContextSize right); |
| 5588 | public override readonly string ToString(); |
| 5589 | } |
| 5590 | [Experimental("OPENAI001")] |
| 5591 | public class WebSearchUserLocation : IJsonModel<WebSearchUserLocation>, IPersistableModel<WebSearchUserLocation> { |
| 5592 | public static WebSearchUserLocation CreateApproximateLocation(string country = null, string region = null, string city = null, string timezone = null); |
| 5593 | [Experimental("OPENAI001")] |
| 5594 | protected virtual WebSearchUserLocation JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5595 | [Experimental("OPENAI001")] |
| 5596 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5597 | [Experimental("OPENAI001")] |
| 5598 | protected virtual WebSearchUserLocation PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5599 | [Experimental("OPENAI001")] |
| 5600 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5601 | } |
| 5602 | } |
| 5603 | namespace OpenAI.VectorStores { |
| 5604 | [Experimental("OPENAI001")] |
| 5605 | public class AddFileToVectorStoreOperation : OperationResult { |
| 5606 | public string FileId { get; } |
| 5607 | public override ContinuationToken? RehydrationToken { get; protected set; } |
| 5608 | public VectorStoreFileAssociationStatus? Status { get; } |
| 5609 | public VectorStoreFileAssociation? Value { get; } |
| 5610 | public string VectorStoreId { get; } |
| 5611 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5612 | public virtual ClientResult GetFileAssociation(RequestOptions? options); |
| 5613 | public virtual ClientResult<VectorStoreFileAssociation> GetFileAssociation(CancellationToken cancellationToken = default); |
| 5614 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5615 | public virtual Task<ClientResult> GetFileAssociationAsync(RequestOptions? options); |
| 5616 | public virtual Task<ClientResult<VectorStoreFileAssociation>> GetFileAssociationAsync(CancellationToken cancellationToken = default); |
| 5617 | public static AddFileToVectorStoreOperation Rehydrate(VectorStoreClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default); |
| 5618 | public static Task<AddFileToVectorStoreOperation> RehydrateAsync(VectorStoreClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default); |
| 5619 | public override ClientResult UpdateStatus(RequestOptions? options = null); |
| 5620 | public override ValueTask<ClientResult> UpdateStatusAsync(RequestOptions? options = null); |
| 5621 | } |
| 5622 | [Experimental("OPENAI001")] |
| 5623 | public class CreateBatchFileJobOperation : OperationResult { |
| 5624 | public string BatchId { get; } |
| 5625 | public override ContinuationToken? RehydrationToken { get; protected set; } |
| 5626 | public VectorStoreBatchFileJobStatus? Status { get; } |
| 5627 | public VectorStoreBatchFileJob? Value { get; } |
| 5628 | public string VectorStoreId { get; } |
| 5629 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5630 | public virtual ClientResult Cancel(RequestOptions? options); |
| 5631 | public virtual ClientResult<VectorStoreBatchFileJob> Cancel(CancellationToken cancellationToken = default); |
| 5632 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5633 | public virtual Task<ClientResult> CancelAsync(RequestOptions? options); |
| 5634 | public virtual Task<ClientResult<VectorStoreBatchFileJob>> CancelAsync(CancellationToken cancellationToken = default); |
| 5635 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5636 | public virtual ClientResult GetFileBatch(RequestOptions? options); |
| 5637 | public virtual ClientResult<VectorStoreBatchFileJob> GetFileBatch(CancellationToken cancellationToken = default); |
| 5638 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5639 | public virtual Task<ClientResult> GetFileBatchAsync(RequestOptions? options); |
| 5640 | public virtual Task<ClientResult<VectorStoreBatchFileJob>> GetFileBatchAsync(CancellationToken cancellationToken = default); |
| 5641 | public static CreateBatchFileJobOperation Rehydrate(VectorStoreClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default); |
| 5642 | public static Task<CreateBatchFileJobOperation> RehydrateAsync(VectorStoreClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default); |
| 5643 | public override ClientResult UpdateStatus(RequestOptions? options = null); |
| 5644 | public override ValueTask<ClientResult> UpdateStatusAsync(RequestOptions? options = null); |
| 5645 | } |
| 5646 | [Experimental("OPENAI001")] |
| 5647 | public class CreateVectorStoreOperation : OperationResult { |
| 5648 | public override ContinuationToken? RehydrationToken { get; protected set; } |
| 5649 | public VectorStoreStatus? Status { get; } |
| 5650 | public VectorStore? Value { get; } |
| 5651 | public string VectorStoreId { get; } |
| 5652 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5653 | public virtual ClientResult GetVectorStore(RequestOptions? options); |
| 5654 | public virtual ClientResult<VectorStore> GetVectorStore(CancellationToken cancellationToken = default); |
| 5655 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5656 | public virtual Task<ClientResult> GetVectorStoreAsync(RequestOptions? options); |
| 5657 | public virtual Task<ClientResult<VectorStore>> GetVectorStoreAsync(CancellationToken cancellationToken = default); |
| 5658 | public static CreateVectorStoreOperation Rehydrate(VectorStoreClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default); |
| 5659 | public static Task<CreateVectorStoreOperation> RehydrateAsync(VectorStoreClient client, ContinuationToken rehydrationToken, CancellationToken cancellationToken = default); |
| 5660 | public override ClientResult UpdateStatus(RequestOptions? options = null); |
| 5661 | public override ValueTask<ClientResult> UpdateStatusAsync(RequestOptions? options = null); |
| 5662 | } |
| 5663 | [Experimental("OPENAI001")] |
| 5664 | public abstract class FileChunkingStrategy : IJsonModel<FileChunkingStrategy>, IPersistableModel<FileChunkingStrategy> { |
| 5665 | public static FileChunkingStrategy Auto { get; } |
| 5666 | public static FileChunkingStrategy Unknown { get; } |
| 5667 | public static FileChunkingStrategy CreateStaticStrategy(int maxTokensPerChunk, int overlappingTokenCount); |
| 5668 | [Experimental("OPENAI001")] |
| 5669 | protected virtual FileChunkingStrategy JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5670 | [Experimental("OPENAI001")] |
| 5671 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5672 | [Experimental("OPENAI001")] |
| 5673 | protected virtual FileChunkingStrategy PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5674 | [Experimental("OPENAI001")] |
| 5675 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5676 | } |
| 5677 | [Experimental("OPENAI001")] |
| 5678 | public class FileFromStoreRemovalResult : IJsonModel<FileFromStoreRemovalResult>, IPersistableModel<FileFromStoreRemovalResult> { |
| 5679 | public string FileId { get; } |
| 5680 | public bool Removed { get; } |
| 5681 | [Experimental("OPENAI001")] |
| 5682 | protected virtual FileFromStoreRemovalResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5683 | [Experimental("OPENAI001")] |
| 5684 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5685 | [Experimental("OPENAI001")] |
| 5686 | protected virtual FileFromStoreRemovalResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5687 | [Experimental("OPENAI001")] |
| 5688 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5689 | } |
| 5690 | [Experimental("OPENAI001")] |
| 5691 | public class StaticFileChunkingStrategy : FileChunkingStrategy, IJsonModel<StaticFileChunkingStrategy>, IPersistableModel<StaticFileChunkingStrategy> { |
| 5692 | public StaticFileChunkingStrategy(int maxTokensPerChunk, int overlappingTokenCount); |
| 5693 | public int MaxTokensPerChunk { get; } |
| 5694 | public int OverlappingTokenCount { get; } |
| 5695 | [Experimental("OPENAI001")] |
| 5696 | protected override FileChunkingStrategy JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5697 | [Experimental("OPENAI001")] |
| 5698 | protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5699 | [Experimental("OPENAI001")] |
| 5700 | protected override FileChunkingStrategy PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5701 | [Experimental("OPENAI001")] |
| 5702 | protected override BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5703 | } |
| 5704 | [Experimental("OPENAI001")] |
| 5705 | public class VectorStore : IJsonModel<VectorStore>, IPersistableModel<VectorStore> { |
| 5706 | public DateTimeOffset CreatedAt { get; } |
| 5707 | public VectorStoreExpirationPolicy ExpirationPolicy { get; } |
| 5708 | public DateTimeOffset? ExpiresAt { get; } |
| 5709 | public VectorStoreFileCounts FileCounts { get; } |
| 5710 | public string Id { get; } |
| 5711 | public DateTimeOffset? LastActiveAt { get; } |
| 5712 | public IReadOnlyDictionary<string, string> Metadata { get; } |
| 5713 | public string Name { get; } |
| 5714 | public VectorStoreStatus Status { get; } |
| 5715 | public int UsageBytes { get; } |
| 5716 | [Experimental("OPENAI001")] |
| 5717 | protected virtual VectorStore JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5718 | [Experimental("OPENAI001")] |
| 5719 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5720 | [Experimental("OPENAI001")] |
| 5721 | protected virtual VectorStore PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5722 | [Experimental("OPENAI001")] |
| 5723 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5724 | } |
| 5725 | [Experimental("OPENAI001")] |
| 5726 | public class VectorStoreBatchFileJob : IJsonModel<VectorStoreBatchFileJob>, IPersistableModel<VectorStoreBatchFileJob> { |
| 5727 | public string BatchId { get; } |
| 5728 | public DateTimeOffset CreatedAt { get; } |
| 5729 | public VectorStoreFileCounts FileCounts { get; } |
| 5730 | public VectorStoreBatchFileJobStatus Status { get; } |
| 5731 | public string VectorStoreId { get; } |
| 5732 | [Experimental("OPENAI001")] |
| 5733 | protected virtual VectorStoreBatchFileJob JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5734 | [Experimental("OPENAI001")] |
| 5735 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5736 | [Experimental("OPENAI001")] |
| 5737 | protected virtual VectorStoreBatchFileJob PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5738 | [Experimental("OPENAI001")] |
| 5739 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5740 | } |
| 5741 | [Experimental("OPENAI001")] |
| 5742 | public readonly partial struct VectorStoreBatchFileJobStatus : IEquatable<VectorStoreBatchFileJobStatus> { |
| 5743 | public VectorStoreBatchFileJobStatus(string value); |
| 5744 | public static VectorStoreBatchFileJobStatus Cancelled { get; } |
| 5745 | public static VectorStoreBatchFileJobStatus Completed { get; } |
| 5746 | public static VectorStoreBatchFileJobStatus Failed { get; } |
| 5747 | public static VectorStoreBatchFileJobStatus InProgress { get; } |
| 5748 | public readonly bool Equals(VectorStoreBatchFileJobStatus other); |
| 5749 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5750 | public override readonly bool Equals(object obj); |
| 5751 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5752 | public override readonly int GetHashCode(); |
| 5753 | public static bool operator ==(VectorStoreBatchFileJobStatus left, VectorStoreBatchFileJobStatus right); |
| 5754 | public static implicit operator VectorStoreBatchFileJobStatus(string value); |
| 5755 | public static bool operator !=(VectorStoreBatchFileJobStatus left, VectorStoreBatchFileJobStatus right); |
| 5756 | public override readonly string ToString(); |
| 5757 | } |
| 5758 | [Experimental("OPENAI001")] |
| 5759 | public class VectorStoreClient { |
| 5760 | protected VectorStoreClient(); |
| 5761 | public VectorStoreClient(ApiKeyCredential credential, OpenAIClientOptions options); |
| 5762 | public VectorStoreClient(ApiKeyCredential credential); |
| 5763 | protected internal VectorStoreClient(ClientPipeline pipeline, OpenAIClientOptions options); |
| 5764 | public VectorStoreClient(string apiKey); |
| 5765 | public ClientPipeline Pipeline { get; } |
| 5766 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5767 | public virtual AddFileToVectorStoreOperation AddFileToVectorStore(string vectorStoreId, BinaryContent content, bool waitUntilCompleted, RequestOptions options = null); |
| 5768 | public virtual AddFileToVectorStoreOperation AddFileToVectorStore(string vectorStoreId, string fileId, bool waitUntilCompleted, CancellationToken cancellationToken = default); |
| 5769 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5770 | public virtual Task<AddFileToVectorStoreOperation> AddFileToVectorStoreAsync(string vectorStoreId, BinaryContent content, bool waitUntilCompleted, RequestOptions options = null); |
| 5771 | public virtual Task<AddFileToVectorStoreOperation> AddFileToVectorStoreAsync(string vectorStoreId, string fileId, bool waitUntilCompleted, CancellationToken cancellationToken = default); |
| 5772 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5773 | public virtual ClientResult CancelBatchFileJob(string vectorStoreId, string batchId, RequestOptions options); |
| 5774 | public virtual ClientResult<VectorStoreBatchFileJob> CancelBatchFileJob(string vectorStoreId, string batchJobId, CancellationToken cancellationToken = default); |
| 5775 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5776 | public virtual Task<ClientResult> CancelBatchFileJobAsync(string vectorStoreId, string batchId, RequestOptions options); |
| 5777 | public virtual Task<ClientResult<VectorStoreBatchFileJob>> CancelBatchFileJobAsync(string vectorStoreId, string batchJobId, CancellationToken cancellationToken = default); |
| 5778 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5779 | public virtual CreateBatchFileJobOperation CreateBatchFileJob(string vectorStoreId, BinaryContent content, bool waitUntilCompleted, RequestOptions options = null); |
| 5780 | public virtual CreateBatchFileJobOperation CreateBatchFileJob(string vectorStoreId, IEnumerable<string> fileIds, bool waitUntilCompleted, CancellationToken cancellationToken = default); |
| 5781 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5782 | public virtual Task<CreateBatchFileJobOperation> CreateBatchFileJobAsync(string vectorStoreId, BinaryContent content, bool waitUntilCompleted, RequestOptions options = null); |
| 5783 | public virtual Task<CreateBatchFileJobOperation> CreateBatchFileJobAsync(string vectorStoreId, IEnumerable<string> fileIds, bool waitUntilCompleted, CancellationToken cancellationToken = default); |
| 5784 | public virtual CreateVectorStoreOperation CreateVectorStore(bool waitUntilCompleted, VectorStoreCreationOptions options = null, CancellationToken cancellationToken = default); |
| 5785 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5786 | public virtual CreateVectorStoreOperation CreateVectorStore(BinaryContent content, bool waitUntilCompleted, RequestOptions options = null); |
| 5787 | public virtual ClientResult CreateVectorStore(BinaryContent content, RequestOptions options = null); |
| 5788 | public virtual Task<CreateVectorStoreOperation> CreateVectorStoreAsync(bool waitUntilCompleted, VectorStoreCreationOptions options = null, CancellationToken cancellationToken = default); |
| 5789 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5790 | public virtual Task<CreateVectorStoreOperation> CreateVectorStoreAsync(BinaryContent content, bool waitUntilCompleted, RequestOptions options = null); |
| 5791 | public virtual Task<ClientResult> CreateVectorStoreAsync(BinaryContent content, RequestOptions options = null); |
| 5792 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5793 | public virtual ClientResult DeleteVectorStore(string vectorStoreId, RequestOptions options); |
| 5794 | public virtual ClientResult<VectorStoreDeletionResult> DeleteVectorStore(string vectorStoreId, CancellationToken cancellationToken = default); |
| 5795 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5796 | public virtual Task<ClientResult> DeleteVectorStoreAsync(string vectorStoreId, RequestOptions options); |
| 5797 | public virtual Task<ClientResult<VectorStoreDeletionResult>> DeleteVectorStoreAsync(string vectorStoreId, CancellationToken cancellationToken = default); |
| 5798 | public virtual ClientResult<VectorStoreBatchFileJob> GetBatchFileJob(string vectorStoreId, string batchJobId, CancellationToken cancellationToken = default); |
| 5799 | public virtual Task<ClientResult<VectorStoreBatchFileJob>> GetBatchFileJobAsync(string vectorStoreId, string batchJobId, CancellationToken cancellationToken = default); |
| 5800 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5801 | public virtual ClientResult GetFileAssociation(string vectorStoreId, string fileId, RequestOptions options); |
| 5802 | public virtual ClientResult<VectorStoreFileAssociation> GetFileAssociation(string vectorStoreId, string fileId, CancellationToken cancellationToken = default); |
| 5803 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5804 | public virtual Task<ClientResult> GetFileAssociationAsync(string vectorStoreId, string fileId, RequestOptions options); |
| 5805 | public virtual Task<ClientResult<VectorStoreFileAssociation>> GetFileAssociationAsync(string vectorStoreId, string fileId, CancellationToken cancellationToken = default); |
| 5806 | public virtual CollectionResult<VectorStoreFileAssociation> GetFileAssociations(ContinuationToken firstPageToken, CancellationToken cancellationToken = default); |
| 5807 | public virtual CollectionResult<VectorStoreFileAssociation> GetFileAssociations(string vectorStoreId, VectorStoreFileAssociationCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 5808 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5809 | public virtual CollectionResult GetFileAssociations(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options); |
| 5810 | public virtual CollectionResult<VectorStoreFileAssociation> GetFileAssociations(string vectorStoreId, string batchJobId, VectorStoreFileAssociationCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 5811 | public virtual CollectionResult<VectorStoreFileAssociation> GetFileAssociations(string vectorStoreId, string batchJobId, ContinuationToken firstPageToken, CancellationToken cancellationToken = default); |
| 5812 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5813 | public virtual CollectionResult GetFileAssociations(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options); |
| 5814 | public virtual AsyncCollectionResult<VectorStoreFileAssociation> GetFileAssociationsAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default); |
| 5815 | public virtual AsyncCollectionResult<VectorStoreFileAssociation> GetFileAssociationsAsync(string vectorStoreId, VectorStoreFileAssociationCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 5816 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5817 | public virtual AsyncCollectionResult GetFileAssociationsAsync(string vectorStoreId, int? limit, string order, string after, string before, string filter, RequestOptions options); |
| 5818 | public virtual AsyncCollectionResult<VectorStoreFileAssociation> GetFileAssociationsAsync(string vectorStoreId, string batchJobId, VectorStoreFileAssociationCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 5819 | public virtual AsyncCollectionResult<VectorStoreFileAssociation> GetFileAssociationsAsync(string vectorStoreId, string batchJobId, ContinuationToken firstPageToken, CancellationToken cancellationToken = default); |
| 5820 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5821 | public virtual AsyncCollectionResult GetFileAssociationsAsync(string vectorStoreId, string batchId, int? limit, string order, string after, string before, string filter, RequestOptions options); |
| 5822 | public virtual ClientResult<VectorStore> GetVectorStore(string vectorStoreId, CancellationToken cancellationToken = default); |
| 5823 | public virtual CollectionResult<VectorStore> GetVectorStores(VectorStoreCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 5824 | public virtual CollectionResult<VectorStore> GetVectorStores(ContinuationToken firstPageToken, CancellationToken cancellationToken = default); |
| 5825 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5826 | public virtual CollectionResult GetVectorStores(int? limit, string order, string after, string before, RequestOptions options); |
| 5827 | public virtual AsyncCollectionResult<VectorStore> GetVectorStoresAsync(VectorStoreCollectionOptions options = null, CancellationToken cancellationToken = default); |
| 5828 | public virtual AsyncCollectionResult<VectorStore> GetVectorStoresAsync(ContinuationToken firstPageToken, CancellationToken cancellationToken = default); |
| 5829 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5830 | public virtual AsyncCollectionResult GetVectorStoresAsync(int? limit, string order, string after, string before, RequestOptions options); |
| 5831 | public virtual ClientResult<VectorStore> ModifyVectorStore(string vectorStoreId, VectorStoreModificationOptions options, CancellationToken cancellationToken = default); |
| 5832 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5833 | public virtual ClientResult ModifyVectorStore(string vectorStoreId, BinaryContent content, RequestOptions options = null); |
| 5834 | public virtual Task<ClientResult<VectorStore>> ModifyVectorStoreAsync(string vectorStoreId, VectorStoreModificationOptions options, CancellationToken cancellationToken = default); |
| 5835 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5836 | public virtual Task<ClientResult> ModifyVectorStoreAsync(string vectorStoreId, BinaryContent content, RequestOptions options = null); |
| 5837 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5838 | public virtual ClientResult RemoveFileFromStore(string vectorStoreId, string fileId, RequestOptions options); |
| 5839 | public virtual ClientResult<FileFromStoreRemovalResult> RemoveFileFromStore(string vectorStoreId, string fileId, CancellationToken cancellationToken = default); |
| 5840 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5841 | public virtual Task<ClientResult> RemoveFileFromStoreAsync(string vectorStoreId, string fileId, RequestOptions options); |
| 5842 | public virtual Task<ClientResult<FileFromStoreRemovalResult>> RemoveFileFromStoreAsync(string vectorStoreId, string fileId, CancellationToken cancellationToken = default); |
| 5843 | public virtual ClientResult RetrieveVectorStoreFileContent(string vectorStoreId, string fileId, RequestOptions options); |
| 5844 | public virtual Task<ClientResult> RetrieveVectorStoreFileContentAsync(string vectorStoreId, string fileId, RequestOptions options); |
| 5845 | public virtual ClientResult SearchVectorStore(string vectorStoreId, BinaryContent content, RequestOptions options = null); |
| 5846 | public virtual Task<ClientResult> SearchVectorStoreAsync(string vectorStoreId, BinaryContent content, RequestOptions options = null); |
| 5847 | public virtual ClientResult UpdateVectorStoreFileAttributes(string vectorStoreId, string fileId, BinaryContent content, RequestOptions options = null); |
| 5848 | public virtual ClientResult<VectorStoreFileAssociation> UpdateVectorStoreFileAttributes(string vectorStoreId, string fileId, IDictionary<string, BinaryData> attributes, CancellationToken cancellationToken = default); |
| 5849 | public virtual Task<ClientResult> UpdateVectorStoreFileAttributesAsync(string vectorStoreId, string fileId, BinaryContent content, RequestOptions options = null); |
| 5850 | public virtual Task<ClientResult<VectorStoreFileAssociation>> UpdateVectorStoreFileAttributesAsync(string vectorStoreId, string fileId, IDictionary<string, BinaryData> attributes, CancellationToken cancellationToken = default); |
| 5851 | } |
| 5852 | [Experimental("OPENAI001")] |
| 5853 | public class VectorStoreCollectionOptions { |
| 5854 | public string AfterId { get; set; } |
| 5855 | public string BeforeId { get; set; } |
| 5856 | public VectorStoreCollectionOrder? Order { get; set; } |
| 5857 | public int? PageSizeLimit { get; set; } |
| 5858 | } |
| 5859 | [Experimental("OPENAI001")] |
| 5860 | public readonly partial struct VectorStoreCollectionOrder : IEquatable<VectorStoreCollectionOrder> { |
| 5861 | public VectorStoreCollectionOrder(string value); |
| 5862 | public static VectorStoreCollectionOrder Ascending { get; } |
| 5863 | public static VectorStoreCollectionOrder Descending { get; } |
| 5864 | public readonly bool Equals(VectorStoreCollectionOrder other); |
| 5865 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5866 | public override readonly bool Equals(object obj); |
| 5867 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5868 | public override readonly int GetHashCode(); |
| 5869 | public static bool operator ==(VectorStoreCollectionOrder left, VectorStoreCollectionOrder right); |
| 5870 | public static implicit operator VectorStoreCollectionOrder(string value); |
| 5871 | public static bool operator !=(VectorStoreCollectionOrder left, VectorStoreCollectionOrder right); |
| 5872 | public override readonly string ToString(); |
| 5873 | } |
| 5874 | [Experimental("OPENAI001")] |
| 5875 | public class VectorStoreCreationOptions : IJsonModel<VectorStoreCreationOptions>, IPersistableModel<VectorStoreCreationOptions> { |
| 5876 | public FileChunkingStrategy ChunkingStrategy { get; set; } |
| 5877 | public VectorStoreExpirationPolicy ExpirationPolicy { get; set; } |
| 5878 | public IList<string> FileIds { get; } |
| 5879 | public IDictionary<string, string> Metadata { get; } |
| 5880 | public string Name { get; set; } |
| 5881 | [Experimental("OPENAI001")] |
| 5882 | protected virtual VectorStoreCreationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5883 | [Experimental("OPENAI001")] |
| 5884 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5885 | [Experimental("OPENAI001")] |
| 5886 | protected virtual VectorStoreCreationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5887 | [Experimental("OPENAI001")] |
| 5888 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5889 | } |
| 5890 | [Experimental("OPENAI001")] |
| 5891 | public class VectorStoreDeletionResult : IJsonModel<VectorStoreDeletionResult>, IPersistableModel<VectorStoreDeletionResult> { |
| 5892 | public bool Deleted { get; } |
| 5893 | public string VectorStoreId { get; } |
| 5894 | [Experimental("OPENAI001")] |
| 5895 | protected virtual VectorStoreDeletionResult JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5896 | [Experimental("OPENAI001")] |
| 5897 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5898 | [Experimental("OPENAI001")] |
| 5899 | protected virtual VectorStoreDeletionResult PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5900 | [Experimental("OPENAI001")] |
| 5901 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5902 | } |
| 5903 | [Experimental("OPENAI001")] |
| 5904 | public enum VectorStoreExpirationAnchor { |
| 5905 | Unknown = 0, |
| 5906 | LastActiveAt = 1 |
| 5907 | } |
| 5908 | [Experimental("OPENAI001")] |
| 5909 | public class VectorStoreExpirationPolicy : IJsonModel<VectorStoreExpirationPolicy>, IPersistableModel<VectorStoreExpirationPolicy> { |
| 5910 | public VectorStoreExpirationPolicy(VectorStoreExpirationAnchor anchor, int days); |
| 5911 | public VectorStoreExpirationAnchor Anchor { get; set; } |
| 5912 | public int Days { get; set; } |
| 5913 | [Experimental("OPENAI001")] |
| 5914 | protected virtual VectorStoreExpirationPolicy JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5915 | [Experimental("OPENAI001")] |
| 5916 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5917 | [Experimental("OPENAI001")] |
| 5918 | protected virtual VectorStoreExpirationPolicy PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5919 | [Experimental("OPENAI001")] |
| 5920 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5921 | } |
| 5922 | [Experimental("OPENAI001")] |
| 5923 | public class VectorStoreFileAssociation : IJsonModel<VectorStoreFileAssociation>, IPersistableModel<VectorStoreFileAssociation> { |
| 5924 | public IDictionary<string, BinaryData> Attributes { get; } |
| 5925 | public FileChunkingStrategy ChunkingStrategy { get; } |
| 5926 | public DateTimeOffset CreatedAt { get; } |
| 5927 | public string FileId { get; } |
| 5928 | public VectorStoreFileAssociationError LastError { get; } |
| 5929 | public int Size { get; } |
| 5930 | public VectorStoreFileAssociationStatus Status { get; } |
| 5931 | public string VectorStoreId { get; } |
| 5932 | [Experimental("OPENAI001")] |
| 5933 | protected virtual VectorStoreFileAssociation JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5934 | [Experimental("OPENAI001")] |
| 5935 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5936 | [Experimental("OPENAI001")] |
| 5937 | protected virtual VectorStoreFileAssociation PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5938 | [Experimental("OPENAI001")] |
| 5939 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5940 | } |
| 5941 | [Experimental("OPENAI001")] |
| 5942 | public class VectorStoreFileAssociationCollectionOptions { |
| 5943 | public string AfterId { get; set; } |
| 5944 | public string BeforeId { get; set; } |
| 5945 | public VectorStoreFileStatusFilter? Filter { get; set; } |
| 5946 | public VectorStoreFileAssociationCollectionOrder? Order { get; set; } |
| 5947 | public int? PageSizeLimit { get; set; } |
| 5948 | } |
| 5949 | [Experimental("OPENAI001")] |
| 5950 | public readonly partial struct VectorStoreFileAssociationCollectionOrder : IEquatable<VectorStoreFileAssociationCollectionOrder> { |
| 5951 | public VectorStoreFileAssociationCollectionOrder(string value); |
| 5952 | public static VectorStoreFileAssociationCollectionOrder Ascending { get; } |
| 5953 | public static VectorStoreFileAssociationCollectionOrder Descending { get; } |
| 5954 | public readonly bool Equals(VectorStoreFileAssociationCollectionOrder other); |
| 5955 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5956 | public override readonly bool Equals(object obj); |
| 5957 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5958 | public override readonly int GetHashCode(); |
| 5959 | public static bool operator ==(VectorStoreFileAssociationCollectionOrder left, VectorStoreFileAssociationCollectionOrder right); |
| 5960 | public static implicit operator VectorStoreFileAssociationCollectionOrder(string value); |
| 5961 | public static bool operator !=(VectorStoreFileAssociationCollectionOrder left, VectorStoreFileAssociationCollectionOrder right); |
| 5962 | public override readonly string ToString(); |
| 5963 | } |
| 5964 | [Experimental("OPENAI001")] |
| 5965 | public class VectorStoreFileAssociationError : IJsonModel<VectorStoreFileAssociationError>, IPersistableModel<VectorStoreFileAssociationError> { |
| 5966 | public VectorStoreFileAssociationErrorCode Code { get; } |
| 5967 | public string Message { get; } |
| 5968 | [Experimental("OPENAI001")] |
| 5969 | protected virtual VectorStoreFileAssociationError JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 5970 | [Experimental("OPENAI001")] |
| 5971 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 5972 | [Experimental("OPENAI001")] |
| 5973 | protected virtual VectorStoreFileAssociationError PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 5974 | [Experimental("OPENAI001")] |
| 5975 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 5976 | } |
| 5977 | [Experimental("OPENAI001")] |
| 5978 | public readonly partial struct VectorStoreFileAssociationErrorCode : IEquatable<VectorStoreFileAssociationErrorCode> { |
| 5979 | public VectorStoreFileAssociationErrorCode(string value); |
| 5980 | public static VectorStoreFileAssociationErrorCode InvalidFile { get; } |
| 5981 | public static VectorStoreFileAssociationErrorCode ServerError { get; } |
| 5982 | public static VectorStoreFileAssociationErrorCode UnsupportedFile { get; } |
| 5983 | public readonly bool Equals(VectorStoreFileAssociationErrorCode other); |
| 5984 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5985 | public override readonly bool Equals(object obj); |
| 5986 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 5987 | public override readonly int GetHashCode(); |
| 5988 | public static bool operator ==(VectorStoreFileAssociationErrorCode left, VectorStoreFileAssociationErrorCode right); |
| 5989 | public static implicit operator VectorStoreFileAssociationErrorCode(string value); |
| 5990 | public static bool operator !=(VectorStoreFileAssociationErrorCode left, VectorStoreFileAssociationErrorCode right); |
| 5991 | public override readonly string ToString(); |
| 5992 | } |
| 5993 | [Experimental("OPENAI001")] |
| 5994 | public enum VectorStoreFileAssociationStatus { |
| 5995 | Unknown = 0, |
| 5996 | InProgress = 1, |
| 5997 | Completed = 2, |
| 5998 | Cancelled = 3, |
| 5999 | Failed = 4 |
| 6000 | } |
| 6001 | [Experimental("OPENAI001")] |
| 6002 | public class VectorStoreFileCounts : IJsonModel<VectorStoreFileCounts>, IPersistableModel<VectorStoreFileCounts> { |
| 6003 | public int Cancelled { get; } |
| 6004 | public int Completed { get; } |
| 6005 | public int Failed { get; } |
| 6006 | public int InProgress { get; } |
| 6007 | public int Total { get; } |
| 6008 | [Experimental("OPENAI001")] |
| 6009 | protected virtual VectorStoreFileCounts JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 6010 | [Experimental("OPENAI001")] |
| 6011 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 6012 | [Experimental("OPENAI001")] |
| 6013 | protected virtual VectorStoreFileCounts PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 6014 | [Experimental("OPENAI001")] |
| 6015 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 6016 | } |
| 6017 | [Experimental("OPENAI001")] |
| 6018 | public readonly partial struct VectorStoreFileStatusFilter : IEquatable<VectorStoreFileStatusFilter> { |
| 6019 | public VectorStoreFileStatusFilter(string value); |
| 6020 | public static VectorStoreFileStatusFilter Cancelled { get; } |
| 6021 | public static VectorStoreFileStatusFilter Completed { get; } |
| 6022 | public static VectorStoreFileStatusFilter Failed { get; } |
| 6023 | public static VectorStoreFileStatusFilter InProgress { get; } |
| 6024 | public readonly bool Equals(VectorStoreFileStatusFilter other); |
| 6025 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 6026 | public override readonly bool Equals(object obj); |
| 6027 | [EditorBrowsable(EditorBrowsableState.Never)] |
| 6028 | public override readonly int GetHashCode(); |
| 6029 | public static bool operator ==(VectorStoreFileStatusFilter left, VectorStoreFileStatusFilter right); |
| 6030 | public static implicit operator VectorStoreFileStatusFilter(string value); |
| 6031 | public static bool operator !=(VectorStoreFileStatusFilter left, VectorStoreFileStatusFilter right); |
| 6032 | public override readonly string ToString(); |
| 6033 | } |
| 6034 | [Experimental("OPENAI001")] |
| 6035 | public class VectorStoreModificationOptions : IJsonModel<VectorStoreModificationOptions>, IPersistableModel<VectorStoreModificationOptions> { |
| 6036 | public VectorStoreExpirationPolicy ExpirationPolicy { get; set; } |
| 6037 | public IDictionary<string, string> Metadata { get; } |
| 6038 | public string Name { get; set; } |
| 6039 | [Experimental("OPENAI001")] |
| 6040 | protected virtual VectorStoreModificationOptions JsonModelCreateCore(ref Utf8JsonReader reader, ModelReaderWriterOptions options); |
| 6041 | [Experimental("OPENAI001")] |
| 6042 | protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options); |
| 6043 | [Experimental("OPENAI001")] |
| 6044 | protected virtual VectorStoreModificationOptions PersistableModelCreateCore(BinaryData data, ModelReaderWriterOptions options); |
| 6045 | [Experimental("OPENAI001")] |
| 6046 | protected virtual BinaryData PersistableModelWriteCore(ModelReaderWriterOptions options); |
| 6047 | } |
| 6048 | [Experimental("OPENAI001")] |
| 6049 | public enum VectorStoreStatus { |
| 6050 | Unknown = 0, |
| 6051 | InProgress = 1, |
| 6052 | Completed = 2, |
| 6053 | Expired = 3 |
| 6054 | } |
| 6055 | } |