94 references to User
Microsoft.Extensions.AI (4)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (3)
70CompleteAsync<T>(chatClient, [new ChatMessage(ChatRole.User, chatMessage)], options, useNativeJsonSchema, cancellationToken); 92CompleteAsync<T>(chatClient, [new ChatMessage(ChatRole.User, chatMessage)], serializerOptions, options, useNativeJsonSchema, cancellationToken); 174promptAugmentation = new ChatMessage(ChatRole.User, $$"""
ChatCompletion\OpenTelemetryChatClient.cs (1)
438Role = message.Role != ChatRole.System && message.Role != ChatRole.User && !string.IsNullOrWhiteSpace(message.Role.Value) ? message.Role.Value : null,
Microsoft.Extensions.AI.Abstractions (3)
ChatCompletion\ChatClientExtensions.cs (2)
45return client.CompleteAsync([new ChatMessage(ChatRole.User, chatMessage)], options, cancellationToken); 63return client.CompleteStreamingAsync([new ChatMessage(ChatRole.User, chatMessage)], options, cancellationToken);
ChatCompletion\ChatMessage.cs (1)
50public ChatRole Role { get; set; } = ChatRole.User;
Microsoft.Extensions.AI.Abstractions.Tests (15)
ChatCompletion\ChatClientExtensionsTests.cs (2)
60Assert.Equal(ChatRole.User, m.Role); 87Assert.Equal(ChatRole.User, m.Role);
ChatCompletion\ChatMessageTests.cs (6)
20Assert.Equal(ChatRole.User, message.Role); 60Assert.Throws<ArgumentNullException>("contents", () => new ChatMessage(ChatRole.User, (IList<AIContent>)null!)); 125ChatMessage message = new(ChatRole.User, 150ChatMessage message = new(ChatRole.User, []); 164ChatMessage message = new(ChatRole.User, 293var chatMessageJson = JsonSerializer.Serialize(new ChatMessage(ChatRole.User, contents: items)
ChatCompletion\ChatRoleTests.cs (1)
51Assert.Equal("user", ChatRole.User.Value);
ChatCompletion\DelegatingChatClientTests.cs (2)
70new() { Role = ChatRole.User, Text = "Message 1" }, 71new() { Role = ChatRole.User, Text = "Message 2" }
ChatCompletion\StreamingChatCompletionUpdateExtensionsTests.cs (2)
44new() { ChoiceIndex = 0, Text = ", ", AuthorName = "Someone", Role = ChatRole.User, AdditionalProperties = new() { ["a"] = "b" } }, 72Assert.Equal(ChatRole.User, message.Role);
ChatCompletion\StreamingChatCompletionUpdateTests.cs (2)
91Role = ChatRole.User, 120Role = ChatRole.User,
Microsoft.Extensions.AI.AzureAIInference (2)
AzureAIInferenceChatClient.cs (2)
273role.Equals(global::Azure.AI.Inference.ChatRole.User) ? ChatRole.User : 442else if (input.Role == ChatRole.User)
Microsoft.Extensions.AI.AzureAIInference.Tests (3)
AzureAIInferenceChatClientTests.cs (3)
310new(ChatRole.User, "hello!"), 312new(ChatRole.User, "i'm good. how are you?"), 403new(ChatRole.User, "hello!"),
Microsoft.Extensions.AI.Integration.Tests (13)
ChatClientIntegrationTests.cs (9)
62new(ChatRole.User, "Pick a city, any city"), 64new(ChatRole.User, "And another one"), 66new(ChatRole.User, "What continent are they each in?"), 81new(ChatRole.User, "Quote, word for word, Neil Armstrong's famous words.") 147new(ChatRole.User, 170new(ChatRole.User, "What is the current secret number?") 308var message = new ChatMessage(ChatRole.User, "Pick a random number, uniformly distributed between 1 and 1000000"); 325var message = new ChatMessage(ChatRole.User, "Pick a random number, uniformly distributed between 1 and 1000000"); 351var message = new ChatMessage(ChatRole.User, "Pick a random number, uniformly distributed between 1 and 1000000");
PromptBasedFunctionCallingChatClient.cs (1)
66message.Role = ChatRole.User;
ReducingChatClientTests.cs (3)
47new ChatMessage(ChatRole.User, "Hi there! Can you tell me about golden retrievers?"), 49new ChatMessage(ChatRole.User, "What kind of exercise do they need?"), 51new ChatMessage(ChatRole.User, "Are they good with kids?"),
Microsoft.Extensions.AI.Ollama.Tests (3)
OllamaChatClientTests.cs (3)
260new(ChatRole.User, "hello!"), 262new(ChatRole.User, "i'm good. how are you?"), 459new(ChatRole.User, "How old is Alice?"),
Microsoft.Extensions.AI.OpenAI (2)
OpenAIChatClient.cs (2)
378ChatMessageRole.User => ChatRole.User, 584if (input.Role == ChatRole.System || input.Role == ChatRole.User)
Microsoft.Extensions.AI.OpenAI.Tests (7)
OpenAIChatClientTests.cs (7)
356new(ChatRole.User, "hello!"), 358new(ChatRole.User, "i'm good. how are you?"), 457new(ChatRole.User, "hello!"), 548new(ChatRole.User, "hello!"), 550new(ChatRole.User, "i'm good. how are you?"), 888new(ChatRole.User, "hello!"), 901new(ChatRole.User, "Thanks!"),
Microsoft.Extensions.AI.Tests (33)
ChatCompletion\ChatClientStructuredOutputExtensionsTests.cs (11)
43Assert.Equal(ChatRole.User, message.Role); 56var chatHistory = new List<ChatMessage> { new(ChatRole.User, "Hello") }; 119var chatHistory = new List<ChatMessage> { new(ChatRole.User, "Hello") }; 138var chatHistory = new List<ChatMessage> { new(ChatRole.User, "Hello") }; 157var chatHistory = new List<ChatMessage> { new(ChatRole.User, "Hello") }; 193var chatHistory = new List<ChatMessage> { new(ChatRole.User, "Hello") }; 227var chatHistory = new List<ChatMessage> { new(ChatRole.User, "Hello") }; 255var chatHistory = new List<ChatMessage> { new(ChatRole.User, "Hello") }; 289Assert.Equal(ChatRole.User, message.Role); 301var chatHistory = new List<ChatMessage> { new(ChatRole.User, "Hello") }; 329var chatHistory = new List<ChatMessage> { new(ChatRole.User, "Hello") };
ChatCompletion\DistributedCachingChatClientTest.cs (6)
85var result1 = await outer.CompleteAsync([new ChatMessage(ChatRole.User, "some input")]); 90var result2 = await outer.CompleteAsync([new ChatMessage(ChatRole.User, "some input")]); 97await outer.CompleteAsync([new ChatMessage(ChatRole.User, "some modified input")]); 122var result1 = outer.CompleteAsync([new ChatMessage(ChatRole.User, "some input")]); 123var result2 = outer.CompleteAsync([new ChatMessage(ChatRole.User, "some input")]); 134var result3 = outer.CompleteAsync([new ChatMessage(ChatRole.User, "some input")]);
ChatCompletion\FunctionInvokingChatClientTests.cs (14)
57new ChatMessage(ChatRole.User, "hello"), 88new ChatMessage(ChatRole.User, "hello"), 140new ChatMessage(ChatRole.User, "hello"), 183new ChatMessage(ChatRole.User, "hello"), 219new ChatMessage(ChatRole.User, "hello"), 231new ChatMessage(ChatRole.User, "hello"), 271new ChatMessage(ChatRole.User, "hello"), 286new ChatMessage(ChatRole.User, "hello"), 294new ChatMessage(ChatRole.User, "hello"), 304new ChatMessage(ChatRole.User, "hello"), 337new ChatMessage(ChatRole.User, "hello"), 375List<ChatMessage> chat = [new ChatMessage(ChatRole.User, "hello")]; 396new ChatMessage(ChatRole.User, "hello"), 452new ChatMessage(ChatRole.User, "hello"),
ChatCompletion\OpenTelemetryChatClientTests.cs (2)
101new(ChatRole.User, "Hey!"), 105new(ChatRole.User, "What's the biggest animal?")
Microsoft.ML.GenAI.Core.Tests (1)
CasualLMDatasetTest.cs (1)
87new ChatMessage(ChatRole.User, "What is contoso"),
Microsoft.ML.GenAI.LLaMA (2)
Llama3_1ChatTemplateBuilder.cs (2)
93var availableRoles = new[] { ChatRole.System, ChatRole.User, ChatRole.Assistant }; 113_ when message.Role == ChatRole.User => $"<|start_header_id|>user<|end_header_id|>{Newline}{content.Trim()}<|eot_id|>{Newline}",
Microsoft.ML.GenAI.LLaMA.Tests (1)
LLaMA3_1Tests.cs (1)
135new ChatMessage(ChatRole.User, "Hello?"),
Microsoft.ML.GenAI.Phi (2)
Phi3\Phi3ChatTemplateBuilder.cs (2)
94var availableRoles = new[] { ChatRole.System, ChatRole.User, ChatRole.Assistant }; 116_ when message.Role == ChatRole.User => $"<|user|>{Newline}{content}<|end|>{Newline}",
Microsoft.ML.GenAI.Samples (3)
Llama\SFT_Llama_3_2_1B.cs (1)
108new ChatMessage(ChatRole.User, data.input),
MEAI\Llama3_1.cs (1)
47var chatMessage = new ChatMessage(ChatRole.User, task);
MEAI\Phi3.cs (1)
37var chatMessage = new ChatMessage(ChatRole.User, task);