Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
refactor: replace bare dict with ActionDict TypedDict in cot_agent_runner (#34997)
wdeveloper16602753b68abf
diff --git a/api/core/agent/cot_agent_runner.py b/api/core/agent/cot_agent_runner.pyindex 11e2aa062d2..f07ac644988 100644--- a/api/core/agent/cot_agent_runner.py+++ b/api/core/agent/cot_agent_runner.py@@ -2,7 +2,7 @@ import jsonimport loggingfrom abc import ABC, abstractmethodfrom collections.abc import Generator, Mapping, Sequence-from typing import Any+from typing import Any, TypedDictfrom graphon.model_runtime.entities.llm_entities import LLMResult, LLMResultChunk, LLMResultChunkDelta, LLMUsagefrom graphon.model_runtime.entities.message_entities import (@@ -29,6 +29,13 @@ from models.model import Messagelogger = logging.getLogger(__name__)+class ActionDict(TypedDict):+ """Shape produced by AgentScratchpadUnit.Action.to_dict()."""++ action: str+ action_input: dict[str, Any] | str++class CotAgentRunner(BaseAgentRunner, ABC):_is_first_iteration = True_ignore_observation_providers = ["wenxin"]@@ -331,7 +338,7 @@ class CotAgentRunner(BaseAgentRunner, ABC):return tool_invoke_response, tool_invoke_meta- def _convert_dict_to_action(self, action: dict) -> AgentScratchpadUnit.Action:+ def _convert_dict_to_action(self, action: ActionDict) -> AgentScratchpadUnit.Action:"""convert dict to action"""