Activity
Mon
Wed
Fri
Sun
Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
What is this?
Less
More

Memberships

AI Developer Accelerator

Public โ€ข 3.8k โ€ข Free

1 contribution to AI Developer Accelerator
What is this doing?
Hey guys, can someone tell me what is going on in these lines of code? "book_outline": [ chapter_outline.model_dump_json() for chapter_outline in self.state.book_outline ] Here is the original section from the BookFlow (crewai crash course) async def write_chapters(self): print("Writing Book Chapters") tasks = [] async def write_single_chapter(chapter_outline): output = ( WriteBookChapterCrew() .crew() .kickoff( inputs={ "goal": self.state.goal, "topic": self.state.topic, "chapter_title": chapter_outline.title, "chapter_description": chapter_outline.description, "book_outline": [ chapter_outline.model_dump_json() for chapter_outline in self.state.book_outline ], } ) ) title = output["title"] content = output["content"] chapter = Chapter(title=title, content=content) return chapter for chapter_outline in self.state.book_outline: print(f"Writing Chapter: {chapter_outline.title}") print(f"Description: {chapter_outline.description}") # Schedule each chapter writing task task = asyncio.create_task(write_single_chapter(chapter_outline)) tasks.append(task)
0
1
New comment 1d ago
0 likes โ€ข 1d
[attachment]
1-1 of 1
Ax Va
1
5points to level up
@ax-va-5505
................................. ............................................ ................................. ...................... ............

Active 5h ago
Joined Nov 24, 2024
powered by