22 references to Json
Microsoft.Extensions.AI (1)
ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
170
options.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)
75
options.ResponseFormat = ChatResponseFormat.
Json
;
89
Assert.Same(ChatResponseFormat.
Json
, options.ResponseFormat);
104
Assert.Same(ChatResponseFormat.
Json
, clone.ResponseFormat);
135
options.ResponseFormat = ChatResponseFormat.
Json
;
158
Assert.Equal(ChatResponseFormat.
Json
, deserialized.ResponseFormat);
159
Assert.NotSame(ChatResponseFormat.
Json
, deserialized.ResponseFormat);
ChatCompletion\ChatResponseFormatTests.cs (13)
16
Assert.Same(ChatResponseFormat.
Json
, ChatResponseFormat.
Json
);
51
Assert.False(ChatResponseFormat.Text.Equals(ChatResponseFormat.
Json
));
55
Assert.True(ChatResponseFormat.
Json
== ChatResponseFormat.
Json
);
56
Assert.True(ChatResponseFormat.
Json
.Equals(ChatResponseFormat.
Json
));
57
Assert.False(ChatResponseFormat.
Json
.Equals(ChatResponseFormat.Text));
58
Assert.False(ChatResponseFormat.
Json
.Equals(new ChatResponseFormatJson("{}")));
60
Assert.True(ChatResponseFormat.
Json
.Equals(new ChatResponseFormatJson(null)));
61
Assert.Equal(ChatResponseFormat.
Json
.GetHashCode(), new ChatResponseFormatJson(null).GetHashCode());
93
string json = JsonSerializer.Serialize(ChatResponseFormat.
Json
, TestJsonSerializerContext.Default.ChatResponseFormat);
97
Assert.Equal(ChatResponseFormat.
Json
, result);
Microsoft.Extensions.AI.Tests (1)
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
116
ResponseFormat = ChatResponseFormat.
Json
,