2 types derived from ChatResponseFormat
Microsoft.Extensions.AI.Abstractions (2)
ChatCompletion\ChatResponseFormatJson.cs (1)
13public sealed class ChatResponseFormatJson : ChatResponseFormat
ChatCompletion\ChatResponseFormatText.cs (1)
13public sealed class ChatResponseFormatText : ChatResponseFormat
57 references to ChatResponseFormat
Microsoft.Extensions.AI (8)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (8)
42/// <see langword="true" /> to set a JSON schema on the <see cref="ChatResponseFormat"/>; otherwise, <see langword="false" />. The default is <see langword="true" />. 61/// <see langword="true" /> to set a JSON schema on the <see cref="ChatResponseFormat"/>; otherwise, <see langword="false" />. 81/// <see langword="true" /> to set a JSON schema on the <see cref="ChatResponseFormat"/>; otherwise, <see langword="false" />. The default is <see langword="true" />. 101/// <see langword="true" /> to set a JSON schema on the <see cref="ChatResponseFormat"/>; otherwise, <see langword="false" />. The default is <see langword="true" />. 122/// <see langword="true" /> to set a JSON schema on the <see cref="ChatResponseFormat"/>; otherwise, <see langword="false" />. The default is <see langword="true" />. 143/// <see langword="true" /> to set a JSON schema on the <see cref="ChatResponseFormat"/>; otherwise, <see langword="false" />. The default is <see langword="true" />. 203options.ResponseFormat = ChatResponseFormat.ForJsonSchema( 210options.ResponseFormat = ChatResponseFormat.Json;
Microsoft.Extensions.AI.Abstractions (7)
ChatCompletion\ChatOptions.cs (4)
69/// This property can be set to <see cref="ChatResponseFormat.Text"/> to specify that the response should be unstructured text, 70/// to <see cref="ChatResponseFormat.Json"/> to specify that the response should be structured JSON data, or 73/// to honor the request. If the client implementation doesn't recognize the specific kind of <see cref="ChatResponseFormat"/>, 76public ChatResponseFormat? ResponseFormat { get; set; }
ChatCompletion\ChatResponseFormat.cs (1)
17/// <summary>Initializes a new instance of the <see cref="ChatResponseFormat"/> class.</summary>
ChatCompletion\ChatResponseFormatText.cs (2)
10/// Use <see cref="ChatResponseFormat.Text"/> to get an instance of <see cref="ChatResponseFormatText"/>. 16/// <remarks> Use <see cref="ChatResponseFormat.Text"/> to get an instance of <see cref="ChatResponseFormatText"/>.</remarks>
Microsoft.Extensions.AI.Abstractions.Tests (17)
ChatCompletion\ChatOptionsTests.cs (4)
85options.ResponseFormat = ChatResponseFormat.Json; 102Assert.Same(ChatResponseFormat.Json, options.ResponseFormat); 120Assert.Same(ChatResponseFormat.Json, clone.ResponseFormat); 154options.ResponseFormat = ChatResponseFormat.Json;
ChatCompletion\ChatResponseFormatTests.cs (11)
17Assert.Same(ChatResponseFormat.Text, ChatResponseFormat.Text); 18Assert.Same(ChatResponseFormat.Json, ChatResponseFormat.Json); 50string json = JsonSerializer.Serialize(ChatResponseFormat.Text, TestJsonSerializerContext.Default.ChatResponseFormat); 53ChatResponseFormat? result = JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.ChatResponseFormat); 54Assert.Equal(ChatResponseFormat.Text, result); 60string json = JsonSerializer.Serialize(ChatResponseFormat.Json, TestJsonSerializerContext.Default.ChatResponseFormat); 63ChatResponseFormat? result = JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.ChatResponseFormat); 74ChatResponseFormat.ForJsonSchema(JsonSerializer.Deserialize<JsonElement>("[1,2,3]", AIJsonUtilities.DefaultOptions), "name", "description"), 78ChatResponseFormat? result = JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.ChatResponseFormat);
Utilities\AIJsonSchemaTransformCacheTests.cs (2)
65ChatResponseFormatJson responseFormat = ChatResponseFormat.ForJsonSchema(schema); 78JsonElement? transformedSchema = cache.GetOrCreateTransformedSchema(ChatResponseFormat.Json);
Microsoft.Extensions.AI.AzureAIInference.Tests (7)
AzureAIInferenceChatClientTests.cs (7)
361ResponseFormat = ChatResponseFormat.Json, 445ResponseFormat = ChatResponseFormat.Json, 532ResponseFormat = ChatResponseFormat.Json 607ResponseFormat = ChatResponseFormat.Json 796ResponseFormat = ChatResponseFormat.Text, 832ResponseFormat = ChatResponseFormat.Json, 889ResponseFormat = ChatResponseFormat.ForJsonSchema(JsonSerializer.Deserialize<JsonElement>("""
Microsoft.Extensions.AI.Evaluation.Integration.Tests (2)
QualityEvaluatorTests.cs (1)
36ResponseFormat = ChatResponseFormat.Text
SafetyEvaluatorTests.cs (1)
36ResponseFormat = ChatResponseFormat.Text
Microsoft.Extensions.AI.Evaluation.Quality (9)
CoherenceEvaluator.cs (1)
63ResponseFormat = ChatResponseFormat.Text
CompletenessEvaluator.cs (1)
60ResponseFormat = ChatResponseFormat.Text
EquivalenceEvaluator.cs (1)
59ResponseFormat = ChatResponseFormat.Text
FluencyEvaluator.cs (1)
57ResponseFormat = ChatResponseFormat.Text
GroundednessEvaluator.cs (1)
58ResponseFormat = ChatResponseFormat.Text
RelevanceEvaluator.cs (1)
61ResponseFormat = ChatResponseFormat.Text
RelevanceTruthAndCompletenessEvaluator.cs (1)
74ResponseFormat = ChatResponseFormat.Json
RetrievalEvaluator.cs (1)
67ResponseFormat = ChatResponseFormat.Text
Utilities\JsonOutputFixer.cs (1)
62ResponseFormat = ChatResponseFormat.Json
Microsoft.Extensions.AI.Ollama (1)
OllamaChatClient.cs (1)
296private static JsonElement? ToOllamaChatResponseFormat(ChatResponseFormat? format)
Microsoft.Extensions.AI.OpenAI.Tests (5)
OpenAIChatClientTests.cs (4)
353ResponseFormat = ChatResponseFormat.Json 432ResponseFormat = ChatResponseFormat.Json 515ResponseFormat = ChatResponseFormat.Json 591ResponseFormat = ChatResponseFormat.Json
OpenAIResponseClientTests.cs (1)
399ResponseFormat = ChatResponseFormat.Json
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
126ResponseFormat = ChatResponseFormat.Json,