58 references to Throw
Microsoft.Extensions.AI.Abstractions (58)
AdditionalPropertiesDictionary.cs (1)
233private readonly AdditionalPropertiesDictionary _properties = Throw.IfNull(properties);
ChatCompletion\ChatClientExtensions.cs (5)
25_ = Throw.IfNull(client); 42_ = Throw.IfNull(client); 43_ = Throw.IfNull(chatMessage); 60_ = Throw.IfNull(client); 61_ = Throw.IfNull(chatMessage);
ChatCompletion\ChatCompletion.cs (3)
23_choices = Throw.IfNull(choices); 30_ = Throw.IfNull(message); 38set => _choices = Throw.IfNull(value);
ChatCompletion\ChatFinishReason.cs (2)
27_value = Throw.IfNullOrWhitespace(value); 90Throw.IfNull(writer).WriteStringValue(value.Value);
ChatCompletion\ChatMessage.cs (1)
39_contents = Throw.IfNull(contents);
ChatCompletion\ChatResponseFormat.cs (1)
37new(Throw.IfNull(schema),
ChatCompletion\ChatResponseFormatJson.cs (1)
26Throw.ArgumentException(
ChatCompletion\ChatRole.cs (2)
46Value = Throw.IfNullOrWhitespace(value); 98Throw.IfNull(writer).WriteStringValue(value.Value);
ChatCompletion\DelegatingChatClient.cs (2)
27InnerClient = Throw.IfNull(innerClient); 68_ = Throw.IfNull(serviceType);
ChatCompletion\RequiredChatToolMode.cs (1)
37_ = Throw.IfNullOrWhitespace(requiredFunctionName);
ChatCompletion\StreamingChatCompletionUpdateExtensions.cs (2)
36_ = Throw.IfNull(updates); 64_ = Throw.IfNull(updates);
Contents\DataContent.cs (3)
50: this(Throw.IfNull(uri).ToString(), mediaType) 62_uri = Throw.IfNullOrWhitespace(uri); 113Throw.ArgumentException(nameof(mediaType), "Invalid media type.");
Contents\FunctionCallContent.cs (5)
28Name = Throw.IfNull(name); 74_ = Throw.IfNull(callId); 75_ = Throw.IfNull(name); 76_ = Throw.IfNull(encodedArguments); 77_ = Throw.IfNull(argumentParser);
Contents\FunctionResultContent.cs (2)
31CallId = Throw.IfNull(callId); 32Name = Throw.IfNull(name);
Contents\UsageContent.cs (2)
30_details = Throw.IfNull(details); 37set => _details = Throw.IfNull(value);
Embeddings\DelegatingEmbeddingGenerator.cs (2)
30InnerGenerator = Throw.IfNull(innerGenerator); 64_ = Throw.IfNull(serviceType);
Embeddings\EmbeddingGenerationOptions.cs (1)
21_ = Throw.IfLessThan(value.Value, 1, nameof(value));
Embeddings\EmbeddingGeneratorExtensions.cs (5)
32_ = Throw.IfNull(generator); 99_ = Throw.IfNull(generator); 100_ = Throw.IfNull(value); 135_ = Throw.IfNull(generator); 136_ = Throw.IfNull(values);
Embeddings\GeneratedEmbeddings.cs (2)
30_embeddings = new List<TEmbedding>(Throw.IfLessThan(capacity, 0)); 39_embeddings = new List<TEmbedding>(Throw.IfNull(embeddings));
Functions\AIFunctionMetadata.cs (6)
42_name = Throw.IfNullOrWhitespace(name); 53Name = Throw.IfNull(metadata).Name; 64init => _name = Throw.IfNullOrWhitespace(value); 80init => _parameters = Throw.IfNull(value); 100init => _returnParameter = Throw.IfNull(value); 107init => _additionalProperties = Throw.IfNull(value);
Functions\AIFunctionParameterMetadata.cs (4)
22_name = Throw.IfNullOrWhitespace(name); 30_ = Throw.IfNull(metadata); 31_ = Throw.IfNullOrWhitespace(metadata.Name); 47init => _name = Throw.IfNullOrWhitespace(value);
Functions\AIFunctionReturnParameterMetadata.cs (1)
25Description = Throw.IfNull(metadata).Description;
Utilities\AIJsonUtilities.Schema.cs (4)
63_ = Throw.IfNull(parameterMetadata); 64_ = Throw.IfNull(functionMetadata); 110_ = Throw.IfNull(parameterName); 187_ = Throw.IfNull(options);