127 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 (8)
AzureAIInferenceChatClientTests.cs (8)
150Assert.Equal(ChatRole.Assistant, response.Message.Role);
220Assert.Equal(ChatRole.Assistant, updates[i].Role);
311new(ChatRole.Assistant, "hi, how are you?"),
328Assert.Equal(ChatRole.Assistant, response.Message.Role);
402new(ChatRole.Assistant, (string?)null),
412Assert.Equal(ChatRole.Assistant, response.Message.Role);
518Assert.Equal(ChatRole.Assistant, response.Message.Role);
619Assert.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 (2)
Microsoft.Extensions.AI.OpenAI.Tests (12)
OpenAIChatClientTests.cs (12)
193Assert.Equal(ChatRole.Assistant, response.Message.Role);
267Assert.Equal(ChatRole.Assistant, updates[i].Role);
357new(ChatRole.Assistant, "hi, how are you?"),
374Assert.Equal(ChatRole.Assistant, response.Message.Role);
466Assert.Equal(ChatRole.Assistant, response.Message.Role);
549new(ChatRole.Assistant, (string?)null),
559Assert.Equal(ChatRole.Assistant, response.Message.Role);
666Assert.Equal(ChatRole.Assistant, response.Message.Role);
770Assert.Equal(ChatRole.Assistant, updates[i].Role);
889new(ChatRole.Assistant,
900new(ChatRole.Assistant, "You are great."),
910Assert.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))]);
213var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, JsonSerializer.Serialize(expectedResult))]);
248var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, JsonSerializer.Serialize(payload))]);
279var expectedCompletion = new ChatCompletion([new ChatMessage(ChatRole.Assistant, JsonSerializer.Serialize(expectedResult, jso))]);
325return 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"),
520return new ChatCompletion(new ChatMessage(ChatRole.Assistant, [.. plan[contents.Count].Contents]));
587return 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)