From e9204217fc4dd6f04eefcd18ad36549bc1c4599b Mon Sep 17 00:00:00 2001 From: cinjospeh Date: Mon, 6 Jan 2025 14:36:45 +0800 Subject: [PATCH] fix format problem --- dbgpt/agent/core/base_agent.py | 3 ++- dbgpt/agent/expand/tool_assistant_agent.py | 13 ++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/dbgpt/agent/core/base_agent.py b/dbgpt/agent/core/base_agent.py index 40a34a9e8..de73265e8 100644 --- a/dbgpt/agent/core/base_agent.py +++ b/dbgpt/agent/core/base_agent.py @@ -482,7 +482,8 @@ async def generate_reply( question: str = received_message.content or "" ai_message: str = llm_reply or "" - # force_retry means this reply do not complete, should reentry and do more things + # force_retry means this reply do not complete + # should reentry and do more things force_retry = False if act_out is not None and act_out.force_retry: await self.write_memories( diff --git a/dbgpt/agent/expand/tool_assistant_agent.py b/dbgpt/agent/expand/tool_assistant_agent.py index 7eb84f1e0..7c7379915 100644 --- a/dbgpt/agent/expand/tool_assistant_agent.py +++ b/dbgpt/agent/expand/tool_assistant_agent.py @@ -63,14 +63,21 @@ def __init__(self, **kwargs): @property def desc(self) -> Optional[str]: + """Return desc of this agent.""" tools = _get_tools_by_resource(self.resource) - if tools is None or len(tools) == 0: return "Has no tools to use" + tools_desc_list = [] + for i in range(len(tools)): + tool = tools[i] + s = f"{i + 1}. tool {tool.name}, can {tool.description}." + tools_desc_list.append(s) + return ( - "Can use the following tools to complete the task objectives, tool information: " - f"{' '.join([f'{i+1}. tool {tools[i].name}, can {tools[i].description}.' for i in range(len(tools))])}" + "Can use the following tools to complete the task objectives, " + "tool information: " + f"{' '.join(tools_desc_list)}" )