mirror of https://github.com/kortix-ai/suna.git
Update Agent class's update method to support optional parameters
- Modified the `update` method in the `Agent` class to accept optional parameters for `name`, `system_prompt`, and `mcp_tools`, enhancing flexibility in agent property updates. - Adjusted internal logic to handle cases where `mcp_tools` is not provided, improving robustness in tool management.
This commit is contained in:
parent
2302b656f0
commit
8793dfcd25
|
@ -18,12 +18,12 @@ class Agent:
|
|||
|
||||
async def update(
|
||||
self,
|
||||
name: str,
|
||||
system_prompt: str,
|
||||
mcp_tools: list[KortixTools] = [],
|
||||
name: str | None = None,
|
||||
system_prompt: str | None = None,
|
||||
mcp_tools: list[KortixTools] | None = None,
|
||||
):
|
||||
agentpress_tools = {}
|
||||
custom_mcps: list[CustomMCP] = []
|
||||
agentpress_tools = {} if mcp_tools else None
|
||||
custom_mcps: list[CustomMCP] = [] if mcp_tools else None
|
||||
for tool in mcp_tools:
|
||||
if isinstance(tool, AgentPressTools):
|
||||
agentpress_tools[tool] = AgentPress_ToolConfig(
|
||||
|
|
Loading…
Reference in New Issue