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:
mykonos-ibiza 2025-08-01 01:43:22 +05:30
parent 2302b656f0
commit 8793dfcd25
1 changed files with 5 additions and 5 deletions

View File

@ -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(