47 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 (7)
ChatCompletion\ChatCompletion{T}.cs (1)
20/// You can access the underlying JSON response on the <see cref="ChatCompletion.Message"/> property.
ChatCompletion\FunctionInvokingChatClient.cs (6)
225FunctionCallContent[] functionCallContents = response.Message.Contents.OfType<FunctionCallContent>().ToArray(); 238chatMessages.Add(response.Message); 241if (functionCallContents.Length == response.Message.Contents.Count) 245_ = messagesToRemove.Add(response.Message); 259response.Message.Contents = [.. response.Message.Contents, new UsageContent(usage)];
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)
148Assert.Equal("Hello! How can I assist you today?", response.Message.Text); 149Assert.Single(response.Message.Contents); 150Assert.Equal(ChatRole.Assistant, response.Message.Role); 410Assert.Equal("Hello.", response.Message.Text); 411Assert.Single(response.Message.Contents); 412Assert.Equal(ChatRole.Assistant, response.Message.Role);
Microsoft.Extensions.AI.Integration.Tests (1)
ChatClientIntegrationTests.cs (1)
52Assert.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.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); 464Assert.Equal("Hi! It's so good to hear from you!", response.Message.Text); 465Assert.Single(response.Message.Contents); 466Assert.Equal(ChatRole.Assistant, response.Message.Role); 557Assert.Equal("I’m doing well, thank you! What’s on your mind today?", response.Message.Text); 558Assert.Single(response.Message.Contents); 559Assert.Equal(ChatRole.Assistant, response.Message.Role); 908Assert.Equal("I’m doing well, thank you! What’s on your mind today?", response.Message.Text); 909Assert.Single(response.Message.Contents); 910Assert.Equal(ChatRole.Assistant, response.Message.Role);
Microsoft.Extensions.AI.Tests (10)
ChatCompletion\FunctionInvokingChatClientTests.cs (2)
527chat.Add(result.Message); 594chat.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);