45 references to Throw
Microsoft.Extensions.AI.OpenAI (45)
MicrosoftExtensionsAIAssistantsExtensions.cs (1)
18
OpenAIAssistantsChatClient.ToOpenAIAssistantsFunctionToolDefinition(
Throw
.IfNull(function));
MicrosoftExtensionsAIChatExtensions.cs (7)
27
OpenAIChatClient.ToOpenAIChatTool(
Throw
.IfNull(function));
43
OpenAIChatClient.ToOpenAIChatMessages(
Throw
.IfNull(messages), options);
51
_ =
Throw
.IfNull(response);
133
_ =
Throw
.IfNull(responseUpdates);
174
_ =
Throw
.IfNull(messages);
248
OpenAIChatClient.FromOpenAIChatCompletion(
Throw
.IfNull(chatCompletion), options);
261
OpenAIChatClient.FromOpenAIStreamingChatCompletionAsync(
Throw
.IfNull(chatCompletionUpdates), options, cancellationToken);
MicrosoftExtensionsAIRealtimeExtensions.cs (1)
18
OpenAIRealtimeConversationClient.ToOpenAIConversationFunctionTool(
Throw
.IfNull(function));
MicrosoftExtensionsAIResponsesExtensions.cs (8)
22
OpenAIResponsesChatClient.ToResponseTool(
Throw
.IfNull(function));
39
OpenAIResponsesChatClient.ToOpenAIResponseItems(
Throw
.IfNull(messages), options);
46
OpenAIResponsesChatClient.ToChatMessages(
Throw
.IfNull(items));
54
OpenAIResponsesChatClient.FromOpenAIResponse(
Throw
.IfNull(response), options);
67
OpenAIResponsesChatClient.FromOpenAIStreamingResponseUpdatesAsync(
Throw
.IfNull(responseUpdates), options, cancellationToken: cancellationToken);
75
_ =
Throw
.IfNull(response);
108
_ =
Throw
.IfNull(tools);
134
_ =
Throw
.IfNull(tool);
OpenAIAssistantsChatClient.cs (4)
44
_client =
Throw
.IfNull(assistantClient);
45
_assistantId =
Throw
.IfNullOrWhitespace(assistantId);
53
: this(assistantClient,
Throw
.IfNull(assistant).Id, defaultThreadId)
76
_ =
Throw
.IfNull(messages);
OpenAIChatClient.cs (5)
61
_chatClient =
Throw
.IfNull(chatClient);
69
_ =
Throw
.IfNull(serviceType);
83
_ =
Throw
.IfNull(messages);
101
_ =
Throw
.IfNull(messages);
463
_ =
Throw
.IfNull(openAICompletion);
OpenAIEmbeddingGenerator.cs (3)
50
_embeddingClient =
Throw
.IfNull(embeddingClient);
55
Throw
.ArgumentOutOfRangeException(nameof(defaultModelDimensions), "Value must be greater than 0.");
95
_ =
Throw
.IfNull(serviceType);
OpenAIImageGenerator.cs (3)
47
_imageClient =
Throw
.IfNull(imageClient);
55
_ =
Throw
.IfNull(request);
58
_ =
Throw
.IfNull(prompt);
OpenAIResponsesChatClient.cs (5)
60
_ =
Throw
.IfNull(responseClient);
70
_ =
Throw
.IfNull(serviceType);
84
_ =
Throw
.IfNull(messages);
228
_ =
Throw
.IfNull(messages);
1077
_ =
Throw
.IfNull(serviceType);
OpenAIResponsesContinuationToken.cs (4)
65
Throw
.ArgumentException(nameof(token), "Failed to create OpenAIResponsesResumptionToken from provided token because it is not of type ResponseContinuationToken.");
72
Throw
.ArgumentException(nameof(token), "Failed to create OpenAIResponsesResumptionToken from provided token because it does not contain any data.");
102
Throw
.ArgumentException(nameof(token), $"Unrecognized property '{propertyName}'.");
109
Throw
.ArgumentException(nameof(token), "Failed to create MessagesPageToken from provided pageToken because it does not contain a responseId.");
OpenAISpeechToTextClient.cs (4)
38
_audioClient =
Throw
.IfNull(audioClient);
46
_ =
Throw
.IfNull(serviceType);
60
_ =
Throw
.IfNull(audioSpeechStream);
113
_ =
Throw
.IfNull(audioSpeechStream);