AttributeError: 'AzureOpenAI' object has no attribute 'bind'

Aperta
#124 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
azure, jupyter-notebook, python
Ambito
ai

Direzione di ricerca

Riproduci il malfunzionamento con crewai 0.55.2, langchain 0.2.16 e Python 3.10 utilizzando il codice del notebook nell’issue. Inizia da crewai/agent.py:308, dove viene chiamato self.llm.bind(stop=stop_words), e determina il problema di compatibilità; il lavoro è completato quando l’agente basato su AzureOpenAI viene inizializzato senza questo AttributeError.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

This issue is for agentic approach where I am getting error "AzureOpenAI" object has no attribute 'bind'

Codes are as follows:
llm = AzureOpenAI(api_key=openai_api_key,
api_version="xxxx-xx-xx-preview",
azure_endpoint="https://xxxx-xxxxxxx.xxxxxx.xxxxx.com/")

load crewai tools

serper_search_tool = SerperDevTool()

load custom tools

kaggle_tool = KaggleDatasetDownloader()

data_collection_agent = Agent(
role='Data Acquisition Specialist',
goal='Find and download appropriate datasets on a given topic',
backstory='Expert in acquiring datasets from various sources, specializing in climate data',
tools=[serper_search_tool, kaggle_tool],
llm=llm,
verbose=True
)

vesrions:
crewai = 0.55.2
langchain = 0.2.16
python = 3.10

Error is as follows:

AttributeError Traceback (most recent call last)
Cell In[15], line 8
4 # load custom tools
5 kaggle_tool = KaggleDatasetDownloader()
----> 8 data_collection_agent = Agent(
9 role='Data Acquisition Specialist',
10 goal='Find and download appropriate datasets on a given topic',
11 backstory='Expert in acquiring datasets from various sources, specializing in climate data',
12 tools=[serper_search_tool, kaggle_tool],
13 llm=llm,
14 verbose=True
15 )

[... skipping hidden 1 frame]

File c:\Users\10742161\AppData\Local\anaconda3\envs\crewai\lib\site-packages\crewai\agent.py:129, in Agent.post_init_setup(self)
126 self._setup_llm_callbacks(model_name)
128 if not self.agent_executor:
--> 129 self._setup_agent_executor()
131 return self

File c:\Users\10742161\AppData\Local\anaconda3\envs\crewai\lib\site-packages\crewai\agent.py:154, in Agent._setup_agent_executor(self)
152 if not self.cache_handler:
153 self.cache_handler = CacheHandler()
--> 154 self.set_cache_handler(self.cache_handler)

File c:\Users\10742161\AppData\Local\anaconda3\envs\crewai\lib\site-packages\crewai\agents\agent_builder\base_agent.py:259, in BaseAgent.set_cache_handler(self, cache_handler)
257 self.cache_handler = cache_handler
258 self.tools_handler.cache = cache_handler
--> 259 self.create_agent_executor()

File c:\Users\10742161\AppData\Local\anaconda3\envs\crewai\lib\site-packages\crewai\agent.py:308, in Agent.create_agent_executor(self, tools)
303 if self.response_template:
304 stop_words.append(
305 self.response_template.split("{{ .Response }}")[1].strip()
306 )
--> 308 bind = self.llm.bind(stop=stop_words)
310 inner_agent = agent_args | execution_prompt | bind | CrewAgentParser(agent=self)
311 self.agent_executor = CrewAgentExecutor(
312 agent=RunnableAgent(runnable=inner_agent), **executor_args
313 )

AttributeError: 'AzureOpenAI' object has no attribute 'bind'

Lingua principale
Jupyter Notebook
Stelle
1.4k
Fork
455
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Azure-Samples/openai

Tutte le issue di Azure-Samples/openai

Issue simili

Altre issue su AI Infra & Agents

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.