38 instantiations of ChatFinishReason
Microsoft.Extensions.AI.Abstractions (5)
Microsoft.Extensions.AI.Abstractions.Tests (30)
Microsoft.Extensions.AI.AzureAIInference (1)
Microsoft.Extensions.AI.Ollama (1)
Microsoft.Extensions.AI.OpenAI (1)
80 references to ChatFinishReason
Microsoft.Extensions.AI (1)
Microsoft.Extensions.AI.Abstractions (21)
ChatCompletion\ChatFinishReason.cs (19)
15public readonly struct ChatFinishReason : IEquatable<ChatFinishReason>
20/// <summary>Initializes a new instance of the <see cref="ChatFinishReason"/> struct with a string that describes the reason.</summary>
34public override bool Equals([NotNullWhen(true)] object? obj) => obj is ChatFinishReason other && Equals(other);
37public bool Equals(ChatFinishReason other) => StringComparer.OrdinalIgnoreCase.Equals(Value, other.Value);
48public static bool operator ==(ChatFinishReason left, ChatFinishReason right)
59public static bool operator !=(ChatFinishReason left, ChatFinishReason right)
68/// <summary>Gets a <see cref="ChatFinishReason"/> representing the model encountering a natural stop point or provided stop sequence.</summary>
69public static ChatFinishReason Stop { get; } = new("stop");
71/// <summary>Gets a <see cref="ChatFinishReason"/> representing the model reaching the maximum length allowed for the request and/or response (typically in terms of tokens).</summary>
72public static ChatFinishReason Length { get; } = new("length");
74/// <summary>Gets a <see cref="ChatFinishReason"/> representing the model requesting the use of a tool that was defined in the request.</summary>
75public static ChatFinishReason ToolCalls { get; } = new("tool_calls");
77/// <summary>Gets a <see cref="ChatFinishReason"/> representing the model filtering content, whether for safety, prohibited content, sensitive content, or other such issues.</summary>
78public static ChatFinishReason ContentFilter { get; } = new("content_filter");
82public sealed class Converter : JsonConverter<ChatFinishReason>
85public override ChatFinishReason Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) =>
89public override void Write(Utf8JsonWriter writer, ChatFinishReason value, JsonSerializerOptions options) =>
Microsoft.Extensions.AI.Abstractions.Tests (21)
Microsoft.Extensions.AI.AzureAIInference (6)
Microsoft.Extensions.AI.AzureAIInference.Tests (6)
Microsoft.Extensions.AI.Ollama (3)
Microsoft.Extensions.AI.Ollama.Tests (5)
Microsoft.Extensions.AI.OpenAI (6)
Microsoft.Extensions.AI.OpenAI.Tests (8)
Microsoft.Extensions.AI.Tests (2)
Microsoft.ML.GenAI.Core (1)