18 references to Value
Microsoft.Extensions.AI (2)
ChatCompletion\OpenTelemetryChatClient.cs (2)
355_ = activity.AddTag(OpenTelemetryConsts.GenAI.Response.FinishReasons, $"[\"{finishReason.Value.ToLowerInvariant()}\"]"); 458FinishReason = completion.FinishReason?.Value ?? "error",
Microsoft.Extensions.AI.Abstractions (8)
ChatCompletion\ChatFinishReason.cs (8)
31public string Value => _value ?? Stop.Value; 37public bool Equals(ChatFinishReason other) => StringComparer.OrdinalIgnoreCase.Equals(Value, other.Value); 40public override int GetHashCode() => StringComparer.OrdinalIgnoreCase.GetHashCode(Value); 64/// <summary>Gets the <see cref="Value"/> of the finish reason.</summary> 65/// <returns>The <see cref="Value"/> of the finish reason.</returns> 66public override string ToString() => Value; 90Throw.IfNull(writer).WriteStringValue(value.Value);
Microsoft.Extensions.AI.Abstractions.Tests (8)
ChatCompletion\ChatFinishReasonTests.cs (8)
15Assert.Equal("abc", new ChatFinishReason("abc").Value); 46Assert.Equal("stop", ChatFinishReason.Stop.Value); 47Assert.Equal("length", ChatFinishReason.Length.Value); 48Assert.Equal("tool_calls", ChatFinishReason.ToolCalls.Value); 49Assert.Equal("content_filter", ChatFinishReason.ContentFilter.Value); 55Assert.Equal("test", new ChatFinishReason("test").Value); 58Assert.Equal("TEST", new ChatFinishReason("TEST").Value); 61Assert.Equal("stop", default(ChatFinishReason).Value);