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