crewAIInc / crewAI

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
https://crewai.com
MIT License
19.71k stars 2.73k forks source link

Support for Azure Open AI #1386

Open BodapatiNirupamasai opened 18 hours ago

BodapatiNirupamasai commented 18 hours ago
          I am trying to run the below code but somehow I am getting " Error code: 401 - {'error': {'message': 'Incorrect API key provided"

Could anyone help me with this?

from crewai import Agent from textwrap import dedent from tools import yt_tool from load_dotenv import load_dotenv from langchain_openai import AzureChatOpenAI import os

load_dotenv()

llm = AzureChatOpenAI( azure_deployment="gpt-4", api_version="2023-06-01-preview",
api_key=os.environ.get("key"), azure_endpoint=os.environ.get("endpoint"), )

researchAgent = Agent( role='Research Analsyt for Youtube Videos', goal='Search popular youtube videos to extract actionable insights for the topic {topic}', tools=[yt_tool], llm=llm, verbose= True, memory=True, allow_delegation=True, backstory=dedent("""You're a Research Analsyt at a large company. list 5 popular youtube videos on the {topic} as you're responsible for analyzing content in the youtube videos, providing insights and suggestions to the business."""), )

Originally posted by @BodapatiNirupamasai in https://github.com/crewAIInc/crewAI/issues/101#issuecomment-2389804994

voytas75 commented 9 hours ago

what is endpoint? and change invoking LLM to LiteLLM https://docs.litellm.ai/docs/providers/azure