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
20.19k stars 2.8k forks source link

Newly created project without edit has many issues #1013

Open ken4ward opened 2 months ago

ken4ward commented 2 months ago

I recently create a new project using the command crewai create projectname, without having made any edit to it, it returned a bunch of errors. I'll appreciate if someoe can help look into it.

 poetry run realanalysis
 [2024-07-27 13:08:45][DEBUG]: == Working Agent: AI LLMs Senior Data Researcher

 [2024-07-27 13:08:45][INFO]: == Starting Task: Conduct a thorough research about AI LLMs Make sure you find any interesting and relevant information given the current year is 2024.

> Entering new CrewAgentExecutor chain...
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/christdoes/Documents/projects/AILLM/projects/realanalysis/src/realanalysis/main.py", line 11, in run
    RealanalysisCrew().crew().kickoff(inputs=inputs)
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/crewai/crew.py", line 346, in kickoff
    result = self._run_sequential_process()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/crewai/crew.py", line 446, in _run_sequential_process
    output = task.execute(context=task_output)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/crewai/task.py", line 217, in execute
    result = self._execute(
             ^^^^^^^^^^^^^^
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/crewai/task.py", line 226, in _execute
    result = agent.execute_task(
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/crewai/agent.py", line 185, in execute_task
    result = self.agent_executor.invoke(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain/chains/base.py", line 166, in invoke
    raise e
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain/chains/base.py", line 156, in invoke
    self._call(inputs, run_manager=run_manager)
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/crewai/agents/executor.py", line 80, in _call
    next_step_output = self._take_next_step(
                       ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain/agents/agent.py", line 1318, in _take_next_step
    [
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/crewai/agents/executor.py", line 144, in _iter_next_step
    output = self.agent.plan(  # type: ignore #  Incompatible types in assignment (expression has type "AgentAction | AgentFinish | list[AgentAction]", variable has type "AgentAction")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain/agents/agent.py", line 463, in plan
    for chunk in self.runnable.stream(inputs, config={"callbacks": callbacks}):
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3253, in stream
    yield from self.transform(iter([input]), config, **kwargs)
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3240, in transform
    yield from self._transform_stream_with_config(
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 2053, in _transform_stream_with_config
    chunk: Output = context.run(next, iterator)  # type: ignore
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 3202, in _transform
    for output in final_pipeline:
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1271, in transform
    for ichunk in input:
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 5267, in transform
    yield from self.bound.transform(
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain_core/runnables/base.py", line 1289, in transform
    yield from self.stream(final, config, **kwargs)
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 373, in stream
    raise e
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain_core/language_models/chat_models.py", line 353, in stream
    for chunk in self._stream(messages, stop=stop, **kwargs):
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/langchain_openai/chat_models/base.py", line 521, in _stream
    response = self.client.create(**payload)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/openai/_utils/_utils.py", line 277, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py", line 646, in create
    return self._post(
           ^^^^^^^^^^^
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/openai/_base_client.py", line 1266, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/openai/_base_client.py", line 942, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "/Users/christdoes/Library/Caches/pypoetry/virtualenvs/realanalysis-3is9mu2f-py3.12/lib/python3.12/site-packages/openai/_base_client.py", line 1046, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.NotFoundError: 404 page not found

samplepro.zip I attached the sample project

theCyberTech commented 2 months ago

You cannot run the template unedited, you have to edit it to your preference

https://docs.crewai.com/how-to/Start-a-New-CrewAI-Project/#creating-a-new-project

zinyando commented 2 months ago

I think we should make sure the default template runs without having to change anything. This would help people go from 0 to 1 without friction. They would just have to configure their LLM and have a working project asap.

ken4ward commented 2 months ago

You cannot run the template unedited, you have to edit it to your preference

https://docs.crewai.com/how-to/Start-a-New-CrewAI-Project/#creating-a-new-project

The link you provided returned 404 error page. Please help edit to the correct one