when i try example with this https://docs.swarms.world/en/latest/swarms/tools/build_tool/#integrate-tools-into-agent
i get this error:
Traceback (most recent call last):
File "/Users/fenyi/codesy/swarm-test/test.py", line 109, in <module>
agent1 = Agent(
^^^^^^
File "/Users/fenyi/codesy/swarm-test/.venv/lib/python3.12/site-packages/swarms/structs/agent.py", line 407, in __init__
self.tool_struct = BaseTool(
^^^^^^^^^
File "/Users/fenyi/codesy/swarm-test/.venv/lib/python3.12/site-packages/pydantic/main.py", line 194, in __init__
self.__pydantic_validator__.validate_python(data, self_instance=self)
pydantic_core._pydantic_core.ValidationError: 1 validation error for BaseTool
base_models
Input should be a valid list [type=list_type, input_value=None, input_type=NoneType]
For further information visit https://errors.pydantic.dev/2.8/v/list_type
Sentry is attempting to send 2 pending events
actually list_base_models does not have default value,
you can ealisy find this question with this code
`from swarms import Agent
from swarms.prompts.tools import tool_sop_prompt
from swarm_models import OpenAIChat
from swarms_memory import ChromaDB
import subprocess
import os
from swarms.tools.base_tool import BaseTool
def terminal(
code: str,
):
"""
Run code in the terminal.
Args:
code (str): The code to run in the terminal.
Returns:
str: The output of the code.
"""
out = subprocess.run(
code, shell=True, capture_output=True, text=True
).stdout
return str(out)
BaseTool(
tools=[terminal],
base_models=None,
tool_system_prompt=tool_sop_prompt(),
)`
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too