65 references to Throw
Microsoft.Extensions.AI.OpenAI (65)
MicrosoftExtensionsAIChatExtensions.cs (7)
29
OpenAIChatClient.ToOpenAIChatTool(
Throw
.IfNull(function));
46
OpenAIChatClient.ToOpenAIChatMessages(
Throw
.IfNull(messages), options);
55
_ =
Throw
.IfNull(response);
138
_ =
Throw
.IfNull(responseUpdates);
181
_ =
Throw
.IfNull(messages);
263
OpenAIChatClient.FromOpenAIChatCompletion(
Throw
.IfNull(chatCompletion), options);
277
OpenAIChatClient.FromOpenAIStreamingChatCompletionAsync(
Throw
.IfNull(chatCompletionUpdates), options, cancellationToken);
MicrosoftExtensionsAIRealtimeExtensions.cs (1)
21
OpenAIRealtimeConversationClient.ToOpenAIRealtimeFunctionTool(
Throw
.IfNull(function));
MicrosoftExtensionsAIResponsesExtensions.cs (9)
25
OpenAIResponsesChatClient.ToResponseTool(
Throw
.IfNull(function));
36
OpenAIResponsesChatClient.ToResponseTool(
Throw
.IfNull(tool));
53
OpenAIResponsesChatClient.ToOpenAIResponseItems(
Throw
.IfNull(messages), options);
60
OpenAIResponsesChatClient.ToChatMessages(
Throw
.IfNull(items));
68
OpenAIResponsesChatClient.FromOpenAIResponse(
Throw
.IfNull(response), options, conversationId: null);
81
OpenAIResponsesChatClient.FromOpenAIStreamingResponseUpdatesAsync(
Throw
.IfNull(responseUpdates), options, conversationId: null, cancellationToken: cancellationToken);
89
_ =
Throw
.IfNull(response);
134
_ =
Throw
.IfNull(tools);
160
_ =
Throw
.IfNull(tool);
OpenAIChatClient.cs (5)
67
_chatClient =
Throw
.IfNull(chatClient);
77
_ =
Throw
.IfNull(serviceType);
93
_ =
Throw
.IfNull(messages);
114
_ =
Throw
.IfNull(messages);
502
_ =
Throw
.IfNull(openAICompletion);
OpenAIEmbeddingGenerator.cs (3)
54
_embeddingClient =
Throw
.IfNull(embeddingClient);
59
Throw
.ArgumentOutOfRangeException(nameof(defaultModelDimensions), "Value must be greater than 0.");
105
_ =
Throw
.IfNull(serviceType);
OpenAIHostedFileClient.cs (8)
64
_ =
Throw
.IfNull(openAIClient);
76
_fileClient =
Throw
.IfNull(fileClient);
90
_containerClient =
Throw
.IfNull(containerClient);
103
_ =
Throw
.IfNull(content);
157
_ =
Throw
.IfNullOrWhitespace(fileId);
190
_ =
Throw
.IfNullOrWhitespace(fileId);
286
_ =
Throw
.IfNullOrWhitespace(fileId);
310
_ =
Throw
.IfNull(serviceType);
OpenAIImageGenerator.cs (3)
36
_imageClient =
Throw
.IfNull(imageClient);
44
_ =
Throw
.IfNull(request);
47
_ =
Throw
.IfNull(prompt);
OpenAIRealtimeClient.cs (5)
37
_realtimeClient = new RealtimeClient(
Throw
.IfNull(apiKey));
38
_model =
Throw
.IfNull(model);
49
_realtimeClient =
Throw
.IfNull(realtimeClient);
50
_model =
Throw
.IfNull(model);
81
_ =
Throw
.IfNull(serviceType);
OpenAIRealtimeClientSession.cs (7)
52
_ownedRealtimeClient = new Sdk.RealtimeClient(
Throw
.IfNull(apiKey));
53
_model =
Throw
.IfNull(model);
62
_sessionClient =
Throw
.IfNull(sessionClient);
75
Throw
.InvalidOperationException("Cannot connect a session that was not created with an owned realtime client.");
111
_ =
Throw
.IfNull(message);
117
Throw
.InvalidOperationException("The session is not connected.");
179
_ =
Throw
.IfNull(serviceType);
OpenAIRequestPolicies.cs (1)
61
_ =
Throw
.IfNull(policy);
OpenAIResponsesChatClient.cs (5)
78
_ =
Throw
.IfNull(responseClient);
89
_ =
Throw
.IfNull(serviceType);
104
_ =
Throw
.IfNull(messages);
328
_ =
Throw
.IfNull(messages);
2083
_ =
Throw
.IfNull(serviceType);
OpenAISpeechToTextClient.cs (4)
37
_audioClient =
Throw
.IfNull(audioClient);
45
_ =
Throw
.IfNull(serviceType);
59
_ =
Throw
.IfNull(audioSpeechStream);
115
_ =
Throw
.IfNull(audioSpeechStream);
OpenAITextToSpeechClient.cs (4)
38
_audioClient =
Throw
.IfNull(audioClient);
46
_ =
Throw
.IfNull(serviceType);
60
_ =
Throw
.IfNull(text);
83
_ =
Throw
.IfNull(text);
ResponsesClientContinuationToken.cs (3)
67
Throw
.ArgumentException(nameof(token), "Failed to create OpenAI continuation token from provided token because it does not contain any data.");
97
Throw
.ArgumentException(nameof(token), $"Unrecognized property '{propertyName}'.");
104
Throw
.ArgumentException(nameof(token), "Failed to create OpenAI continuation token from provided token because it does not contain a responseId.");