mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-03 01:54:44 +00:00
fix(agent): Remove resources of planner agent (#1540)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
"""Planner Agent."""
|
"""Planner Agent."""
|
||||||
|
|
||||||
from typing import Any, Dict, List
|
from typing import Any, Dict, List, Optional
|
||||||
|
|
||||||
from dbgpt._private.pydantic import Field
|
from dbgpt._private.pydantic import Field
|
||||||
|
|
||||||
@@ -160,6 +160,15 @@ assistants:[
|
|||||||
self.resource = ResourcePack(resources)
|
self.resource = ResourcePack(resources)
|
||||||
return self
|
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]:
|
def prepare_act_param(self) -> Dict[str, Any]:
|
||||||
"""Prepare the parameters for the act method."""
|
"""Prepare the parameters for the act method."""
|
||||||
return {
|
return {
|
||||||
|
@@ -291,21 +291,13 @@ class MultiAgents(BaseComponent, ABC):
|
|||||||
else:
|
else:
|
||||||
raise ValueError(f"Unknown Agent Team Mode!{team_mode}")
|
raise ValueError(f"Unknown Agent Team Mode!{team_mode}")
|
||||||
manager = (
|
manager = (
|
||||||
await manager.bind(context)
|
await manager.bind(context).bind(llm_config).bind(agent_memory).build()
|
||||||
.bind(llm_config)
|
|
||||||
.bind(depend_resource)
|
|
||||||
.bind(agent_memory)
|
|
||||||
.build()
|
|
||||||
)
|
)
|
||||||
manager.hire(employees)
|
manager.hire(employees)
|
||||||
recipient = manager
|
recipient = manager
|
||||||
|
|
||||||
user_proxy: UserProxyAgent = (
|
user_proxy: UserProxyAgent = (
|
||||||
await UserProxyAgent()
|
await UserProxyAgent().bind(context).bind(agent_memory).build()
|
||||||
.bind(context)
|
|
||||||
.bind(depend_resource)
|
|
||||||
.bind(agent_memory)
|
|
||||||
.build()
|
|
||||||
)
|
)
|
||||||
if is_retry_chat:
|
if is_retry_chat:
|
||||||
# retry chat
|
# retry chat
|
||||||
|
Reference in New Issue
Block a user