310 references to ChatOptions
Microsoft.AspNetCore.Components.AI (2)
Engine\UIAgent.cs (2)
169
chatOptions = chatOptions?.Clone() ?? new
ChatOptions
();
335
var chatOptions = _options.ChatOptions?.Clone() ?? new
ChatOptions
();
Microsoft.Extensions.AI (3)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
174
options = options is not null ? options.Clone() :
new
();
ChatCompletion\ConfigureOptionsChatClient.cs (1)
54
options = options?.Clone() ??
new
();
ChatCompletion\FunctionInvokingChatClient.cs (1)
1013
options =
new
() { ConversationId = conversationId };
Microsoft.Extensions.AI.Abstractions.Tests (13)
ChatCompletion\ChatClientExtensionsTests.cs (5)
104
var expectedOptions = new
ChatOptions
();
131
var expectedOptions = new
ChatOptions
();
166
var expectedChatOptions = new
ChatOptions
205
var expectedOptions = new
ChatOptions
();
207
var expectedChatOptions = new
ChatOptions
ChatCompletion\ChatOptionsTests.cs (4)
16
ChatOptions options =
new
();
62
ChatOptions options =
new
();
157
ChatOptions options =
new
();
233
ChatOptions original =
new
()
ChatCompletion\DelegatingChatClientTests.cs (2)
25
var expectedChatOptions = new
ChatOptions
();
57
var expectedChatOptions = new
ChatOptions
();
ChatRouting\RoutingChatClientTests.cs (1)
24
var options = new
ChatOptions
{ ModelId = "request" };
ChatRouting\RoutingContextTests.cs (1)
16
var options = new
ChatOptions
{ ModelId = "initial" };
Microsoft.Extensions.AI.Evaluation.Integration.Tests (4)
AgentQualityEvaluatorTests.cs (2)
31
new
ChatOptions
38
new
ChatOptions
QualityEvaluatorTests.cs (1)
29
new
ChatOptions
SafetyEvaluatorTests.cs (1)
34
new
ChatOptions
Microsoft.Extensions.AI.Evaluation.Quality (12)
CoherenceEvaluator.cs (1)
56
new
ChatOptions
CompletenessEvaluator.cs (1)
52
new
ChatOptions
EquivalenceEvaluator.cs (1)
55
new
ChatOptions
FluencyEvaluator.cs (1)
50
new
ChatOptions
GroundednessEvaluator.cs (1)
51
new
ChatOptions
IntentResolutionEvaluator.cs (1)
64
new
ChatOptions
RelevanceEvaluator.cs (1)
54
new
ChatOptions
RelevanceTruthAndCompletenessEvaluator.cs (1)
71
new
ChatOptions
RetrievalEvaluator.cs (1)
60
new
ChatOptions
TaskAdherenceEvaluator.cs (1)
63
new
ChatOptions
ToolCallAccuracyEvaluator.cs (1)
65
new
ChatOptions
Utilities\JsonOutputFixer.cs (1)
59
new
ChatOptions
Microsoft.Extensions.AI.Integration.Tests (24)
ChatClientIntegrationTests.cs (17)
133
var response = ChatClient.GetStreamingResponseAsync("Explain in 10 words how AI works",
new
()
189
new
() { ModelId = GetModel_MultiModal_DescribeImage() });
207
new
() { ModelId = GetModel_MultiModal_DescribeImage() });
234
var response = await chatClient.GetResponseAsync(messages,
new
()
250
var response = await chatClient.GetResponseAsync("What is the result of SecretComputation on 42 and 84?",
new
()
265
var response = chatClient.GetStreamingResponseAsync("What is the result of SecretComputation on 42 and 84?",
new
()
302
var response = await chatClient.GetResponseAsync(messages,
new
()
334
var response = await chatClient.GetResponseAsync(messages,
new
()
366
var response = await chatClient.GetResponseAsync(messages,
new
()
443
ChatOptions options =
new
()
573
var response = await chatClient.GetResponseAsync("How much older is Elsa than Anna? Return the age difference as a single number.",
new
()
605
var response = await chatClient.GetResponseAsync("Are birds real?",
new
()
626
var response = await chatClient.GetResponseAsync("What's the current secret number?",
new
()
888
new
ChatOptions
{ Tools = [AIFunctionFactory.Create(() => secretNumber, "GetSecretNumber")] });
914
new
ChatOptions
{ Tools = [AIFunctionFactory.Create(() => secretNumber, "GetSecretNumber")] }))
1066
"Who is person with ID 123?", new
ChatOptions
1247
var response = await chatClient.GetResponseAsync(messages,
new
() { Tools = [getWeather] });
ImageGeneratingChatClientIntegrationTests.cs (7)
121
var chatOptions = new
ChatOptions
159
var chatOptions = new
ChatOptions
188
var chatOptions = new
ChatOptions
238
var chatOptions = new
ChatOptions
283
var chatOptions = new
ChatOptions
334
var chatOptions = new
ChatOptions
385
new
ChatOptions
{ Tools = [new HostedImageGenerationTool()] },
Microsoft.Extensions.AI.OllamaSharp.Integration.Tests (2)
OllamaSharpChatClientIntegrationTests.cs (2)
44
var response = await chatClient.GetResponseAsync("What is the current secret number? Answer with digits only.", new
ChatOptions
79
var response = await chatClient.GetResponseAsync("What's the stock price for Microsoft in British pounds?", new
ChatOptions
Microsoft.Extensions.AI.OpenAI.Tests (121)
OpenAIChatClientTests.cs (15)
155
var response = await client.GetResponseAsync("hello",
new
()
235
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
364
var response = await client.GetResponseAsync("hello",
new
()
418
ChatOptions chatOptions =
new
()
495
ChatOptions chatOptions =
new
()
578
ChatOptions chatOptions =
new
()
652
ChatOptions chatOptions =
new
()
760
Assert.NotNull(await client.GetResponseAsync("hello",
new
()
859
var response = await client.GetResponseAsync(messages,
new
()
1173
var response = await client.GetResponseAsync("How old is Alice?",
new
()
1258
var response = await client.GetResponseAsync("What day is it?",
new
()
1358
await foreach (var update in client.GetStreamingResponseAsync("How old is Alice?",
new
()
1717
var response = await client.GetResponseAsync("hello",
new
()
1764
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
1902
Assert.NotNull(await client.GetResponseAsync("hello",
new
()
OpenAIConversionTests.cs (8)
51
new
() { AdditionalProperties = new AdditionalPropertiesDictionary { ["strict"] = true } });
86
new
() { AdditionalProperties = new AdditionalPropertiesDictionary { ["strict"] = true } });
741
ChatOptions? options = withOptions ? new
ChatOptions
{ Instructions = "You talk like a parrot." } : null;
2039
var options = new
ChatOptions
2201
var options = new
ChatOptions
2219
var options = new
ChatOptions
2239
options =
new
()
2247
options =
new
()
OpenAIHostedFileClientIntegrationTests.cs (4)
279
new
ChatOptions
{ Tools = [new HostedCodeInterpreterTool()] });
349
new
ChatOptions
{ Tools = [new HostedCodeInterpreterTool()] });
398
new
ChatOptions
{ Tools = [new HostedCodeInterpreterTool()] });
427
new
ChatOptions
OpenAIResponseClientIntegrationTests.cs (26)
38
var response = await ChatClient.GetResponseAsync("Use the code interpreter to calculate the square root of 42. Return only the nearest integer value and no other text.",
new
()
84
new
()
145
var chatOptions = new
ChatOptions
191
ChatOptions chatOptions =
new
()
213
ChatOptions chatOptions =
new
()
253
ChatOptions chatOptions =
new
()
322
ChatOptions chatOptions =
new
()
356
var chatOptions = new
ChatOptions
388
var chatOptions = new
ChatOptions
419
ChatOptions chatOptions =
new
()
440
ChatOptions chatOptions =
new
()
482
var chatOptions = new
ChatOptions
517
ChatOptions chatOptions =
new
()
565
var chatOptions = new
ChatOptions
585
var chatOptions = new
ChatOptions
613
var chatOptions = new
ChatOptions
638
var chatOptions = new
ChatOptions
661
var chatOptions = new
ChatOptions
690
ChatOptions chatOptions =
new
()
771
ChatOptions chatOptions =
new
()
864
new
()
899
new
()
919
new
()
946
new
()
968
new
()
1011
new
()
OpenAIResponseClientTests.cs (68)
153
var response = await client.GetResponseAsync("hello",
new
()
297
await foreach (var update in client.GetStreamingResponseAsync("Calculate the sum of the first 5 positive integers.",
new
()
427
await foreach (var update in client.GetStreamingResponseAsync("Solve this problem step by step.",
new
()
557
await foreach (var update in client.GetStreamingResponseAsync("Solve this problem step by step.",
new
()
659
await foreach (var update in client.GetStreamingResponseAsync("Solve this problem step by step.",
new
()
734
await foreach (var update in client.GetStreamingResponseAsync("Solve this problem step by step.",
new
()
759
await client.GetResponseAsync(chatHistory,
new
()
853
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
992
ChatOptions chatOptions =
new
()
1088
ChatOptions chatOptions =
new
()
1194
var response = await client.GetResponseAsync("hello",
new
()
1340
ChatOptions chatOptions =
new
()
1467
var response = await client.GetResponseAsync("hello",
new
()
1591
var chatOptions = new
ChatOptions
2096
ChatOptions chatOptions =
new
()
2502
ChatOptions chatOptions =
new
()
2716
ChatOptions chatOptions =
new
()
2830
var response = await client.GetResponseAsync("hello", new
ChatOptions
{ Tools = [mcpTool] });
2920
var response = await client.GetResponseAsync("hello", new
ChatOptions
{ Tools = [mcpTool] });
2982
var response = await client.GetResponseAsync("hello",
new
()
3073
var response = await client.GetResponseAsync([],
new
()
3123
var options = new
ChatOptions
3219
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
3305
var chatOptions = new
ChatOptions
3367
var chatOptions = new
ChatOptions
3490
var response = await client.GetResponseAsync("Calculate the sum of numbers from 1 to 5",
new
()
3710
var response = await client.GetStreamingResponseAsync("Calculate the sum of numbers from 1 to 10 using Python",
new
()
3798
await foreach (var update in client.GetStreamingResponseAsync("Calculate the sum of numbers from 1 to 10 using Python",
new
()
3918
var response = await client.GetResponseAsync("hello",
new
()
3976
var response = await client.GetResponseAsync("hello",
new
()
4035
var response = await client.GetResponseAsync("hello",
new
()
4096
var response = await client.GetResponseAsync("hello",
new
()
4158
var response = await client.GetResponseAsync("hello",
new
()
4221
var response = await client.GetResponseAsync("hello",
new
()
4295
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
4376
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
4446
var response = await client.GetResponseAsync("hello",
new
()
4517
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
4594
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
4672
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
4737
var response = await client.GetResponseAsync("hello",
new
()
4798
var response = await client.GetResponseAsync("hello",
new
()
4869
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
5971
new
ChatOptions
{ ContinuationToken = token });
6519
var response = await client.GetResponseAsync("Generate an image of a cat", new
ChatOptions
6620
await foreach (var update in client.GetStreamingResponseAsync("Generate an image of a dog", new
ChatOptions
6738
await foreach (var update in client.GetStreamingResponseAsync("Generate an image of a sunset", new
ChatOptions
6857
Assert.NotNull(await client.GetResponseAsync("hello",
new
()
6996
var response = await client.GetResponseAsync("Create a hello world file",
new
()
7278
var response = await client.GetResponseAsync("What is the latest news about .NET?",
new
()
7406
await foreach (var update in client.GetStreamingResponseAsync("What is the latest news about .NET?",
new
()
7515
var response = await client.GetResponseAsync("hello",
new
()
7602
var response = await client.GetResponseAsync("hello",
new
()
7694
var response = await client.GetResponseAsync("hello",
new
()
7761
var response = await client.GetResponseAsync("hello",
new
()
7871
var response = await client.GetResponseAsync("hello",
new
()
7971
var response = await client.GetResponseAsync("hello",
new
()
8076
var response = await client.GetResponseAsync("hello",
new
()
8176
var response = await client.GetResponseAsync("hello",
new
()
8263
var response = await client.GetResponseAsync("hello",
new
()
8354
var response = await client.GetResponseAsync("hello",
new
()
8440
var response = await client.GetResponseAsync("hello",
new
()
8553
var response = await client.GetResponseAsync("hello",
new
()
8652
var response = await client.GetResponseAsync("hello",
new
()
8756
var response = await client.GetResponseAsync("hello",
new
()
8869
var response = await client.GetResponseAsync("hello",
new
()
8989
new
ChatOptions
{ Tools = [tool] });
9083
new
ChatOptions
{ Tools = [tool] }))
Microsoft.Extensions.AI.Tests (129)
ChatCompletion\ConfigureOptionsChatClientTests.cs (1)
35
ChatOptions? providedOptions = nullProvidedOptions ? null :
new
() { ModelId = "test" };
ChatCompletion\DistributedCachingChatClientTest.cs (8)
44
ChatOptions options =
new
() { ConversationId = conversationIdSet ? "123" : null };
244
ChatOptions options =
new
() { ConversationId = conversationIdSet ? "123" : null };
569
var result1 = await outer.GetResponseAsync([], new
ChatOptions
573
var result2 = await outer.GetResponseAsync([], new
ChatOptions
584
var result3 = await outer.GetResponseAsync([], new
ChatOptions
588
var result4 = await outer.GetResponseAsync([], new
ChatOptions
666
var result1 = await outer.GetResponseAsync([], new
ChatOptions
670
var result2 = await outer.GetResponseAsync([], new
ChatOptions
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (34)
29
var options = new
ChatOptions
61
var options = new
ChatOptions
109
var options = new
ChatOptions
165
var options = new
ChatOptions
{ Tools = tools };
204
var options = new
ChatOptions
245
var options = new
ChatOptions
296
var options = new
ChatOptions
349
var options = new
ChatOptions
408
var options = new
ChatOptions
467
var options = new
ChatOptions
531
var options = new
ChatOptions
596
var options = new
ChatOptions
690
var options = new
ChatOptions
747
var options = new
ChatOptions
801
var options = new
ChatOptions
881
var options = new
ChatOptions
953
var options = new
ChatOptions
1017
var options = new
ChatOptions
1072
var options = new
ChatOptions
1102
var options = new
ChatOptions
1148
var options = new
ChatOptions
1196
var options = new
ChatOptions
1246
var options = new
ChatOptions
1292
var options = new
ChatOptions
1347
var options = new
ChatOptions
1398
var options = new
ChatOptions
1455
var options = new
ChatOptions
1515
var options = new
ChatOptions
1590
var options = new
ChatOptions
1689
var options = new
ChatOptions
1729
var options = new
ChatOptions
1786
var options = new
ChatOptions
1829
var options = new
ChatOptions
1913
var options = new
ChatOptions
ChatCompletion\FunctionInvokingChatClientTests.cs (65)
81
var options = new
ChatOptions
114
new
() { Tools = [AIFunctionFactory.Create(() => "Shouldn't be invoked", "ChatOptionsFunc")] } :
145
ChatOptions options =
new
()
180
var options = new
ChatOptions
231
var options = new
ChatOptions
278
var options = new
ChatOptions
317
var options = new
ChatOptions
364
var options = new
ChatOptions
445
var options = new
ChatOptions
526
var options = new
ChatOptions
626
var options = new
ChatOptions
678
var options = new
ChatOptions
722
var options = new
ChatOptions
775
var options = new
ChatOptions
815
var originalOptions = new
ChatOptions
841
var options = new
ChatOptions
922
var options = new
ChatOptions
971
var options = new
ChatOptions
1010
var options = new
ChatOptions
1048
var options = new
ChatOptions
1105
ChatOptions options =
new
()
1170
var options = new
ChatOptions
1228
var options = new
ChatOptions
1285
var options = new
ChatOptions
1378
var chatOptions = new
ChatOptions
{ Tools = [function] };
1397
var options = new
ChatOptions
1432
var options = new
ChatOptions
1474
var options = new
ChatOptions
1517
var options = new
ChatOptions
1550
var options = new
ChatOptions
1611
var options = new
ChatOptions
1644
var options = new
ChatOptions
1672
ChatOptions options =
new
()
1728
ChatOptions options =
new
() { Tools = [declarationOnly] };
1754
var options = new
ChatOptions
1807
var originalChatOptions = new
ChatOptions
1840
ChatOptions options =
new
()
1905
var options = new
ChatOptions
1951
ChatOptions options =
new
()
1993
ChatOptions options =
new
()
2043
ChatOptions options =
new
()
2115
ChatOptions options =
new
()
2151
var options = new
ChatOptions
2180
var options = new
ChatOptions
2228
var options = new
ChatOptions
2298
var options = new
ChatOptions
2525
var options = new
ChatOptions
2619
var options = new
ChatOptions
2727
var options = new
ChatOptions
2825
var options = new
ChatOptions
2929
var options = new
ChatOptions
3026
var options = new
ChatOptions
3105
var options = new
ChatOptions
3206
var options = new
ChatOptions
3312
var options = new
ChatOptions
3403
var options = new
ChatOptions
3433
var options = new
ChatOptions
3464
var options = new
ChatOptions
3497
var options = new
ChatOptions
3530
var options = new
ChatOptions
3576
var options = new
ChatOptions
{ Tools = [approvalFunc] };
3613
var options = new
ChatOptions
{ Tools = [approvalFunc] };
3647
var options = new
ChatOptions
3702
var options = new
ChatOptions
3778
var options = new
ChatOptions
ChatCompletion\ImageGeneratingChatClientTests.cs (9)
46
var chatOptions = new
ChatOptions
83
var chatOptions = new
ChatOptions
131
var chatOptions = new
ChatOptions
235
var chatOptions = new
ChatOptions
291
var chatOptions = new
ChatOptions
325
var chatOptions = new
ChatOptions
366
var chatOptions = new
ChatOptions
420
var chatOptions = new
ChatOptions
494
var chatOptions = new
ChatOptions
ChatCompletion\LoggingChatClientTests.cs (2)
70
new
ChatOptions
{ FrequencyPenalty = 3.0f });
119
new
ChatOptions
{ FrequencyPenalty = 3.0f }))
ChatCompletion\OpenTelemetryChatClientTests.cs (2)
122
var options = new
ChatOptions
932
await foreach (var update in chatClient.GetStreamingResponseAsync([new(ChatRole.User, "Hello")], new
ChatOptions
{ ModelId = "mymodel" }))
ChatCompletion\UseDelegateChatClientTests.cs (4)
29
ChatOptions expectedOptions =
new
();
79
ChatOptions expectedOptions =
new
();
121
ChatOptions expectedOptions =
new
();
172
ChatOptions expectedOptions =
new
();
ChatRouting\FailoverChatClientTests.cs (3)
218
var requestOptions = new
ChatOptions
238
var requestOptions = new
ChatOptions
296
var requestOptions = new
ChatOptions
{ ModelId = "request" };
ChatRouting\OrderedFailoverChatClientTests.cs (1)
263
new
ChatOptions