311 references to ChatOptions
Microsoft.AspNetCore.Components.AI (2)
Engine\UIAgent.cs (2)
165
chatOptions = chatOptions?.Clone() ?? new
ChatOptions
();
330
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 (1)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\JsonContext.ChatOptions.g.cs (1)
33
ObjectCreator = () => new global::Microsoft.Extensions.AI.
ChatOptions
(),
Microsoft.Extensions.AI.Abstractions.Tests (14)
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" };
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestJsonSerializerContext.ChatOptions.g.cs (1)
31
ObjectCreator = () => new global::Microsoft.Extensions.AI.
ChatOptions
(),
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)
OpenAIAssistantChatClientIntegrationTests.cs (1)
55
var response = await ChatClient.GetResponseAsync("Use the code interpreter to calculate the square root of 42.",
new
()
OpenAIChatClientTests.cs (15)
155
var response = await client.GetResponseAsync("hello",
new
()
235
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
332
var response = await client.GetResponseAsync("hello",
new
()
386
ChatOptions chatOptions =
new
()
463
ChatOptions chatOptions =
new
()
546
ChatOptions chatOptions =
new
()
620
ChatOptions chatOptions =
new
()
728
Assert.NotNull(await client.GetResponseAsync("hello",
new
()
827
var response = await client.GetResponseAsync(messages,
new
()
1141
var response = await client.GetResponseAsync("How old is Alice?",
new
()
1226
var response = await client.GetResponseAsync("What day is it?",
new
()
1326
await foreach (var update in client.GetStreamingResponseAsync("How old is Alice?",
new
()
1680
var response = await client.GetResponseAsync("hello",
new
()
1727
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
1865
Assert.NotNull(await client.GetResponseAsync("hello",
new
()
OpenAIConversionTests.cs (8)
52
new
() { AdditionalProperties = new AdditionalPropertiesDictionary { ["strict"] = true } });
87
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 (67)
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
()
553
await foreach (var update in client.GetStreamingResponseAsync("Solve this problem step by step.",
new
()
628
await foreach (var update in client.GetStreamingResponseAsync("Solve this problem step by step.",
new
()
653
await client.GetResponseAsync(chatHistory,
new
()
747
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
886
ChatOptions chatOptions =
new
()
982
ChatOptions chatOptions =
new
()
1088
var response = await client.GetResponseAsync("hello",
new
()
1234
ChatOptions chatOptions =
new
()
1361
var response = await client.GetResponseAsync("hello",
new
()
1485
var chatOptions = new
ChatOptions
1990
ChatOptions chatOptions =
new
()
2396
ChatOptions chatOptions =
new
()
2610
ChatOptions chatOptions =
new
()
2724
var response = await client.GetResponseAsync("hello", new
ChatOptions
{ Tools = [mcpTool] });
2814
var response = await client.GetResponseAsync("hello", new
ChatOptions
{ Tools = [mcpTool] });
2876
var response = await client.GetResponseAsync("hello",
new
()
2967
var response = await client.GetResponseAsync([],
new
()
3017
var options = new
ChatOptions
3113
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
3199
var chatOptions = new
ChatOptions
3261
var chatOptions = new
ChatOptions
3384
var response = await client.GetResponseAsync("Calculate the sum of numbers from 1 to 5",
new
()
3604
var response = await client.GetStreamingResponseAsync("Calculate the sum of numbers from 1 to 10 using Python",
new
()
3692
await foreach (var update in client.GetStreamingResponseAsync("Calculate the sum of numbers from 1 to 10 using Python",
new
()
3812
var response = await client.GetResponseAsync("hello",
new
()
3870
var response = await client.GetResponseAsync("hello",
new
()
3929
var response = await client.GetResponseAsync("hello",
new
()
3990
var response = await client.GetResponseAsync("hello",
new
()
4052
var response = await client.GetResponseAsync("hello",
new
()
4115
var response = await client.GetResponseAsync("hello",
new
()
4189
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
4270
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
4340
var response = await client.GetResponseAsync("hello",
new
()
4411
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
4488
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
4566
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
4631
var response = await client.GetResponseAsync("hello",
new
()
4692
var response = await client.GetResponseAsync("hello",
new
()
4763
await foreach (var update in client.GetStreamingResponseAsync("hello",
new
()
5820
new
ChatOptions
{ ContinuationToken = token });
6368
var response = await client.GetResponseAsync("Generate an image of a cat", new
ChatOptions
6469
await foreach (var update in client.GetStreamingResponseAsync("Generate an image of a dog", new
ChatOptions
6587
await foreach (var update in client.GetStreamingResponseAsync("Generate an image of a sunset", new
ChatOptions
6706
Assert.NotNull(await client.GetResponseAsync("hello",
new
()
6845
var response = await client.GetResponseAsync("Create a hello world file",
new
()
7127
var response = await client.GetResponseAsync("What is the latest news about .NET?",
new
()
7255
await foreach (var update in client.GetStreamingResponseAsync("What is the latest news about .NET?",
new
()
7364
var response = await client.GetResponseAsync("hello",
new
()
7451
var response = await client.GetResponseAsync("hello",
new
()
7543
var response = await client.GetResponseAsync("hello",
new
()
7610
var response = await client.GetResponseAsync("hello",
new
()
7720
var response = await client.GetResponseAsync("hello",
new
()
7820
var response = await client.GetResponseAsync("hello",
new
()
7925
var response = await client.GetResponseAsync("hello",
new
()
8025
var response = await client.GetResponseAsync("hello",
new
()
8112
var response = await client.GetResponseAsync("hello",
new
()
8203
var response = await client.GetResponseAsync("hello",
new
()
8289
var response = await client.GetResponseAsync("hello",
new
()
8402
var response = await client.GetResponseAsync("hello",
new
()
8501
var response = await client.GetResponseAsync("hello",
new
()
8605
var response = await client.GetResponseAsync("hello",
new
()
8718
var response = await client.GetResponseAsync("hello",
new
()
8838
new
ChatOptions
{ Tools = [tool] });
8932
new
ChatOptions
{ Tools = [tool] }))
Microsoft.Extensions.AI.Tests (124)
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 (33)
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
1458
var options = new
ChatOptions
1533
var options = new
ChatOptions
1632
var options = new
ChatOptions
1672
var options = new
ChatOptions
1729
var options = new
ChatOptions
1772
var options = new
ChatOptions
1856
var options = new
ChatOptions
ChatCompletion\FunctionInvokingChatClientTests.cs (60)
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
1458
var options = new
ChatOptions
1491
var options = new
ChatOptions
1519
ChatOptions options =
new
()
1575
ChatOptions options =
new
() { Tools = [declarationOnly] };
1601
var options = new
ChatOptions
1654
var originalChatOptions = new
ChatOptions
1687
ChatOptions options =
new
()
1752
var options = new
ChatOptions
1798
ChatOptions options =
new
()
1840
ChatOptions options =
new
()
1890
ChatOptions options =
new
()
1962
ChatOptions options =
new
()
1998
var options = new
ChatOptions
2027
var options = new
ChatOptions
2075
var options = new
ChatOptions
2145
var options = new
ChatOptions
2372
var options = new
ChatOptions
2466
var options = new
ChatOptions
2574
var options = new
ChatOptions
2672
var options = new
ChatOptions
2776
var options = new
ChatOptions
2873
var options = new
ChatOptions
2952
var options = new
ChatOptions
3053
var options = new
ChatOptions
3159
var options = new
ChatOptions
3250
var options = new
ChatOptions
3280
var options = new
ChatOptions
3311
var options = new
ChatOptions
3345
var options = new
ChatOptions
3391
var options = new
ChatOptions
{ Tools = [approvalFunc] };
3428
var options = new
ChatOptions
{ Tools = [approvalFunc] };
3462
var options = new
ChatOptions
3517
var options = new
ChatOptions
3593
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
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\TestJsonSerializerContext.ChatOptions.g.cs (1)
31
ObjectCreator = () => new global::Microsoft.Extensions.AI.
ChatOptions
(),
Microsoft.ML.GenAI.LLaMA (2)
Llama3CausalLMChatClient.cs (2)
32
options ??= new
ChatOptions
();
51
options ??= new
ChatOptions
();
Microsoft.ML.GenAI.Phi (2)
Phi3\Phi3CausalLMChatClient.cs (2)
37
options ??= new
ChatOptions
();
56
options ??= new
ChatOptions
();