12 writes to Role
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatCompletion.cs (1)
142Role = choice.Role,
Microsoft.Extensions.AI.Abstractions.Tests (4)
ChatCompletion\StreamingChatCompletionUpdateTests.cs (4)
40update.Role = ChatRole.Assistant; 91Role = ChatRole.User, 120Role = ChatRole.User, 168Role = ChatRole.Assistant,
Microsoft.Extensions.AI.AzureAIInference (2)
AzureAIInferenceChatClient.cs (2)
177Role = streamedRole, 237Role = streamedRole,
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
154Role = chunk.Message?.Role is not null ? new ChatRole(chunk.Message.Role) : null,
Microsoft.Extensions.AI.OpenAI (2)
OpenAIChatClient.cs (2)
233Role = streamedRole, 326Role = streamedRole,
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
67Role = ChatRole.Assistant,
Microsoft.ML.GenAI.Core (1)
CausalLMPipelineChatClient.cs (1)
74Role = ChatRole.Assistant,
14 references to Role
Microsoft.Extensions.AI.Abstractions (2)
ChatCompletion\StreamingChatCompletionUpdate.cs (1)
25/// the same completion may have a <see langword="null"/> <see cref="StreamingChatCompletionUpdate.Role"/>
ChatCompletion\StreamingChatCompletionUpdateExtensions.cs (1)
109if (update.Role is ChatRole role && message.Role == default)
Microsoft.Extensions.AI.Abstractions.Tests (7)
ChatCompletion\ChatCompletionTests.cs (3)
226Assert.Equal("customRole", update0.Role?.Value); 276Assert.Equal("assistant", update0.Role?.Value); 287Assert.Equal("system", update1.Role?.Value);
ChatCompletion\StreamingChatCompletionUpdateTests.cs (4)
18Assert.Null(update.Role); 39Assert.Null(update.Role); 41Assert.Equal(ChatRole.Assistant, update.Role); 208Assert.Equal(ChatRole.Assistant, result.Role);
Microsoft.Extensions.AI.AzureAIInference.Tests (2)
AzureAIInferenceChatClientTests.cs (2)
220Assert.Equal(ChatRole.Assistant, updates[i].Role); 619Assert.Equal(ChatRole.Assistant, updates[i].Role);
Microsoft.Extensions.AI.Ollama.Tests (1)
OllamaChatClientTests.cs (1)
189Assert.Equal(ChatRole.Assistant, updates[i].Role);
Microsoft.Extensions.AI.OpenAI.Tests (2)
OpenAIChatClientTests.cs (2)
267Assert.Equal(ChatRole.Assistant, updates[i].Role); 770Assert.Equal(ChatRole.Assistant, updates[i].Role);