Skip to content

[BUG] WebsiteSearchTool always uses OpenAI despite Ollama being specified (both llm and embedder) #4028

@MB-Finski

Description

@MB-Finski

Description

Following the docs here: https://docs.crewai.com/en/tools/search-research/websitesearchtool#customization-options

However, no matter what is set as the embedder and llm, WebSiteSearchTool always requires an OpenAI api key to be defined.

Steps to Reproduce

  1. Install crewai["tools"]
  2. Run the code provided in the docs
  3. The following error appears: "Value error, The OPENAI_API_KEY environment variable is not set."

Specifying a dummy key leads to a failing request to openai.

Expected behavior

Allow setting Ollama as the llm and embeddings provider.

Screenshots/Code snippets

website_tool = WebsiteSearchTool(
    config=dict(
        llm=dict(
            provider="ollama", # or google, openai, anthropic, llama2, ...
            config=dict(
                model=main_model,
                base_url=ollama_api_base_url,
            ),
        ),
        embedder=dict(
            provider="ollama", # or openai, ollama, ...
            config=dict(
                model_name="embeddinggemma:latest",
                base_url=ollama_api_base_url,
                api_key="ollama",
            ),
        ),
    )
)

Operating System

Other (specify in additional context)

Python Version

3.12

crewAI Version

1.6.1

crewAI Tools Version

1.6.1

Virtual Environment

Venv

Evidence

pydantic_core._pydantic_core.ValidationError: 1 validation error for WebsiteSearchTool
  Value error, The OPENAI_API_KEY environment variable is not set. [type=value_error, input_value={'config': {'llm': {'prov...'RETRIEVAL_DOCUMENT'}}}}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.12/v/value_error

Possible Solution

None

Additional context

OS: Debian 13

Metadata

Metadata

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