Hi,
I use a non OpenAI LLM and use the llm =
parameter in my agents and tasks to assign my llm.
My sequential crew:
my_crew = Crew(
agents=[senior_researcher_agent,junior_researcher_agent],
tasks=[senior_research_task,junior_researcher_task],
process=Process.sequential,
verbose=True
)
Runs fine.
However my hierarchical crew:
hierarchical_crew = Crew(
agents=[junior_researcher_agent, senior_researcher_agent],
tasks=[senior_research_task, junior_researcher_task],
process=Process.hierarchical,
manager_agent=supervisor_agent,
planning=True,
verbose=True
)
My supervisor agent:
supervisor_agent = Agent(
role="A supervisor agent",
goal="To ensure that overspend doesn't happen and the senior researcher is only used for complex tasks",
backstory="""A seasoned supervisor who understands the difference between complex and easier tasks and will assign the questions to the correct agent based to ensure costs stay maintainable.""",
verbose=True,
allow_delegation=True,
llm = llm,
)
Returns this error
2025-03-11 08:23:24,739 - 139980965573632 - llm.py-llm:388 - ERROR: LiteLLM call failed: 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
File /opt/conda/envs/Python-RT24.1/lib/python3.11/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py:357, in exception_type(model, original_exception, custom_llm_provider, completion_kwargs, extra_kwargs)
352 elif (
353 "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"
354 in error_str
355 ):
356 exception_mapping_worked = True
--> 357 raise AuthenticationError(
358 message=f"AuthenticationError: {exception_provider} - {message}",
359 llm_provider=custom_llm_provider,
360 model=model,
361 response=getattr(original_exception, "response", None),
362 litellm_debug_info=extra_information,
363 )
364 elif "Mistral API raised a streaming error" in error_str:
365 exception_mapping_worked = True