crewAIInc / crewAI-examples

A collection of examples that show how to use CrewAI framework to automate workflows.
2.86k stars 1.09k forks source link

write_a_book_with_flows update new version #181

Open bitsec12 opened 2 weeks ago

bitsec12 commented 2 weeks ago

It looks like crewAI switched from poetry. Could you update and fix the example please? I'm not able to test it. Thanks!

CStrue commented 1 week ago

I'm also not able to run it:

Traceback (most recent call last): File "", line 14, in File "C:\Users..\AppData\Local\uv\cache\builds-v0.tmpZ8SCH2\Lib\site-packages\hatchling\build.py", line 142, in prepare_metadata_for_build_editable f.write(builder.config.core_metadata_constructor(builder.metadata, extra_dependencies=extra_dependencies)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users..\AppData\Local\uv\cache\builds-v0.tmpZ8SCH2\Lib\site-packages\hatchling\metadata\spec.py", line 495, in construct_metadata_file_2_3 if metadata.core.dependencies: ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users..\AppData\Local\uv\cache\builds-v0.tmpZ8SCH2\Lib\site-packages\hatchling\metadata\core.py", line 1230, in dependencies self._dependencies = list(self.dependencies_complex) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users..\AppData\Local\uv\cache\builds-v0.tmpZ8SCH2\Lib\site-packages\hatchling\metadata\core.py", line 1208, in dependencies_complex raise ValueError(message) from None ValueError: Dependency #2 of field project.dependencies is invalid: Expected end or semicolon (after name and no valid version specifier) asyncio* ^ An error occurred while running the crew: Command '['uv', 'run', 'run_crew']' returned non-zero exit status 2.

CStrue commented 1 week ago

update pyproject.toml to this:

[project] name = "write_a_book_with_flows" version = "0.1.0" description = "write_a_book_with_flows using crewAI" authors = [ { name = "Your Name", email = "you@example.com" }, ] requires-python = ">=3.10,<=3.13" dependencies = [ "crewai[tools]>=0.76.2,<1.0.0", "asyncio", ]

[project.scripts] kickoff = "write_a_book_with_flows.main:kickoff" plot = "write_a_book_with_flows.main:plot"

[build-system] requires = [ "hatchling", ] build-backend = "hatchling.build"

now "crewai install" is possible, though not sure what the asyncio means, accoridng to chatgpt i can remove the .

crewai run Running the Crew error: Failed to spawn: run_crew Caused by: program not found An error occurred while running the crew: Command '['uv', 'run', 'run_crew']' returned non-zero exit status 2.

Whats the correct call to execute a flew?

CStrue commented 1 week ago

Ah seems i have to run the flow with:

crewai flow kickoff