74 instantiations of ToolApprovalRequestContent
Microsoft.Extensions.AI (2)
Microsoft.Extensions.AI.Abstractions.Tests (14)
Contents\AIContentTests.cs (2)
77new ToolApprovalRequestContent("request123", new FunctionCallContent("call123", "functionName", new Dictionary<string, object?> { { "param1", 123 } })),
81new ToolApprovalRequestContent("request123", new McpServerToolCallContent("call123", "myTool", "myServer")),
Contents\InputRequestContentTests.cs (2)
40new ToolApprovalRequestContent("request123", new FunctionCallContent("call123", "functionName", new Dictionary<string, object?> { { "param1", 123 } })),
41new ToolApprovalRequestContent("request456", new McpServerToolCallContent("call456", "myTool", "myServer")),
Contents\ToolApprovalRequestContentTests.cs (10)
16Assert.Throws<ArgumentNullException>("requestId", () => new ToolApprovalRequestContent(null!, new FunctionCallContent("FCC1", "TestFunction")));
17Assert.Throws<ArgumentException>("requestId", () => new ToolApprovalRequestContent("", new FunctionCallContent("FCC1", "TestFunction")));
18Assert.Throws<ArgumentException>("requestId", () => new ToolApprovalRequestContent("\r\t\n ", new FunctionCallContent("FCC1", "TestFunction")));
19Assert.Throws<ArgumentNullException>("toolCall", () => new ToolApprovalRequestContent("id", null!));
35ToolApprovalRequestContent content = new(id, toolCall);
46ToolApprovalRequestContent content = new(id, toolCall);
67ToolApprovalRequestContent content = new(id, functionCall);
82var content = new ToolApprovalRequestContent("request123", toolCall);
137var content = new ToolApprovalRequestContent("req-1", new FunctionCallContent("call1", "Func"));
146var content = new ToolApprovalRequestContent("req-1", new FunctionCallContent("call1", "Func"))
Microsoft.Extensions.AI.OpenAI (3)
Microsoft.Extensions.AI.Tests (55)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (51)
48new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
49new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
84new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
85new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
133new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1"))
137new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
184new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
185new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
229new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
230new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Unknown"))
259new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
260new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
311new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
312new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
363new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
367new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
422new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
423new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
481new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
482new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
545new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
546new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
611new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
612new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } })),
613new ToolApprovalRequestContent("ficc_callId3", new FunctionCallContent("callId3", "Func3", arguments: new Dictionary<string, object?> { { "s", "test" } }))
703new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
761new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
762new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
789new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 3 } }))
815new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
816new ToolApprovalRequestContent("ficc_callId2", new FunctionCallContent("callId2", "Func2", arguments: new Dictionary<string, object?> { { "i", 42 } }))
827new ToolApprovalRequestContent("ficc_callId3", new FunctionCallContent("callId3", "Func1")),
894new ToolApprovalRequestContent("ficc_callId1", requestFcc),
966new ToolApprovalRequestContent("ficc_callId1", request1Fcc),
974new ToolApprovalRequestContent("ficc_callId2", request2Fcc),
1086new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
1302new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
1357new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
1415new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
1472new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func1")),
1745new ToolApprovalRequestContent("approval-request-id", new FunctionCallContent("function-call-id", "Func1"))
1801new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer"))
1809new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func")),
1810new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer"))
1839new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func")),
1840new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer"))
1854new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer"))
1923new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func")),
1924new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer"))
1937new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer"))
2160new ToolApprovalRequestContent(tarc.RequestId, (ToolCallContent)CloneFcc(tarc.ToolCall))
75 references to ToolApprovalRequestContent
Microsoft.AspNetCore.Components.AI (3)
Microsoft.Extensions.AI (13)
Microsoft.Extensions.AI.Abstractions (5)
Microsoft.Extensions.AI.Abstractions.Tests (19)
Microsoft.Extensions.AI.OpenAI (7)
OpenAIResponsesChatClient.cs (7)
185Dictionary<string, ToolApprovalRequestContent>? mcpApprovalRequests = null;
226var approvalRequest = new ToolApprovalRequestContent(mtcari.Id, new McpServerToolCallContent(mtcari.Id, mtcari.ToolName, mtcari.ServerLabel)
241when mcpApprovalRequests?.TryGetValue(mtcari.ApprovalRequestId, out ToolApprovalRequestContent? request) is true:
378Dictionary<string, ToolApprovalRequestContent>? mcpApprovalRequests = null;
529var streamApprovalRequest = new ToolApprovalRequestContent(mtcari.Id, new McpServerToolCallContent(mtcari.Id, mtcari.ToolName, mtcari.ServerLabel)
544when mcpApprovalRequests?.TryGetValue(mtcari.ApprovalRequestId, out ToolApprovalRequestContent? request) is true:
1599case ToolApprovalRequestContent toolReq when toolReq.ToolCall is McpServerToolCallContent mcpToolCall:
Microsoft.Extensions.AI.OpenAI.Tests (13)
Microsoft.Extensions.AI.Tests (15)