MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / update_agent

Method update_agent

methods/letta/client/client.py:2417–2465  ·  view source on GitHub ↗

Update an existing agent Args: agent_id (str): ID of the agent name (str): Name of the agent description (str): Description of the agent system (str): System configuration tools (List[str]): List of tools metad

(
        self,
        agent_id: str,
        name: Optional[str] = None,
        description: Optional[str] = None,
        system: Optional[str] = None,
        tool_ids: Optional[List[str]] = None,
        tags: Optional[List[str]] = None,
        metadata: Optional[Dict] = None,
        llm_config: Optional[LLMConfig] = None,
        embedding_config: Optional[EmbeddingConfig] = None,
        message_ids: Optional[List[str]] = None,
    )

Source from the content-addressed store, hash-verified

2415 return self.server.agent_manager.get_agent_by_id(agent_state.id, actor=self.user)
2416
2417 def update_agent(
2418 self,
2419 agent_id: str,
2420 name: Optional[str] = None,
2421 description: Optional[str] = None,
2422 system: Optional[str] = None,
2423 tool_ids: Optional[List[str]] = None,
2424 tags: Optional[List[str]] = None,
2425 metadata: Optional[Dict] = None,
2426 llm_config: Optional[LLMConfig] = None,
2427 embedding_config: Optional[EmbeddingConfig] = None,
2428 message_ids: Optional[List[str]] = None,
2429 ):
2430 """
2431 Update an existing agent
2432
2433 Args:
2434 agent_id (str): ID of the agent
2435 name (str): Name of the agent
2436 description (str): Description of the agent
2437 system (str): System configuration
2438 tools (List[str]): List of tools
2439 metadata (Dict): Metadata
2440 llm_config (LLMConfig): LLM configuration
2441 embedding_config (EmbeddingConfig): Embedding configuration
2442 message_ids (List[str]): List of message IDs
2443 tags (List[str]): Tags for filtering agents
2444
2445 Returns:
2446 agent_state (AgentState): State of the updated agent
2447 """
2448 # TODO: add the ability to reset linked block_ids
2449 self.interface.clear()
2450 agent_state = self.server.agent_manager.update_agent(
2451 agent_id,
2452 UpdateAgent(
2453 name=name,
2454 system=system,
2455 tool_ids=tool_ids,
2456 tags=tags,
2457 description=description,
2458 metadata=metadata,
2459 llm_config=llm_config,
2460 embedding_config=embedding_config,
2461 message_ids=message_ids,
2462 ),
2463 actor=self.user,
2464 )
2465 return agent_state
2466
2467 def get_tools_from_agent(self, agent_id: str) -> List[Tool]:
2468 """

Callers 1

rename_agentMethod · 0.95

Calls 3

UpdateAgentClass · 0.90
clearMethod · 0.45
update_agentMethod · 0.45

Tested by

no test coverage detected