45 references to Throw
Microsoft.Extensions.AI.OpenAI (45)
MicrosoftExtensionsAIAssistantsExtensions.cs (1)
18OpenAIAssistantsChatClient.ToOpenAIAssistantsFunctionToolDefinition(Throw.IfNull(function));
MicrosoftExtensionsAIChatExtensions.cs (7)
27OpenAIChatClient.ToOpenAIChatTool(Throw.IfNull(function)); 43OpenAIChatClient.ToOpenAIChatMessages(Throw.IfNull(messages), options); 51_ = Throw.IfNull(response); 133_ = Throw.IfNull(responseUpdates); 174_ = Throw.IfNull(messages); 248OpenAIChatClient.FromOpenAIChatCompletion(Throw.IfNull(chatCompletion), options); 261OpenAIChatClient.FromOpenAIStreamingChatCompletionAsync(Throw.IfNull(chatCompletionUpdates), options, cancellationToken);
MicrosoftExtensionsAIRealtimeExtensions.cs (1)
18OpenAIRealtimeConversationClient.ToOpenAIConversationFunctionTool(Throw.IfNull(function));
MicrosoftExtensionsAIResponsesExtensions.cs (8)
22OpenAIResponsesChatClient.ToResponseTool(Throw.IfNull(function)); 39OpenAIResponsesChatClient.ToOpenAIResponseItems(Throw.IfNull(messages), options); 46OpenAIResponsesChatClient.ToChatMessages(Throw.IfNull(items)); 54OpenAIResponsesChatClient.FromOpenAIResponse(Throw.IfNull(response), options); 67OpenAIResponsesChatClient.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); 55Throw.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)
65Throw.ArgumentException(nameof(token), "Failed to create OpenAIResponsesResumptionToken from provided token because it is not of type ResponseContinuationToken."); 72Throw.ArgumentException(nameof(token), "Failed to create OpenAIResponsesResumptionToken from provided token because it does not contain any data."); 102Throw.ArgumentException(nameof(token), $"Unrecognized property '{propertyName}'."); 109Throw.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);