48 references to Message
Aspire.Azure.AI.OpenAI.Tests (1)
AspireAzureOpenAIClientBuilderChatClientExtensionsTests.cs (1)
218Assert.Equal("Hello from middleware", completion.Message.Text);
Aspire.OpenAI.Tests (1)
AspireOpenAIClientBuilderChatClientExtensionsTests.cs (1)
219Assert.Equal("Hello from middleware", completion.Message.Text);
Microsoft.Extensions.AI (5)
ChatCompletion\ChatCompletion{T}.cs (1)
20/// You can access the underlying JSON response on the <see cref="ChatCompletion.Message"/> property.
ChatCompletion\FunctionInvokingChatClient.cs (4)
238FunctionCallContent[] functionCallContents = response.Message.Contents.OfType<FunctionCallContent>().ToArray(); 251chatMessages.Add(response.Message); 254if (functionCallContents.Length == response.Message.Contents.Count) 258_ = messagesToRemove.Add(response.Message);
Microsoft.Extensions.AI.Abstractions.Tests (6)
ChatCompletion\ChatCompletionTests.cs (4)
26Assert.Same(message, completion.Message); 51Assert.Throws<InvalidOperationException>(() => completion.Message); 60Assert.Same(message, completion.Message); 73Assert.Same(first, completion.Message);
ChatCompletion\StreamingChatCompletionUpdateExtensionsTests.cs (2)
181ChatMessage message = completion.Message; 209Assert.Equal("Hello, world!", Assert.IsType<TextContent>(Assert.Single(completion.Message.Contents)).Text);
Microsoft.Extensions.AI.AzureAIInference.Tests (6)
AzureAIInferenceChatClientTests.cs (6)
161Assert.Equal("Hello! How can I assist you today?", response.Message.Text); 162Assert.Single(response.Message.Contents); 163Assert.Equal(ChatRole.Assistant, response.Message.Role); 659Assert.Equal("Hello.", response.Message.Text); 660Assert.Single(response.Message.Contents); 661Assert.Equal(ChatRole.Assistant, response.Message.Role);
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
51Assert.Contains("whale", response.Message.Text, StringComparison.OrdinalIgnoreCase);
Microsoft.Extensions.AI.Ollama.Tests (3)
OllamaChatClientTests.cs (3)
120Assert.Equal("Hello! How are you today? Is there something", response.Message.Text); 121Assert.Single(response.Message.Contents); 122Assert.Equal(ChatRole.Assistant, response.Message.Role);
Microsoft.Extensions.AI.OpenAI (3)
OpenAIModelMapper.ChatCompletion.cs (3)
36foreach (AIContent content in chatCompletion.Message.Contents) 60role: ToOpenAIChatRole(chatCompletion.Message.Role).Value, 62content: new(ToOpenAIChatContent(chatCompletion.Message.Contents)),
Microsoft.Extensions.AI.OpenAI.Tests (12)
OpenAIChatClientTests.cs (12)
191Assert.Equal("Hello! How can I assist you today?", response.Message.Text); 192Assert.Single(response.Message.Contents); 193Assert.Equal(ChatRole.Assistant, response.Message.Role); 538Assert.Equal("Hi! It's so good to hear from you!", response.Message.Text); 539Assert.Single(response.Message.Contents); 540Assert.Equal(ChatRole.Assistant, response.Message.Role); 637Assert.Equal("I’m doing well, thank you! What’s on your mind today?", response.Message.Text); 638Assert.Single(response.Message.Contents); 639Assert.Equal(ChatRole.Assistant, response.Message.Role); 1008Assert.Equal("I’m doing well, thank you! What’s on your mind today?", response.Message.Text); 1009Assert.Single(response.Message.Contents); 1010Assert.Equal(ChatRole.Assistant, response.Message.Role);
Microsoft.Extensions.AI.Tests (10)
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
589chat.Add(result.Message); 679chat.Add(result.Message);
ChatCompletion\UseDelegateChatClientTests.cs (8)
76Assert.Equal("hello", completion.Message.Text); 80Assert.Equal("world", completion.Message.Text); 119Assert.Equal("hello world", completion.Message.Text); 122Assert.Equal("hello world", completion.Message.Text); 170Assert.Equal("hello world", completion.Message.Text); 173Assert.Equal("hello world", completion.Message.Text); 241Assert.Equal("non-streaming hello world (non-streaming)", completion.Message.Text); 244Assert.Equal("streaming hello world (streaming)", completion.Message.Text);