mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
Inlined single use variables.
This commit is contained in:
+6
-12
@@ -276,13 +276,9 @@ class InvokeMcpToolActionExecutor(DeclarativeActionExecutor):
|
|||||||
state = self._get_state(ctx.state)
|
state = self._get_state(ctx.state)
|
||||||
|
|
||||||
tool_name = original_request.tool_name
|
tool_name = original_request.tool_name
|
||||||
server_url = original_request.server_url
|
|
||||||
server_label = original_request.server_label
|
|
||||||
arguments = original_request.arguments
|
|
||||||
connection_name = getattr(original_request, "connection_name", None)
|
|
||||||
metadata: dict[str, Any] = getattr(original_request, "metadata", None) or {}
|
metadata: dict[str, Any] = getattr(original_request, "metadata", None) or {}
|
||||||
raw_conversation_id = metadata.get("conversation_id")
|
raw_conversation_id = metadata.get("conversation_id")
|
||||||
conversation_id = str(raw_conversation_id) if isinstance(raw_conversation_id, str) and raw_conversation_id else None
|
conversation_id = raw_conversation_id if isinstance(raw_conversation_id, str) and raw_conversation_id else None
|
||||||
|
|
||||||
auto_send = self._get_auto_send(state)
|
auto_send = self._get_auto_send(state)
|
||||||
output_messages_path = _get_output_path(self._action_def, "messages")
|
output_messages_path = _get_output_path(self._action_def, "messages")
|
||||||
@@ -299,15 +295,13 @@ class InvokeMcpToolActionExecutor(DeclarativeActionExecutor):
|
|||||||
await ctx.send_message(ActionComplete())
|
await ctx.send_message(ActionComplete())
|
||||||
return
|
return
|
||||||
|
|
||||||
headers = self._evaluate_headers(state, self._action_def.get("headers"))
|
|
||||||
|
|
||||||
invocation = MCPToolInvocation(
|
invocation = MCPToolInvocation(
|
||||||
server_url=server_url,
|
server_url=original_request.server_url,
|
||||||
tool_name=tool_name,
|
tool_name=tool_name,
|
||||||
server_label=server_label,
|
server_label=original_request.server_label,
|
||||||
arguments=arguments,
|
arguments=original_request.arguments,
|
||||||
headers=headers,
|
headers=self._evaluate_headers(state, self._action_def.get("headers")),
|
||||||
connection_name=connection_name,
|
connection_name=getattr(original_request, "connection_name", None),
|
||||||
)
|
)
|
||||||
result = await self._invoke_with_narrow_catch(invocation)
|
result = await self._invoke_with_narrow_catch(invocation)
|
||||||
await self._process_result(
|
await self._process_result(
|
||||||
|
|||||||
Reference in New Issue
Block a user