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
18.94k stars 2.61k forks source link

output= crew.kickoff() error #589

Closed jakobe81 closed 1 week ago

jakobe81 commented 3 months ago

from langchain_community.llms import Ollama from crewai import Agent, Crew, Task, Process

model = Ollama(model = "ollama run llama3:8b")

Itinerary = "vacation through the colorado and the surrounding rocky mountains"

Travel_Agent = Agent( role = "create a list of key phrases and landmarks for non-english speakers to learn while on there vacation", goal = "help non english speakers learn how to navigate, ask for directions, order food, etc. based on their itinerary", backstory = "I am your guide to whatever country you desire to visit. I will help you learn about the culture, learn the language, and more.", verbose = True, allow_delegation = True, llm = model )

AnalyzeItinerary = Task( description = f"Analyze Vacation Itinerary", Agent = Travel_Agent, expected_output = "Some phrases they should learn are... and Some places they should go... and Fun Cultural Facts to keep in mind..." ) AnalyzeItineraryOutput = Task( description = f"Organize the information into a english language lesson", Agent = Travel_Agent, expected_output = "A lesson plan for learning the english they need to know to travel to where they are going" ) crew = Crew( agents= [Travel_Agent], tasks= [AnalyzeItinerary,AnalyzeItineraryOutput], verbose= 2, process= Process.sequential ) output= crew.kickoff() print(output)

I keep getting AttributeError: 'NoneType' object has no attribute 'allow_delegation'

jakobe81 commented 3 months ago

Traceback (most recent call last): File "c:\Users\jacob\AppData\Local\Programs\Python\Python312\Lib\runpy.py", line 198, in _run_module_as_main return _run_code(code, main_globals, None, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\jacob\AppData\Local\Programs\Python\Python312\Lib\runpy.py", line 88, in _run_code exec(code, run_globals) File "c:\Users\jacob.vscode\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy__main__.py", line 39, in cli.main() File "c:\Users\jacob.vscode\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 430, in main run() File "c:\Users\jacob.vscode\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy\adapter/../..\debugpy\launcher/../..\debugpy/..\debugpy\server\cli.py", line 284, in run_file runpy.run_path(target, run_name="main") File "c:\Users\jacob.vscode\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 321, in run_path return _run_module_code(code, init_globals, run_name, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\jacob.vscode\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 135, in _run_module_code _run_code(code, mod_globals, init_globals, File "c:\Users\jacob.vscode\extensions\ms-python.debugpy-2024.6.0-win32-x64\bundled\libs\debugpy_vendored\pydevd_pydevd_bundle\pydevd_runpy.py", line 124, in _run_code exec(code, run_globals) File "C:\Users\jacob\Downloads\llama lang\ver 1.py", line 34, in output= crew.kickoff() ^^^^^^^^^^^^^^ File "c:\Users\jacob\AppData\Local\Programs\Python\Python312\Lib\site-packages\crewai\crew.py", line 252, in kickoff result = self._run_sequential_process() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "c:\Users\jacob\AppData\Local\Programs\Python\Python312\Lib\site-packages\crewai\crew.py", line 275, in _run_sequential_process if task.agent.allow_delegation: ^^^^^^^^^^^^^^^^^^^^^^^^^^^

gives me all that bs

jakobe81 commented 3 months ago

its really simple how is it this difficult

slavakurilyak commented 3 months ago

You need more than one agent to delegate

As per crewAI docs:

Agents can delegate tasks or questions to one another, ensuring that each task is handled by the most suitable agent

github-actions[bot] commented 2 weeks ago

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.

github-actions[bot] commented 1 week ago

This issue was closed because it has been stalled for 5 days with no activity.