You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’m experiencing issues when trying to connect CREW AI with Azure OpenAI. After some investigation, I found that only version 0.11 works with Azure OpenAI, but unfortunately, this version lacks the latest features available in more recent releases.
Could anyone guide me on how to connect to Azure OpenAI using an API key with the latest version of CREW AI? Alternatively, if there’s an example available, I haven’t been able to locate it.
Thank you in advance for any assistance!
Steps to Reproduce
run this code
`
import os
from dotenv import load_dotenv
from crewai import Agent, Task, Crew
from langchain_openai import AzureChatOpenAI
researcher = Agent(
role="Researcher",
goal="Analyze trends in artificial intelligence",
backstory="An AI researcher focused on trend analysis.",
llm=azure_llm, # Pasamos el modelo AzureChatOpenAI ya configurado
verbose=True
)
task = Task(
config={"name": "AI Trends Analysis", "description": "Analyze the latest trends in AI"},
agent=researcher,
description="Analyze trends in artificial intelligence with a focus on current advancements.",
expected_output="summary"
)
result = crew.kickoff()
print("Result:", result)
`
Expected behavior
I would like to be able to connect to Azure OpenAI using an Azure API key with the latest version of CREW AI. This would allow me to utilize the new features in the updated version while still connecting seamlessly to Azure OpenAI.
2024-10-31 14:15:12,382 - 137261981890368 - llm.py-llm:178 - ERROR: Failed to get supported params: argument of type 'NoneType' is not iterable
Agent: Researcher
Task: Analyze trends in artificial intelligence with a focus on current advancements.
2024-10-31 14:15:12,387 - 137261981890368 - llm.py-llm:161 - ERROR: LiteLLM call failed: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=gpt-4-preview
Pass model as E.g. For 'Huggingface' inference endpoints pass in completion(model='huggingface/starcoder',..) Learn more: https://docs.litellm.ai/docs/providers
Operating System
Ubuntu 22.04
Python Version
3.11
crewAI Version
Name: crewai Version: 0.70.1
crewAI Tools Version
crewai_tools==0.12.1
Virtual Environment
Venv
Evidence
File "/home/x/x/x/x/x/venv/lib/python3.11/site-packages/litellm/litellm_core_utils/get_llm_provider_logic.py", line 290, in get_llm_provider
raise litellm.exceptions.BadRequestError( # type: ignore
litellm.exceptions.BadRequestError: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=gpt-4o
Pass model as E.g. For 'Huggingface' inference endpoints pass in completion(model='huggingface/starcoder',..) Learn more: https://docs.litellm.ai/docs/providers
Possible Solution
when I use this requirements the previous code running
crewai==0.11.0
python-dotenv==1.0.0
langchain_openai==0.0.2
pandas
IPython
Additional context
The problem is trying to use the Azure OpenAI keys to run CrewAI on a more current version, at least from 0.7 and above, since it only works for 0.11 specifically.
Why do I want to use a higher version?
I want to use CrewAI for the tools and utilize the latest features.
Please, even a basic example of how I should use Azure with this new version, or if I'm missing something. I appreciate any help.
The text was updated successfully, but these errors were encountered:
Description
I’m experiencing issues when trying to connect CREW AI with Azure OpenAI. After some investigation, I found that only version 0.11 works with Azure OpenAI, but unfortunately, this version lacks the latest features available in more recent releases.
Could anyone guide me on how to connect to Azure OpenAI using an API key with the latest version of CREW AI? Alternatively, if there’s an example available, I haven’t been able to locate it.
Thank you in advance for any assistance!
Steps to Reproduce
run this code
`
import os
from dotenv import load_dotenv
from crewai import Agent, Task, Crew
from langchain_openai import AzureChatOpenAI
load_dotenv()
AZURE_OPENAI_API_KEY = os.getenv("AZURE_OPENAI_API_KEY")
AZURE_OPENAI_ENDPOINT = os.getenv("AZURE_OPENAI_ENDPOINT")
AZURE_OPENAI_API_VERSION = os.getenv("AZURE_OPENAI_API_VERSION")
AZURE_OPENAI_GPT4_DEPLOYMENT = os.getenv("AZURE_OPENAI_GPT4_DEPLOYMENT")
azure_llm = AzureChatOpenAI(
deployment_name=AZURE_OPENAI_GPT4_DEPLOYMENT,
temperature=0.5,
openai_api_key=AZURE_OPENAI_API_KEY,
azure_endpoint=AZURE_OPENAI_ENDPOINT,
openai_api_version=AZURE_OPENAI_API_VERSION,
openai_api_type='azure',
verbose=True
)
researcher = Agent(
role="Researcher",
goal="Analyze trends in artificial intelligence",
backstory="An AI researcher focused on trend analysis.",
llm=azure_llm, # Pasamos el modelo AzureChatOpenAI ya configurado
verbose=True
)
task = Task(
config={"name": "AI Trends Analysis", "description": "Analyze the latest trends in AI"},
agent=researcher,
description="Analyze trends in artificial intelligence with a focus on current advancements.",
expected_output="summary"
)
crew = Crew(
agents=[researcher],
tasks=[task],
process="sequential",
memory=False,
verbose=True
)
result = crew.kickoff()
print("Result:", result)
`
Expected behavior
I would like to be able to connect to Azure OpenAI using an Azure API key with the latest version of CREW AI. This would allow me to utilize the new features in the updated version while still connecting seamlessly to Azure OpenAI.
Screenshots/Code snippets
Provider List: https://docs.litellm.ai/docs/providers
2024-10-31 14:15:12,382 - 137261981890368 - llm.py-llm:178 - ERROR: Failed to get supported params: argument of type 'NoneType' is not iterable
Agent: Researcher
Task: Analyze trends in artificial intelligence with a focus on current advancements.
2024-10-31 14:15:12,387 - 137261981890368 - llm.py-llm:161 - ERROR: LiteLLM call failed: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=gpt-4-preview
Pass model as E.g. For 'Huggingface' inference endpoints pass in
completion(model='huggingface/starcoder',..)
Learn more: https://docs.litellm.ai/docs/providersOperating System
Ubuntu 22.04
Python Version
3.11
crewAI Version
Name: crewai Version: 0.70.1
crewAI Tools Version
crewai_tools==0.12.1
Virtual Environment
Venv
Evidence
File "/home/x/x/x/x/x/venv/lib/python3.11/site-packages/litellm/litellm_core_utils/get_llm_provider_logic.py", line 290, in get_llm_provider
raise litellm.exceptions.BadRequestError( # type: ignore
litellm.exceptions.BadRequestError: litellm.BadRequestError: LLM Provider NOT provided. Pass in the LLM provider you are trying to call. You passed model=gpt-4o
Pass model as E.g. For 'Huggingface' inference endpoints pass in
completion(model='huggingface/starcoder',..)
Learn more: https://docs.litellm.ai/docs/providersPossible Solution
when I use this requirements the previous code running
crewai==0.11.0
python-dotenv==1.0.0
langchain_openai==0.0.2
pandas
IPython
Additional context
The problem is trying to use the Azure OpenAI keys to run CrewAI on a more current version, at least from 0.7 and above, since it only works for 0.11 specifically.
Why do I want to use a higher version?
I want to use CrewAI for the tools and utilize the latest features.
Please, even a basic example of how I should use Azure with this new version, or if I'm missing something. I appreciate any help.
The text was updated successfully, but these errors were encountered: