Skip to content

Commit

Permalink
bug(agent):agent bug fix
Browse files Browse the repository at this point in the history
1.Fix autoplan mode rely message miss
2.Fix ToolExpert use plugin hub load bug
3.Modify Agent message output logic
  • Loading branch information
yhjun1026 committed Mar 13, 2024
1 parent fffcbf3 commit 607a290
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
7 changes: 3 additions & 4 deletions dbgpt/agent/memory/gpts_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,11 +174,10 @@ async def _messages_to_agents_vis(
"markdown": view_info,
}
)
return await vis_client.get(VisAgentMessages.vis_tag()).disply(
content=messages_view
)
vis_compent = vis_client.get(VisAgentMessages.vis_tag())
return await vis_compent.display(content=messages_view)

async def _messages_to_plan_vis(self, messages: List[Dict]):
if messages is None or len(messages) <= 0:
return ""
return await vis_client.get(VisAgentPlans.vis_tag()).disply(content=messages)
return await vis_client.get(VisAgentPlans.vis_tag()).display(content=messages)
12 changes: 11 additions & 1 deletion dbgpt/serve/agent/team/layout/agent_operator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from abc import ABC
from typing import Dict, List, Optional

from dbgpt.agent.agents.agent import Agent, AgentGenerateContext
from dbgpt.agent.agents.agent_new import Agent, AgentGenerateContext
from dbgpt.agent.agents.agents_manage import agent_manage
from dbgpt.agent.agents.base_agent_new import ConversableAgent
from dbgpt.agent.agents.llm.llm import LLMConfig
Expand Down Expand Up @@ -191,6 +191,7 @@ async def map(
agent_context=input_value.agent_context,
resource_loader=input_value.resource_loader,
llm_client=input_value.llm_client,
round_index=agent.consecutive_auto_reply_counter,
)

async def get_agent(
Expand All @@ -208,11 +209,19 @@ async def get_agent(
llm_config = LLMConfig(llm_client=input_value.llm_client)
else:
llm_config = LLMConfig(llm_client=self.llm_client)
else:
if not llm_config.llm_client:
if input_value.llm_client:
llm_config.llm_client = input_value.llm_client
else:
llm_config.llm_client = self.llm_client

kwargs = {}
if self.awel_agent.role_name:
kwargs["name"] = self.awel_agent.role_name
if self.awel_agent.fixed_subgoal:
kwargs["fixed_subgoal"] = self.awel_agent.fixed_subgoal

agent = (
await agent_cls(**kwargs)
.bind(input_value.memory)
Expand All @@ -222,6 +231,7 @@ async def get_agent(
.bind(input_value.resource_loader)
.build()
)

return agent


Expand Down

0 comments on commit 607a290

Please sign in to comment.