Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
tushitdave opened this issue Sep 10, 2024 · 0 comments
Open

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

tushitdave opened this issue Sep 10, 2024 · 0 comments

Comments

@tushitdave
Copy link

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'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant