Closed TzurV closed 2 weeks ago
It looks like this is supported in version 0.60.0
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
Description
Example in https://docs.crewai.com/how-to/LLM-Connections/#changing-the-llm fails
from crewai import Agent
Using OpenAI's GPT-4
openai_agent = Agent( role='OpenAI Expert', goal='Provide insights using GPT-4', backstory="An AI assistant powered by OpenAI's latest model.", llm='gpt-4' )
with the error: File "C:\Users\tzurv\AppData\Local\pypoetry\Cache\virtualenvs\hiregenieproject-hx_BYHb5-py3.11\Lib\site-packages\crewai\agents\agent_builder\base_agent.py", line 253, in set_cache_handler self.create_agent_executor() File "C:\Users\tzurv\AppData\Local\pypoetry\Cache\virtualenvs\hiregenieproject-hx_BYHb5-py3.11\Lib\site-packages\crewai\agent.py", line 302, in create_agent_executor bind = self.llm.bind(stop=stop_words) ^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'bind'. Did you mean: 'find'?
Steps to Reproduce
simple code example taken from https://docs.crewai.com/how-to/LLM-Connections/#changing-the-llm
Expected behavior
Agent creation successfully.
Screenshots/Code snippets
File "C:\Users\tzurv\AppData\Local\pypoetry\Cache\virtualenvs\hiregenieproject-hx_BYHb5-py3.11\Lib\site-packages\crewai\agent.py", line 118, in init super().init(config, data) File "C:\Users\tzurv\AppData\Local\pypoetry\Cache\virtualenvs\hiregenieproject-hx_BYHb5-py3.11\Lib\site-packages\crewai\agents\agent_builder\base_agent.py", line 133, in init super().init(config, data) File "C:\Users\tzurv\AppData\Local\pypoetry\Cache\virtualenvs\hiregenieproject-hx_BYHb5-py3.11\Lib\site-packages\pydantic\main.py", line 211, in init validated_self = self.__pydantic_validator__.validate_python(data, self_instance=self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\tzurv\AppData\Local\pypoetry\Cache\virtualenvs\hiregenieproject-hx_BYHb5-py3.11\Lib\site-packages\crewai\agent.py", line 147, in set_agent_executor self.set_cache_handler(self.cache_handler) File "C:\Users\tzurv\AppData\Local\pypoetry\Cache\virtualenvs\hiregenieproject-hx_BYHb5-py3.11\Lib\site-packages\crewai\agents\agent_builder\base_agent.py", line 253, in set_cache_handler self.create_agent_executor() File "C:\Users\tzurv\AppData\Local\pypoetry\Cache\virtualenvs\hiregenieproject-hx_BYHb5-py3.11\Lib\site-packages\crewai\agent.py", line 302, in create_agent_executor bind = self.llm.bind(stop=stop_words) ^^^^^^^^^^^^^ AttributeError: 'str' object has no attribute 'bind'. Did you mean: 'find'?
Operating System
Windows 11
Python Version
3.11
crewAI Version
0.51.1
crewAI Tools Version
0.12.0
Virtual Environment
Poetry
Evidence
poetry show crewai name : crewai
version : 0.51.1
description : Cutting-edge framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
dependencies
Possible Solution
NA
Additional context
NA