73 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 (54)
ChatCompletion\FunctionInvokingChatClientApprovalsTests.cs (50)
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")),
1688new ToolApprovalRequestContent("approval-request-id", new FunctionCallContent("function-call-id", "Func1"))
1744new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer"))
1752new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func")),
1753new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer"))
1782new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func")),
1783new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer"))
1797new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer"))
1866new ToolApprovalRequestContent("ficc_callId1", new FunctionCallContent("callId1", "Func")),
1867new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer"))
1880new ToolApprovalRequestContent("callId2", new McpServerToolCallContent("callId2", "McpCall", "myServer"))
2103new 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:
1590case ToolApprovalRequestContent toolReq when toolReq.ToolCall is McpServerToolCallContent mcpToolCall:
Microsoft.Extensions.AI.OpenAI.Tests (13)
Microsoft.Extensions.AI.Tests (15)