From 5d972fa090d62a9e50db2139a97dbebd2d8446ff Mon Sep 17 00:00:00 2001 From: Travis Dent Date: Fri, 15 Nov 2024 11:02:34 -0800 Subject: [PATCH] put join inside format string with correct quotes --- agentstack/generation/tool_generation.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/agentstack/generation/tool_generation.py b/agentstack/generation/tool_generation.py index 944bbeb..f60b3f1 100644 --- a/agentstack/generation/tool_generation.py +++ b/agentstack/generation/tool_generation.py @@ -33,8 +33,7 @@ def add_tool(tool_name: str, path: Optional[str] = None): with importlib.resources.path(f'agentstack.templates.{framework}.tools', f"{tool_name}_tool.py") as tool_file_path: if tool_data.get('packages'): - packages = ' '.join(tool_data['packages']) - os.system(f'poetry add {packages}') # Install packages + os.system(f"poetry add {' '.join(tool_data['packages'])}") # Install packages shutil.copy(tool_file_path, f'{path}src/tools/{tool_name}_tool.py') # Move tool from package to project add_tool_to_tools_init(tool_data, path) # Export tool from tools dir add_tool_to_agent_definition(framework, tool_data, path) # Add tool to agent definition @@ -75,8 +74,7 @@ def remove_tool(tool_name: str, path: Optional[str] = None): with importlib.resources.path(f'agentstack.tools', f"{tool_name}.json") as tool_data_path: tool_data = open_json_file(tool_data_path) if tool_data.get('packages'): - packages = ' '.join(tool_data['packages']) - os.system(f'poetry remove {packages}') # Uninstall packages + os.system(f"poetry remove {' '.join(tool_data['packages'])}") # Uninstall packages os.remove(f'{path}src/tools/{tool_name}_tool.py') remove_tool_from_tools_init(tool_data, path) remove_tool_from_agent_definition(framework, tool_data, path)