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(api): clean up AssistantPromptMessage typing in CotChatAgentRunner (#34681)
Pulakesh2575a3a3abc2
diff --git a/api/core/agent/cot_chat_agent_runner.py b/api/core/agent/cot_chat_agent_runner.pyindex a4c438e9296..2b2e26987e8 100644--- a/api/core/agent/cot_chat_agent_runner.py+++ b/api/core/agent/cot_chat_agent_runner.py@@ -79,21 +79,18 @@ class CotChatAgentRunner(CotAgentRunner):if not agent_scratchpad:assistant_messages = []else:- assistant_message = AssistantPromptMessage(content="")- assistant_message.content = "" # FIXME: type check tell mypy that assistant_message.content is str+ content = ""for unit in agent_scratchpad:if unit.is_final():- assert isinstance(assistant_message.content, str)- assistant_message.content += f"Final Answer: {unit.agent_response}"+ content += f"Final Answer: {unit.agent_response}"else:- assert isinstance(assistant_message.content, str)- assistant_message.content += f"Thought: {unit.thought}\n\n"+ content += f"Thought: {unit.thought}\n\n"if unit.action_str:- assistant_message.content += f"Action: {unit.action_str}\n\n"+ content += f"Action: {unit.action_str}\n\n"if unit.observation:- assistant_message.content += f"Observation: {unit.observation}\n\n"+ content += f"Observation: {unit.observation}\n\n"- assistant_messages = [assistant_message]+ assistant_messages = [AssistantPromptMessage(content=content)]# query messagesquery_messages = self._organize_user_query(self._query, [])