34 instantiations of ChatResponseFormatJson
Microsoft.Extensions.AI.Abstractions (2)
Microsoft.Extensions.AI.Abstractions.Tests (32)
ChatCompletion\ChatResponseFormatTests.cs (32)
22Assert.Throws<ArgumentException>("schemaName", () => new ChatResponseFormatJson(null, "name"));
23Assert.Throws<ArgumentException>("schemaDescription", () => new ChatResponseFormatJson(null, null, "description"));
24Assert.Throws<ArgumentException>("schemaName", () => new ChatResponseFormatJson(null, "name", "description"));
30ChatResponseFormatJson f = new(null);
39ChatResponseFormatJson f = new("{}", "name", "description");
52Assert.False(ChatResponseFormat.Text.Equals(new ChatResponseFormatJson(null)));
53Assert.False(ChatResponseFormat.Text.Equals(new ChatResponseFormatJson("{}")));
58Assert.False(ChatResponseFormat.Json.Equals(new ChatResponseFormatJson("{}")));
60Assert.True(ChatResponseFormat.Json.Equals(new ChatResponseFormatJson(null)));
61Assert.Equal(ChatResponseFormat.Json.GetHashCode(), new ChatResponseFormatJson(null).GetHashCode());
63Assert.True(new ChatResponseFormatJson("{}").Equals(new ChatResponseFormatJson("{}")));
64Assert.Equal(new ChatResponseFormatJson("{}").GetHashCode(), new ChatResponseFormatJson("{}").GetHashCode());
66Assert.False(new ChatResponseFormatJson("""{ "prop": 42 }""").Equals(new ChatResponseFormatJson("""{ "prop": 43 }""")));
67Assert.NotEqual(new ChatResponseFormatJson("""{ "prop": 42 }""").GetHashCode(), new ChatResponseFormatJson("""{ "prop": 43 }""").GetHashCode()); // technically not guaranteed
69Assert.False(new ChatResponseFormatJson("""{ "prop": 42 }""").Equals(new ChatResponseFormatJson("""{ "PROP": 42 }""")));
70Assert.NotEqual(new ChatResponseFormatJson("""{ "prop": 42 }""").GetHashCode(), new ChatResponseFormatJson("""{ "PROP": 42 }""").GetHashCode()); // technically not guaranteed
72Assert.True(new ChatResponseFormatJson("{}", "name", "description").Equals(new ChatResponseFormatJson("{}", "name", "description")));
73Assert.False(new ChatResponseFormatJson("{}", "name", "description").Equals(new ChatResponseFormatJson("{}", "name", "description2")));
74Assert.False(new ChatResponseFormatJson("{}", "name", "description").Equals(new ChatResponseFormatJson("{}", "name2", "description")));
75Assert.False(new ChatResponseFormatJson("{}", "name", "description").Equals(new ChatResponseFormatJson("{}", "name2", "description2")));
77Assert.Equal(new ChatResponseFormatJson("{}", "name", "description").GetHashCode(), new ChatResponseFormatJson("{}", "name", "description").GetHashCode());
25 references to ChatResponseFormatJson
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (9)
Microsoft.Extensions.AI.Abstractions.Tests (5)
Microsoft.Extensions.AI.AzureAIInference (1)
Microsoft.Extensions.AI.Ollama (1)
Microsoft.Extensions.AI.OpenAI (1)
Microsoft.Extensions.AI.Tests (6)