Skip to content

[BUG] GithubSearchTool validation errors #2101

Closed
@baptiste-s

Description

@baptiste-s

Description

❯crewai version
crewai version: 0.100.1

and I am getting an error when using GithubSearchTool. It says gh_token and content_types are missing but there are not :

Traceback (most recent call last):
  File "/Users/XXX/Code/crewai_poc/test_xxx/.venv/bin/run_crew", line 10, in <module>
    sys.exit(run())
             ^^^^^
  File "/Users/XXX/Code/crewai_poc/test_XXX/src/test_baptiste/main.py", line 28, in run
    raise Exception(f"An error occurred while running the crew: {e}")
Exception: An error occurred while running the crew: 2 validation errors for GithubSearchTool
gh_token
  Field required [type=missing, input_value={}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.10/v/missing
content_types
  Field required [type=missing, input_value={}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.10/v/missing
An error occurred while running the crew: Command '['uv', 'run', 'run_crew']' returned non-zero exit status 1.

Steps to Reproduce

crew run

here is the code

github_tool = GithubSearchTool(
    github_repo='bap-s/api-mirai-it.git', 
    gh_token="<TOKEN>", 
    content_types=['code'],
    config=dict(
        llm=dict(
            provider="ollama",
            config=dict(
                model="llama3"       
            ),
        ),
        embedder=dict(
            provider="ollama",
            config=dict(
                model="all-minilm",
            ),
        ), 
    ),  
)

Expected behavior

should be able to use the tool

Screenshots/Code snippets

github_tool = GithubSearchTool(
    github_repo='bap-s/api-mirai-it.git', 
    gh_token="<TOKEN>", 
    content_types=['code'],
    config=dict(
        llm=dict(
            provider="ollama",
            config=dict(
                model="llama3"       
            ),
        ),
        embedder=dict(
            provider="ollama",
            config=dict(
                model="all-minilm",
            ),
        ), 
    ),  
)

Operating System

macOS Sonoma

Python Version

3.12

crewAI Version

0.100.1

crewAI Tools Version

0.33.0

Virtual Environment

Venv

Evidence

Traceback (most recent call last):
File "/Users/XXX/Code/crewai_poc/test_xxx/.venv/bin/run_crew", line 10, in
sys.exit(run())
^^^^^
File "/Users/XXX/Code/crewai_poc/test_XXX/src/test_baptiste/main.py", line 28, in run
raise Exception(f"An error occurred while running the crew: {e}")
Exception: An error occurred while running the crew: 2 validation errors for GithubSearchTool
gh_token
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.10/v/missing
content_types
Field required [type=missing, input_value={}, input_type=dict]
For further information visit https://errors.pydantic.dev/2.10/v/missing
An error occurred while running the crew: Command '['uv', 'run', 'run_crew']' returned non-zero exit status 1.

Possible Solution

None

Additional context

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions