19 instantiations of RequiredChatToolMode
Microsoft.Extensions.AI.Abstractions (2)
ChatCompletion\ChatToolMode.cs (2)
41public static RequiredChatToolMode RequireAny { get; } = new(requiredFunctionName: null); 50public static RequiredChatToolMode RequireSpecific(string functionName) => new(functionName);
Microsoft.Extensions.AI.Abstractions.Tests (17)
ChatCompletion\ChatToolModeTests.cs (17)
24Assert.False(ChatToolMode.Auto.Equals(new RequiredChatToolMode(null))); 25Assert.False(ChatToolMode.Auto.Equals(new RequiredChatToolMode("func"))); 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()); 37Assert.True(new RequiredChatToolMode("func").Equals(new RequiredChatToolMode("func"))); 38Assert.Equal(new RequiredChatToolMode("func").GetHashCode(), new RequiredChatToolMode("func").GetHashCode()); 40Assert.False(new RequiredChatToolMode("func1").Equals(new RequiredChatToolMode("func2"))); 41Assert.NotEqual(new RequiredChatToolMode("func1").GetHashCode(), new RequiredChatToolMode("func2").GetHashCode()); // technically not guaranteed 43Assert.False(new RequiredChatToolMode("func1").Equals(new RequiredChatToolMode("FUNC1"))); 44Assert.NotEqual(new RequiredChatToolMode("func1").GetHashCode(), new RequiredChatToolMode("FUNC1").GetHashCode()); // technically not guaranteed
11 references to RequiredChatToolMode
Microsoft.Extensions.AI (2)
ChatCompletion\FunctionInvokingChatClient.cs (2)
271case ContinueMode.Continue when options.ToolMode is RequiredChatToolMode: 377case ContinueMode.Continue when options.ToolMode is RequiredChatToolMode:
Microsoft.Extensions.AI.Abstractions (7)
ChatCompletion\ChatToolMode.cs (4)
17[JsonDerivedType(typeof(RequiredChatToolMode), typeDiscriminator: "required")] 41public static RequiredChatToolMode RequireAny { get; } = new(requiredFunctionName: null); 49/// <returns>An instance of <see cref="RequiredChatToolMode"/> for the specified function name.</returns> 50public static RequiredChatToolMode RequireSpecific(string functionName) => new(functionName);
ChatCompletion\RequiredChatToolMode.cs (3)
26/// Initializes a new instance of the <see cref="RequiredChatToolMode"/> class that requires a specific function to be called. 55obj is RequiredChatToolMode other && 61typeof(RequiredChatToolMode).GetHashCode();
Microsoft.Extensions.AI.AzureAIInference (1)
AzureAIInferenceChatClient.cs (1)
353case RequiredChatToolMode required:
Microsoft.Extensions.AI.OpenAI (1)
OpenAIChatClient.cs (1)
467case RequiredChatToolMode required: