19 references to new
Microsoft.Extensions.AI.Abstractions (2)
ChatCompletion\ChatToolMode.cs (2)
41
public static RequiredChatToolMode RequireAny { get; } =
new
(requiredFunctionName: null);
50
public static RequiredChatToolMode RequireSpecific(string functionName) =>
new
(functionName);
Microsoft.Extensions.AI.Abstractions.Tests (17)
ChatCompletion\ChatToolModeTests.cs (17)
24
Assert.False(ChatToolMode.Auto.Equals(new
RequiredChatToolMode
(null)));
25
Assert.False(ChatToolMode.Auto.Equals(new
RequiredChatToolMode
("func")));
31
Assert.False(ChatToolMode.RequireAny.Equals(new
RequiredChatToolMode
("func")));
33
Assert.True(ChatToolMode.RequireAny.Equals(new
RequiredChatToolMode
(null)));
34
Assert.Equal(ChatToolMode.RequireAny.GetHashCode(), new
RequiredChatToolMode
(null).GetHashCode());
37
Assert.True(new
RequiredChatToolMode
("func").Equals(new
RequiredChatToolMode
("func")));
38
Assert.Equal(new
RequiredChatToolMode
("func").GetHashCode(), new
RequiredChatToolMode
("func").GetHashCode());
40
Assert.False(new
RequiredChatToolMode
("func1").Equals(new
RequiredChatToolMode
("func2")));
41
Assert.NotEqual(new
RequiredChatToolMode
("func1").GetHashCode(), new
RequiredChatToolMode
("func2").GetHashCode()); // technically not guaranteed
43
Assert.False(new
RequiredChatToolMode
("func1").Equals(new
RequiredChatToolMode
("FUNC1")));
44
Assert.NotEqual(new
RequiredChatToolMode
("func1").GetHashCode(), new
RequiredChatToolMode
("FUNC1").GetHashCode()); // technically not guaranteed