fix: update imports for multi-agent (#1309)
This commit is contained in:
@@ -3,16 +3,18 @@ from typing import List, Optional
|
||||
from letta.agent import Agent, AgentState
|
||||
from letta.constants import DEFAULT_MESSAGE_TOOL
|
||||
from letta.functions.function_sets.multi_agent import send_message_to_all_agents_in_group
|
||||
from letta.functions.functions import parse_source_code
|
||||
from letta.functions.schema_generator import generate_schema
|
||||
from letta.interface import AgentInterface
|
||||
from letta.orm import User
|
||||
from letta.orm.enums import ToolType
|
||||
from letta.schemas.letta_message_content import TextContent
|
||||
from letta.schemas.message import Message, MessageCreate
|
||||
from letta.schemas.tool import Tool
|
||||
from letta.schemas.tool_rule import ChildToolRule, InitToolRule, TerminalToolRule
|
||||
from letta.schemas.usage import LettaUsageStatistics
|
||||
from letta.services.agent_manager import AgentManager
|
||||
from letta.services.tool_manager import ToolManager
|
||||
from tests.helpers.utils import create_tool_from_func
|
||||
|
||||
|
||||
class SupervisorMultiAgent(Agent):
|
||||
@@ -47,7 +49,14 @@ class SupervisorMultiAgent(Agent):
|
||||
|
||||
# add multi agent tool
|
||||
if self.tool_manager.get_tool_by_name(tool_name="send_message_to_all_agents_in_group", actor=self.user) is None:
|
||||
multi_agent_tool = create_tool_from_func(send_message_to_all_agents_in_group)
|
||||
multi_agent_tool = Tool(
|
||||
name=send_message_to_all_agents_in_group.__name__,
|
||||
description="",
|
||||
source_type="python",
|
||||
tags=[],
|
||||
source_code=parse_source_code(send_message_to_all_agents_in_group),
|
||||
json_schema=generate_schema(send_message_to_all_agents_in_group, None),
|
||||
)
|
||||
multi_agent_tool.tool_type = ToolType.LETTA_MULTI_AGENT_CORE
|
||||
multi_agent_tool = self.tool_manager.create_or_update_tool(
|
||||
pydantic_tool=multi_agent_tool,
|
||||
|
||||
Reference in New Issue
Block a user