Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(agent): Remove resources of planner agent #1540

Merged
merged 1 commit into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion dbgpt/agent/core/plan/planner_agent.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Planner Agent."""

from typing import Any, Dict, List
from typing import Any, Dict, List, Optional

from dbgpt._private.pydantic import Field

Expand Down Expand Up @@ -160,6 +160,15 @@ def bind_agents(self, agents: List[ConversableAgent]) -> ConversableAgent:
self.resource = ResourcePack(resources)
return self

async def generate_resource_variables(
self, question: Optional[str] = None
) -> Dict[str, Any]:
"""Generate the resource variables."""
out_schema: Optional[str] = None
if self.actions and len(self.actions) > 0:
out_schema = self.actions[0].ai_out_schema
return {"out_schema": out_schema}

def prepare_act_param(self) -> Dict[str, Any]:
"""Prepare the parameters for the act method."""
return {
Expand Down
12 changes: 2 additions & 10 deletions dbgpt/serve/agent/agents/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,21 +291,13 @@ async def agent_team_chat_new(
else:
raise ValueError(f"Unknown Agent Team Mode!{team_mode}")
manager = (
await manager.bind(context)
.bind(llm_config)
.bind(depend_resource)
.bind(agent_memory)
.build()
await manager.bind(context).bind(llm_config).bind(agent_memory).build()
)
manager.hire(employees)
recipient = manager

user_proxy: UserProxyAgent = (
await UserProxyAgent()
.bind(context)
.bind(depend_resource)
.bind(agent_memory)
.build()
await UserProxyAgent().bind(context).bind(agent_memory).build()
)
if is_retry_chat:
# retry chat
Expand Down
Loading