9 writes to Text
Microsoft.Extensions.AI.Abstractions.Tests (6)
ChatCompletion\ChatMessageTests.cs (6)
140message.Text = "text-3"; 153message.Text = "text-1"; 172message.Text = "text-1"; 176message.Text = "text-2"; 183message.Text = "text-3"; 295Text = "content-1-override", // Override the content of the first text content item that has the "content-1" content
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
102message.Text = content;
Microsoft.Extensions.AI.Tests (2)
ChatCompletion\UseDelegateChatClientTests.cs (2)
111cc.Choices[0].Text += " world"; 214cc.Choices[0].Text += " world (non-streaming)";
65 references to Text
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.Abstractions.Tests (18)
ChatCompletion\ChatClientExtensionsTests.cs (2)
61Assert.Equal("hello", m.Text); 88Assert.Equal("hello", m.Text);
ChatCompletion\ChatCompletionTests.cs (2)
155Assert.Equal($"Choice{i + 1}", result.Choices[i].Text); 179Assert.Equal(completion.Choices[0].Text, completion.ToString());
ChatCompletion\ChatMessageTests.cs (10)
21Assert.Null(message.Text); 83Assert.Null(message.Text); 94Assert.Equal("text-0", message.Text); 137Assert.Equal("text-1", message.Text); 141Assert.Equal("text-3", message.Text); 142Assert.Equal("text-3", message.Text); 154Assert.Equal("text-1", message.Text); 173Assert.Equal("text-1", message.Text); 177Assert.Equal("text-2", message.Text); 184Assert.Equal("text-3", message.Text);
ChatCompletion\StreamingChatCompletionUpdateExtensionsTests.cs (4)
96Assert.Equal("Hello, world!", completion.Choices[0].Text); 97Assert.Equal("Hey, you!", completion.Choices[1].Text); 98Assert.Null(completion.Choices[2].Text); 110Assert.Null(completion.Choices[2].Text);
Microsoft.Extensions.AI.AzureAIInference (2)
AzureAIInferenceChatClient.cs (2)
417yield return new ChatRequestSystemMessage(input.Text ?? string.Empty); 450ChatRequestAssistantMessage message = new(input.Text ?? string.Empty);
Microsoft.Extensions.AI.AzureAIInference.Tests (2)
AzureAIInferenceChatClientTests.cs (2)
148Assert.Equal("Hello! How can I assist you today?", response.Message.Text); 410Assert.Equal("Hello.", response.Message.Text);
Microsoft.Extensions.AI.Integration.Tests (4)
ChatClientIntegrationTests.cs (1)
52Assert.Contains("whale", response.Message.Text, StringComparison.OrdinalIgnoreCase);
PromptBasedFunctionCallingChatClient.cs (1)
154var existingToolPrompt = chatMessages.FirstOrDefault(c => c.Text?.StartsWith(MessageIntro, StringComparison.Ordinal) is true);
ReducingChatClientTests.cs (2)
34m => Assert.StartsWith("Golden retrievers are quite active", m.Text, StringComparison.Ordinal), 35m => Assert.StartsWith("Are they good with kids?", m.Text, StringComparison.Ordinal));
Microsoft.Extensions.AI.Ollama.Tests (1)
OllamaChatClientTests.cs (1)
120Assert.Equal("Hello! How are you today? Is there something", response.Message.Text);
Microsoft.Extensions.AI.OpenAI.Tests (4)
OpenAIChatClientTests.cs (4)
191Assert.Equal("Hello! How can I assist you today?", response.Message.Text); 464Assert.Equal("Hi! It's so good to hear from you!", response.Message.Text); 557Assert.Equal("I’m doing well, thank you! What’s on your mind today?", response.Message.Text); 908Assert.Equal("I’m doing well, thank you! What’s on your mind today?", response.Message.Text);
Microsoft.Extensions.AI.Tests (28)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (16)
40message => Assert.Equal("Hello", message.Text), 44Assert.Contains("Respond with a JSON value", message.Text); 45Assert.Contains("https://json-schema.org/draft/2020-12/schema", message.Text); 48Assert.Contains(v.ToString(), message.Text); // All enum values are described as strings 74Assert.Equal("Hello", Assert.Single(chatHistory).Text); 87var suppliedSchemaMatch = Regex.Match(messages[1].Text!, "```(.*?)```", RegexOptions.Singleline); 187Assert.Equal("Hello", Assert.Single(messages).Text); 206Assert.Equal("Hello", Assert.Single(chatHistory).Text); 240Assert.Equal("Hello", Assert.Single(chatHistory).Text); 268Assert.Equal("Hello", Assert.Single(chatHistory).Text); 286message => Assert.Equal("Hello", message.Text), 290Assert.Contains("Respond with a JSON value", message.Text); 291Assert.Contains("https://json-schema.org/draft/2020-12/schema", message.Text); 292Assert.DoesNotContain(nameof(Animal.FullName), message.Text); // The JSO uses snake_case 293Assert.Contains("full_name", message.Text); // The JSO uses snake_case 294Assert.DoesNotContain(nameof(Species.Tiger), message.Text); // The JSO doesn't use enum-to-string conversion
ChatCompletion\FunctionInvokingChatClientTests.cs (4)
538Assert.Equal(expectedMessage.Text, chatMessage.Text); 605Assert.Equal(expectedMessage.Text, chatMessage.Text);
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);
Microsoft.ML.GenAI.LLaMA (2)
Llama3_1ChatTemplateBuilder.cs (2)
94if (messages.Any(m => m.Text is null)) 109var content = message.Text!;
Microsoft.ML.GenAI.Phi (2)
Phi3\Phi3ChatTemplateBuilder.cs (2)
95if (messages.Any(m => m.Text is null)) 112var content = message.Text;