30 references to Tool
Microsoft.Extensions.AI (2)
ChatCompletion\FunctionInvokingChatClient.cs (1)
585ChatMessage message = new(ChatRole.Tool, contents);
ChatCompletion\OpenTelemetryChatClient.cs (1)
419else if (message.Role == ChatRole.Tool)
Microsoft.Extensions.AI.Abstractions.Tests (2)
ChatCompletion\ChatRoleTests.cs (1)
50Assert.Equal("tool", ChatRole.Tool.Value);
ChatCompletion\StreamingChatCompletionUpdateExtensionsTests.cs (1)
48new() { ChoiceIndex = 1, Text = "you!", Role = ChatRole.Tool, CreatedAt = new DateTimeOffset(3, 2, 3, 4, 5, 6, TimeSpan.Zero), AdditionalProperties = new() { ["e"] = "f", ["i"] = 42 } },
Microsoft.Extensions.AI.AzureAIInference (2)
AzureAIInferenceChatClient.cs (2)
275role.Equals(global::Azure.AI.Inference.ChatRole.Tool) ? ChatRole.Tool : 419else if (input.Role == ChatRole.Tool)
Microsoft.Extensions.AI.Ollama.Tests (1)
OllamaChatClientTests.cs (1)
461new(ChatRole.Tool, [new FunctionResultContent("abcd1234", "GetPersonAge", 42)]),
Microsoft.Extensions.AI.OpenAI (2)
OpenAIChatClient.cs (2)
380ChatMessageRole.Tool => ChatRole.Tool, 591else if (input.Role == ChatRole.Tool)
Microsoft.Extensions.AI.OpenAI.Tests (1)
OpenAIChatClientTests.cs (1)
895new (ChatRole.Tool,
Microsoft.Extensions.AI.Tests (20)
ChatCompletion\FunctionInvokingChatClientTests.cs (19)
59new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId1", "Func1", result: "Result 1")]), 61new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId2", "Func2", result: "Result 2: 42")]), 63new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId3", "VoidReturn", result: "Success: Function completed.")]), 95new ChatMessage(ChatRole.Tool, 106new ChatMessage(ChatRole.Tool, 146new ChatMessage(ChatRole.Tool, 189new ChatMessage(ChatRole.Tool, 221new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId1", "Func1", result: "Result 1")]), 223new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId2", "Func2", result: "Result 2: 42")]), 225new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId3", "VoidReturn", result: "Success: Function completed.")]), 273new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId2", "Func1", result: "Result 1")]), 275new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId2", "Func2", result: "Result 2: 42")]), 277new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId3", "VoidReturn", result: "Success: Function completed.")]), 296new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId2", "Func1", result: "Result 1")]), 298new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId2", "Func2", result: "Result 2: 42")]), 300new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId3", "VoidReturn", result: "Success: Function completed.")]), 339new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId1", "Func1", result: detailedErrors ? "Error: Function failed. Exception: Oh no!" : "Error: Function failed.")]), 398new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId1", "Func1", result: "Result 1")]), 454new ChatMessage(ChatRole.Tool, [new FunctionResultContent("callId1", "Func1", result: "Result 1")]),
ChatCompletion\OpenTelemetryChatClientTests.cs (1)
103new(ChatRole.Tool, [new FunctionResultContent("12345", "GetPersonName", "John")]),