1 write to Value
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatRole.cs (1)
46Value = Throw.IfNullOrWhitespace(value);
20 references to Value
Microsoft.Extensions.AI (2)
ChatCompletion\OpenTelemetryChatClient.cs (2)
438Role = message.Role != ChatRole.System && message.Role != ChatRole.User && !string.IsNullOrWhiteSpace(message.Role.Value) ? message.Role.Value : null,
Microsoft.Extensions.AI.Abstractions (5)
ChatCompletion\ChatRole.cs (5)
79=> string.Equals(Value, other.Value, StringComparison.OrdinalIgnoreCase); 83=> StringComparer.OrdinalIgnoreCase.GetHashCode(Value); 86public override string ToString() => Value; 98Throw.IfNull(writer).WriteStringValue(value.Value);
Microsoft.Extensions.AI.Abstractions.Tests (9)
ChatCompletion\ChatCompletionTests.cs (3)
226Assert.Equal("customRole", update0.Role?.Value); 276Assert.Equal("assistant", update0.Role?.Value); 287Assert.Equal("system", update1.Role?.Value);
ChatCompletion\ChatMessageTests.cs (1)
304Assert.Equal("user", deserializedMessage.Role.Value);
ChatCompletion\ChatRoleTests.cs (5)
15Assert.Equal("abc", new ChatRole("abc").Value); 48Assert.Equal("assistant", ChatRole.Assistant.Value); 49Assert.Equal("system", ChatRole.System.Value); 50Assert.Equal("tool", ChatRole.Tool.Value); 51Assert.Equal("user", ChatRole.User.Value);
Microsoft.Extensions.AI.Ollama (2)
OllamaChatClient.cs (2)
367Role = content.Role.Value, 389Role = content.Role.Value,
Microsoft.ML.GenAI.LLaMA (1)
Llama3_1ChatTemplateBuilder.cs (1)
108var role = message.Role.Value;
Microsoft.ML.GenAI.Phi (1)
Phi3\Phi3ChatTemplateBuilder.cs (1)
111var role = message.Role.Value;