Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] pug with BaseTool init #605

Open
lometheus opened this issue Oct 14, 2024 · 2 comments
Open

[BUG] pug with BaseTool init #605

lometheus opened this issue Oct 14, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@lometheus
Copy link

lometheus commented Oct 14, 2024

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

bug from here
image

actually list_base_models does not have default value,
image

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(),
)`

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@lometheus lometheus added the bug Something isn't working label Oct 14, 2024
@lometheus
Copy link
Author

i believe give list_base_models a default value in class Agent can relsove this question

@peytontolbert
Copy link

submitted pull request to fix this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants