Skip to content

Commit 5d972fa

Browse files
committed
put join inside format string with correct quotes
1 parent c3f716a commit 5d972fa

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

agentstack/generation/tool_generation.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ def add_tool(tool_name: str, path: Optional[str] = None):
3333

3434
with importlib.resources.path(f'agentstack.templates.{framework}.tools', f"{tool_name}_tool.py") as tool_file_path:
3535
if tool_data.get('packages'):
36-
packages = ' '.join(tool_data['packages'])
37-
os.system(f'poetry add {packages}') # Install packages
36+
os.system(f"poetry add {' '.join(tool_data['packages'])}") # Install packages
3837
shutil.copy(tool_file_path, f'{path}src/tools/{tool_name}_tool.py') # Move tool from package to project
3938
add_tool_to_tools_init(tool_data, path) # Export tool from tools dir
4039
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):
7574
with importlib.resources.path(f'agentstack.tools', f"{tool_name}.json") as tool_data_path:
7675
tool_data = open_json_file(tool_data_path)
7776
if tool_data.get('packages'):
78-
packages = ' '.join(tool_data['packages'])
79-
os.system(f'poetry remove {packages}') # Uninstall packages
77+
os.system(f"poetry remove {' '.join(tool_data['packages'])}") # Uninstall packages
8078
os.remove(f'{path}src/tools/{tool_name}_tool.py')
8179
remove_tool_from_tools_init(tool_data, path)
8280
remove_tool_from_agent_definition(framework, tool_data, path)

0 commit comments

Comments
 (0)