2 types derived from ChatToolMode
Microsoft.Extensions.AI.Abstractions (2)
62 references to ChatToolMode
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions (9)
Microsoft.Extensions.AI.Abstractions.Tests (41)
ChatCompletion\ChatToolModeTests.cs (34)
14Assert.Same(ChatToolMode.Auto, ChatToolMode.Auto);
15Assert.Same(ChatToolMode.RequireAny, ChatToolMode.RequireAny);
21Assert.True(ChatToolMode.Auto == ChatToolMode.Auto);
22Assert.True(ChatToolMode.Auto.Equals(ChatToolMode.Auto));
23Assert.False(ChatToolMode.Auto.Equals(ChatToolMode.RequireAny));
24Assert.False(ChatToolMode.Auto.Equals(new RequiredChatToolMode(null)));
25Assert.False(ChatToolMode.Auto.Equals(new RequiredChatToolMode("func")));
26Assert.Equal(ChatToolMode.Auto.GetHashCode(), ChatToolMode.Auto.GetHashCode());
28Assert.True(ChatToolMode.RequireAny == ChatToolMode.RequireAny);
29Assert.True(ChatToolMode.RequireAny.Equals(ChatToolMode.RequireAny));
30Assert.False(ChatToolMode.RequireAny.Equals(ChatToolMode.Auto));
31Assert.False(ChatToolMode.RequireAny.Equals(new RequiredChatToolMode("func")));
33Assert.True(ChatToolMode.RequireAny.Equals(new RequiredChatToolMode(null)));
34Assert.Equal(ChatToolMode.RequireAny.GetHashCode(), new RequiredChatToolMode(null).GetHashCode());
35Assert.Equal(ChatToolMode.RequireAny.GetHashCode(), ChatToolMode.RequireAny.GetHashCode());
50string json = JsonSerializer.Serialize(ChatToolMode.Auto, TestJsonSerializerContext.Default.ChatToolMode);
53ChatToolMode? result = JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.ChatToolMode);
54Assert.Equal(ChatToolMode.Auto, result);
60string json = JsonSerializer.Serialize(ChatToolMode.RequireAny, TestJsonSerializerContext.Default.ChatToolMode);
63ChatToolMode? result = JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.ChatToolMode);
64Assert.Equal(ChatToolMode.RequireAny, result);
70string json = JsonSerializer.Serialize(ChatToolMode.RequireSpecific("myFunc"), TestJsonSerializerContext.Default.ChatToolMode);
73ChatToolMode? result = JsonSerializer.Deserialize(json, TestJsonSerializerContext.Default.ChatToolMode);
74Assert.Equal(ChatToolMode.RequireSpecific("myFunc"), result);
Microsoft.Extensions.AI.AzureAIInference.Tests (4)
Microsoft.Extensions.AI.Integration.Tests (2)
Microsoft.Extensions.AI.OpenAI (3)
Microsoft.Extensions.AI.OpenAI.Tests (1)