47 references to Throw
Microsoft.Extensions.AI.Abstractions (47)
ChatCompletion\ChatClientExtensions.cs (4)
26
_ =
Throw
.IfNull(client);
27
_ =
Throw
.IfNull(chatMessage);
44
_ =
Throw
.IfNull(client);
45
_ =
Throw
.IfNull(chatMessage);
ChatCompletion\ChatCompletion.cs (3)
22
_choices =
Throw
.IfNull(choices);
29
_ =
Throw
.IfNull(message);
37
set => _choices =
Throw
.IfNull(value);
ChatCompletion\ChatFinishReason.cs (2)
27
_value =
Throw
.IfNullOrWhitespace(value);
90
Throw
.IfNull(writer).WriteStringValue(value.Value);
ChatCompletion\ChatMessage.cs (1)
40
_contents =
Throw
.IfNull(contents);
ChatCompletion\ChatResponseFormat.cs (1)
37
new(
Throw
.IfNull(schema),
ChatCompletion\ChatResponseFormatJson.cs (1)
26
Throw
.ArgumentException(
ChatCompletion\ChatRole.cs (2)
46
Value =
Throw
.IfNullOrWhitespace(value);
98
Throw
.IfNull(writer).WriteStringValue(value.Value);
ChatCompletion\DelegatingChatClient.cs (1)
27
InnerClient =
Throw
.IfNull(innerClient);
ChatCompletion\RequiredChatToolMode.cs (1)
37
_ =
Throw
.IfNullOrWhitespace(requiredFunctionName);
Contents\DataContent.cs (3)
49
: this(
Throw
.IfNull(uri).ToString(), mediaType)
61
_uri =
Throw
.IfNullOrWhitespace(uri);
112
Throw
.ArgumentException(nameof(mediaType), "Invalid media type.");
Contents\FunctionCallContent.cs (5)
28
Name =
Throw
.IfNull(name);
74
_ =
Throw
.IfNull(callId);
75
_ =
Throw
.IfNull(name);
76
_ =
Throw
.IfNull(encodedArguments);
77
_ =
Throw
.IfNull(argumentParser);
Contents\FunctionResultContent.cs (5)
31
CallId =
Throw
.IfNull(callId);
32
Name =
Throw
.IfNull(name);
49
CallId =
Throw
.IfNull(callId);
50
Name =
Throw
.IfNull(name);
66
: this(
Throw
.IfNull(functionCall).CallId, functionCall.Name, result, exception)
Contents\UsageContent.cs (2)
30
_details =
Throw
.IfNull(details);
37
set => _details =
Throw
.IfNull(value);
Embeddings\DelegatingEmbeddingGenerator.cs (1)
30
InnerGenerator =
Throw
.IfNull(innerGenerator);
Embeddings\EmbeddingGeneratorExtensions.cs (2)
28
_ =
Throw
.IfNull(generator);
29
_ =
Throw
.IfNull(value);
Embeddings\GeneratedEmbeddings.cs (2)
28
_embeddings = new List<TEmbedding>(
Throw
.IfLessThan(capacity, 0));
37
_embeddings = new List<TEmbedding>(
Throw
.IfNull(embeddings));
Functions\AIFunctionMetadata.cs (6)
42
_name =
Throw
.IfNullOrWhitespace(name);
53
Name =
Throw
.IfNull(metadata).Name;
64
init => _name =
Throw
.IfNullOrWhitespace(value);
80
init => _parameters =
Throw
.IfNull(value);
100
init => _returnParameter =
Throw
.IfNull(value);
107
init => _additionalProperties =
Throw
.IfNull(value);
Functions\AIFunctionParameterMetadata.cs (4)
22
_name =
Throw
.IfNullOrWhitespace(name);
30
_ =
Throw
.IfNull(metadata);
31
_ =
Throw
.IfNullOrWhitespace(metadata.Name);
47
init => _name =
Throw
.IfNullOrWhitespace(value);
Functions\AIFunctionReturnParameterMetadata.cs (1)
25
Description =
Throw
.IfNull(metadata).Description;