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