137 references to Assistant
Aspire.Azure.AI.OpenAI.Tests (1)
Aspire.OpenAI.Tests (1)
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (3)
Microsoft.Extensions.AI.Abstractions.Tests (18)
ChatCompletion\ChatCompletionTests.cs (10)
130new ChatMessage(ChatRole.Assistant, "Choice1"),
131new ChatMessage(ChatRole.Assistant, "Choice2"),
132new ChatMessage(ChatRole.Assistant, "Choice3"),
133new ChatMessage(ChatRole.Assistant, "Choice4"),
154Assert.Equal(ChatRole.Assistant, result.Choices[i].Role);
176new ChatMessage(ChatRole.Assistant, "This is a test." + Environment.NewLine + "It's multiple lines.")
187new ChatMessage(ChatRole.Assistant, "This is a test." + Environment.NewLine + "It's multiple lines."),
188new ChatMessage(ChatRole.Assistant, "So is" + Environment.NewLine + " this."),
189new ChatMessage(ChatRole.Assistant, "And this."),
239new ChatMessage(ChatRole.Assistant,
Microsoft.Extensions.AI.AzureAIInference (2)
Microsoft.Extensions.AI.AzureAIInference.Tests (9)
AzureAIInferenceChatClientTests.cs (9)
163Assert.Equal(ChatRole.Assistant, response.Message.Role);
239Assert.Equal(ChatRole.Assistant, updates[i].Role);
508new(ChatRole.Assistant, "hi, how are you?"),
510new(ChatRole.Assistant, [new FunctionCallContent("abcd123", "GetMood")]),
527Assert.Equal(ChatRole.Assistant, response.Message.Role);
651new(ChatRole.Assistant, (string?)null),
661Assert.Equal(ChatRole.Assistant, response.Message.Role);
775Assert.Equal(ChatRole.Assistant, response.Message.Role);
871Assert.Equal(ChatRole.Assistant, updates[i].Role);
Microsoft.Extensions.AI.Integration.Tests (5)
Microsoft.Extensions.AI.Ollama.Tests (7)
OllamaChatClientTests.cs (7)
122Assert.Equal(ChatRole.Assistant, response.Message.Role);
189Assert.Equal(ChatRole.Assistant, updates[i].Role);
261new(ChatRole.Assistant, "hi, how are you?"),
284Assert.Equal(ChatRole.Assistant, response.Message.Role);
373Assert.Equal(ChatRole.Assistant, response.Message.Role);
460new(ChatRole.Assistant, [new FunctionCallContent("abcd1234", "GetPersonAge", new Dictionary<string, object?> { ["personName"] = "Alice" })]),
471Assert.Equal(ChatRole.Assistant, response.Message.Role);
Microsoft.Extensions.AI.OpenAI (4)
Microsoft.Extensions.AI.OpenAI.Tests (19)
OpenAIChatClientTests.cs (12)
193Assert.Equal(ChatRole.Assistant, response.Message.Role);
273Assert.Equal(ChatRole.Assistant, updates[i].Role);
425new(ChatRole.Assistant, "hi, how are you?"),
442Assert.Equal(ChatRole.Assistant, response.Message.Role);
540Assert.Equal(ChatRole.Assistant, response.Message.Role);
629new(ChatRole.Assistant, (string?)null),
639Assert.Equal(ChatRole.Assistant, response.Message.Role);
752Assert.Equal(ChatRole.Assistant, response.Message.Role);
864Assert.Equal(ChatRole.Assistant, updates[i].Role);
989new(ChatRole.Assistant,
1000new(ChatRole.Assistant, "You are great."),
1010Assert.Equal(ChatRole.Assistant, response.Message.Role);
Microsoft.Extensions.AI.Tests (57)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (10)
20var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, JsonSerializer.Serialize(expectedResult))])
81var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, JsonSerializer.Serialize(expectedResult))]);
113var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, "This is not valid JSON")]);
132var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, "null")]);
151var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, [new ImageContent("https://example.com")])]);
171var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, JsonSerializer.Serialize(expectedResult))]);
215var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, JsonSerializer.Serialize(expectedResult))]);
250var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, JsonSerializer.Serialize(payload))]);
281var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, JsonSerializer.Serialize(expectedResult, jso))]);
327return Task.FromResult(new ChatCompletion([new ChatMessage(ChatRole.Assistant, resultDuplicatedJson)]));
ChatCompletion\FunctionInvokingChatClientTests.cs (38)
58new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]),
60new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
62new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } })]),
64new ChatMessage(ChatRole.Assistant, "world"),
89new ChatMessage(ChatRole.Assistant,
101new ChatMessage(ChatRole.Assistant,
111new ChatMessage(ChatRole.Assistant, "world"),
141new ChatMessage(ChatRole.Assistant,
151new ChatMessage(ChatRole.Assistant, "done"),
184new ChatMessage(ChatRole.Assistant,
194new ChatMessage(ChatRole.Assistant, "done"),
220new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]),
222new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
224new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } })]),
226new ChatMessage(ChatRole.Assistant, "world"),
232new ChatMessage(ChatRole.Assistant, "world")
272new ChatMessage(ChatRole.Assistant, [new TextContent("extra"), new FunctionCallContent("callId1", "Func1"), new TextContent("stuff")]),
274new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
276new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } }), new TextContent("more")]),
278new ChatMessage(ChatRole.Assistant, "world"),
287new ChatMessage(ChatRole.Assistant, [new TextContent("extra"), new TextContent("stuff")]),
288new ChatMessage(ChatRole.Assistant, "more"),
289new ChatMessage(ChatRole.Assistant, "world"),
295new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]),
297new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })]),
299new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId3", "VoidReturn", arguments: new Dictionary<string, object?> { { "i", 43 } })]),
301new ChatMessage(ChatRole.Assistant, "extrastuffmoreworld"),
305new ChatMessage(ChatRole.Assistant, "extrastuffmoreworld"),
338new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1")]),
340new ChatMessage(ChatRole.Assistant, "world"),
358new(ChatRole.Assistant, [new FunctionCallContent("callId1", func1.Metadata.Name)]),
359new(ChatRole.Assistant, [new FunctionCallContent("callId2", func2.Metadata.Name)]),
397new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["arg1"] = "value1" })]),
399new ChatMessage(ChatRole.Assistant, "world"),
453new ChatMessage(ChatRole.Assistant, [new FunctionCallContent("callId1", "Func1", new Dictionary<string, object?> { ["arg1"] = "value1" })]),
455new ChatMessage(ChatRole.Assistant, "world"),
582return new ChatCompletion(new ChatMessage(ChatRole.Assistant, [.. plan[contents.Count].Contents])) { Usage = usage };
672return YieldAsync(new ChatCompletion(new ChatMessage(ChatRole.Assistant, [.. plan[contents.Count].Contents])).ToStreamingChatCompletionUpdates());
Microsoft.ML.GenAI.Core (2)
Microsoft.ML.GenAI.Core.Tests (1)
Microsoft.ML.GenAI.LLaMA (2)
Microsoft.ML.GenAI.LLaMA.Tests (1)
Microsoft.ML.GenAI.Phi (2)
Microsoft.ML.GenAI.Samples (1)