Skip to content

[BUG] #2517

Open
Open
[BUG]#2517
@annamalaiarunachalam

Description

@annamalaiarunachalam

Description

even if I set up the agent as Gemini, and pass the relevant API keys, in some cases, the crew when its run looks for openAI. why did you guys default everything to OpenAI, why can't the LLM be configured by the user for every instance where it is required??????

File ~\AppData\Roaming\Python\Python312\site-packages\litellm\llms\openai\openai.py:368, in OpenAIChatCompletion._get_openai_client(self, is_async, api_key, api_base, api_version, timeout, max_retries, organization, client)
366 else:
...
363 )
364 elif "Mistral API raised a streaming error" in error_str:
365 exception_mapping_worked = True

AuthenticationError: litellm.AuthenticationError: AuthenticationError: OpenAIException - The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...

Steps to Reproduce

no steps, just running crewAI's tutorial code - but using gemini models, of course with gemini API keys. I DO NOT USE OPENAI.

Expected behavior

accept other models.

Screenshots/Code snippets

none

Operating System

Ubuntu 20.04

Python Version

3.10

crewAI Version

0.108.0

crewAI Tools Version

0.38.1

Virtual Environment

Venv

Evidence

File ~\AppData\Roaming\Python\Python312\site-packages\litellm\llms\openai\openai.py:368, in OpenAIChatCompletion._get_openai_client(self, is_async, api_key, api_base, api_version, timeout, max_retries, organization, client)
366 else:
...
363 )
364 elif "Mistral API raised a streaming error" in error_str:
365 exception_mapping_worked = True

AuthenticationError: litellm.AuthenticationError: AuthenticationError: OpenAIException - The api_key client option must be set either by passing api_key to the client or by setting the OPENAI_API_KEY environment variable
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...

Possible Solution

support all models, remove openai as default for everything

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