22 references to Json
Microsoft.Extensions.AI (1)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
170options.ResponseFormat = ChatResponseFormat.Json;
Microsoft.Extensions.AI.Abstractions (1)
ChatCompletion\ChatOptions.cs (1)
39/// to <see cref="ChatResponseFormat.Json"/> to specify that the response should be structured JSON data, or
Microsoft.Extensions.AI.Abstractions.Tests (19)
ChatCompletion\ChatOptionsTests.cs (6)
75options.ResponseFormat = ChatResponseFormat.Json; 89Assert.Same(ChatResponseFormat.Json, options.ResponseFormat); 104Assert.Same(ChatResponseFormat.Json, clone.ResponseFormat); 135options.ResponseFormat = ChatResponseFormat.Json; 158Assert.Equal(ChatResponseFormat.Json, deserialized.ResponseFormat); 159Assert.NotSame(ChatResponseFormat.Json, deserialized.ResponseFormat);
ChatCompletion\ChatResponseFormatTests.cs (13)
16Assert.Same(ChatResponseFormat.Json, ChatResponseFormat.Json); 51Assert.False(ChatResponseFormat.Text.Equals(ChatResponseFormat.Json)); 55Assert.True(ChatResponseFormat.Json == ChatResponseFormat.Json); 56Assert.True(ChatResponseFormat.Json.Equals(ChatResponseFormat.Json)); 57Assert.False(ChatResponseFormat.Json.Equals(ChatResponseFormat.Text)); 58Assert.False(ChatResponseFormat.Json.Equals(new ChatResponseFormatJson("{}"))); 60Assert.True(ChatResponseFormat.Json.Equals(new ChatResponseFormatJson(null))); 61Assert.Equal(ChatResponseFormat.Json.GetHashCode(), new ChatResponseFormatJson(null).GetHashCode()); 93string json = JsonSerializer.Serialize(ChatResponseFormat.Json, TestJsonSerializerContext.Default.ChatResponseFormat); 97Assert.Equal(ChatResponseFormat.Json, result);
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
116ResponseFormat = ChatResponseFormat.Json,