Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Flow stopped at async tasks #1544

Open
csim-sg opened this issue Nov 1, 2024 · 0 comments
Open

[BUG] Flow stopped at async tasks #1544

csim-sg opened this issue Nov 1, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@csim-sg
Copy link

csim-sg commented Nov 1, 2024

Description

Flow stopped running when reach 2 consecutive async tasks in same crew

Steps to Reproduce

  1. Create a new flow
  2. Create consecutive 2 async tasks, ie 3rd and 4th or 4th and 5th, using the agent.yaml & tasks.yaml
  3. Kickoff the flow
  4. It will stop when reached the async task

Expected behavior

The flow run finish or error log in debug

Screenshots/Code snippets

agents.yaml
researcher:
role: >
Senior Paranormal Researcher
goal: >
Research Asia paranormal activities & stories
backstory: >
You work in a small self funded group for paranormal activities.
Your expertise lies in spotting paranormal activities in Asia
You have deep knowledge and love to research on different ghost being Asia religion
You always try not to write the same stories thats already recently writen in *****.la

juniorResearcher:
role: >
Junior Paranormal Researcher
goal: >
Help Senior Researcher expend his research with details
backstory: >
You report to the senior researcher in the company.
Your job is to assist senior researcher on his original research and search more details so writer and editor can use your work to finish their job.
You don't search for irrelevent term beyond what senior researcher provide.

writer:
role: >
SEO Trained Ghost Story Writer
goal: >
Crafting a very believable story based on the true facts.
backstory: >
You are a creative writer for a online blog.
Love to write non-frictional scary story.
Getting information from your co-worker, you will write believable scary story.
You work closely with Senior Paranormal Researcher, in getting more information in order to write your story.
With the information given by co-worker, you will research for possible SEO keyword and incorporate into a believable story.
In order for your story to be ranked well in Search Engine, you will add keywords, and follow google SEO guideline.

designer:
role: >
Paranormal Researcher Assistant
goal: >
Search images from the internet that fit the story
backstory: >
Your job is to search for images from the internet that fit the story & location.
When using the image, go to the website found and look for relevent image link.
Do not use any images that portray family photos, gatherings and couples.
Due to PDPA and GDPR, do not use any image that have front face view of anyone.
In order to not get sued, you make sure the images used are properly credited back to the main website.

stockImageDesigner:
role: >
Paranormal Researcher Video Assistant
goal: >
Search stock images & video that can be used
backstory: >
You are faceless video editor, your job is to read the timed caption & find the keyword
By using the keyword, you will search for most relevent stock video using the keyword.
For example, if the caption is 'The cheetah is the fastest land animal, capable of running at speeds up to 75 mph', the keywords should include 'cheetah running', 'fastest animal', and '75 mph'. Similarly, for 'The Great Wall of China is one of the most iconic landmarks in the world', the keywords should be 'Great Wall of China', 'iconic landmark', and 'China landmark'.

aiDesigner:
role: >
AI Art director
goal: >
Generate feature images for the story
backstory: >
As a AI Art director, your job will be to generate best relevent prompt for Dall-E,
The images must fit well to the story background, location, ghostly being.
You like realistic image generation with an eerie feeling

seoExpert:
role: >
Chief Editor
goal: >
Check the story writen to make sure it fit the requirement of the task
backstory: >
You are a Google SEO specialist & Chief Editor
Your job is to make sure the title and story from SEO Trained Ghost Story Writer not sound too much like AI generated, flow is correct and is in English or Chinese
The title should be eye-catching and SEO friendly
You also will insert those images from Paranormal Researcher Assistant between relevent paragraph so the story flow can be more engaging

tasks.yaml
ghostBeingResearch:
description: >
Search for a ghost or god topic based in south east asia + China + Taiwan + Japan + Korea.
This can be the religion or ghost or god event or places or some historical story.
Below are some example of the search term can be use but not limited to
- "Lunar 7th month sightings"
- "Taiwan's MaZu event"
- "Singapore old changi hospital"
- "Pontianak sighting in Malaysia Genting highland"
- "China & Thailand black magic"
- "聊斋故事"
- "Foretail story"
- Popular ghost location,
- Army ghost story
- Infamous ghost
- Ghost with long history and popular in the region
- MRT ghost sighting
- Type of ghosts
- Malay thursday night
- Indonesia Bohmo
- Thailand ghost story
- Buddist afterlife culture & story
- Taoist ghost culture & story
- Is today a religion occasion to any culture within the scope
Do not search
- Western culture
- Dracula
You can also just search for foretail story the listed countries
expected_output: >
Output either 1 topic or culture superstitious for other tasks to research on
Output the result in the following format
[Topic]
[Topic Name]
[/Topic Name]
[Topic related story summary]
[/Topic related story summary]
[/Topic]
agent: researcher

detailResearch:
description: >
From the information given, search for related stories.
Summarised the story and determine any punchy line to use.
Do not search for video or audio sites.
Only use English or Mandrain sites
Stories found must be related to the information. Do not research irrelevent topic
Only extract the story content and not other irrialevent content like header, side menu and footer
Ignore all and don't use information in https://****.la
expected_output: >
Find 3 similiar stories online and provide the following information.
Only provide English or Mandrain information.
## URL of the story ##

## Summarised information ##

## Punch line or keyword to use ##

## What's the writing style ##

agent: researcher
context:
- ghostBeingResearch

blogPlanning:
description: >
Based on the information, and subsitute it with ###Information### below
Draft the outline of the story based on ###Information###
Follow the writing style from detailResearch
Add in your thoughts for the story outline so it can be properly expended by the writer.

Add the profile of the main character so it can be more engaging, so the reader can have more connections with him/her
  - Don't have to sound too heroic, or anything like movies. 
  - Can be more average Joe or some one from the neighbourhood. 
  - Don't draft the story like old folkstale, avoid do you know kind of story
Consider below are some elements that can be included in the story draft but not limited
  - Draft the story based on someone experiences
  - Where it take place, and any backstory to that place, event or date
  - How the encounter happen, include scary scenes, fright or surprised elements
  - How the main character escape or how the ###Information### is being scare off. 
  - Having a twist of event in the story
  - Conclusion can be the ###Information### still around or no more.
Make sure the draft outline flow is correct and relevent.
The flow of the draft should not be jumper up. 
The flow of the draft should sound like someone sharing a story or experience they had.

expected_output: >
Draft the outline of the story for writer to expend on.
The draft needs to be relevent to the ###Information### given.
Add in each outline thoughts and explain how each outline should be connected
agent: writer
context:
- ghostBeingResearch
- detailResearch

blogWriting:
description: >
Based on the outline of the story and the descriptions from researcher.
Try to follow the draft thoughts if it make sense and relevent
Expend the draft outline to a scary and engaging story.
The tone of voice should be casual, story telling and slightly conversational.
Follow the writing style from detailResearch
The story can have some reference or facts from the descriptions.
The story should be continous scene, no unrelated scene should be in the story
Below are some DOs & Don'ts
DOs
- The story should be always based on either someone past experience, lore passed down from elderly, story of someone's friends or friend
- Any reference search should only be English or Maindrain.
- Add in some explaination on why the topic are scary or fit to the story
- Adding more decriptions to the main characters so it can have more connection with the readers.
- Please alter between short and long sentences.
- Use burstiness in the sentences.
- Combining both short and long sentences to create a more human like flow
- Use human writing like exclamation points and pause.
- The story should always be from a third or first person point of view.
- The intro can but not limited to either an interesting facts, quotation, or something to hook the reader.
- Each paragaph should be a continous from the previous paragraph or should be linked.
- Only use English or Maindrain in the story.
- Do not use any special char
- Do not deviate the story away from the main topic
Don'ts
- Do not make up place name, ghost name or culture.
- Avoid did you know.
- Avoid jargon or cliches.
Before giving output, proofread the story. Make sure no any unrelated section added into the story.
expected_output: >
Full scary ###Information### story of at least 5 paragraphs and within 2000 words
The title & story can only be in English or Mandrain.

Output the format using the following format
[Title]

[/Title]

[Story]

[/Story]

agent: writer
context:
- blogPlanning
- detailResearch

searchImages:
description: >
Given the story from blogWriting tasks
Do a google image search that may fit the theme & the ghostly being in the story
The image found should match the religion, ethncity and culture beliefs
Always find the exact link of the image to use, Scrape the website and extract the image URL.
expected_output: >
Output a few images with their original website and which paragraph that this image should be inserted.
Each of them in the following format
[image]
[image url][/image url]
[alt text][/alt text]
[source website url][/source website url]
[/image]
agent: designer
context:
- blogWriting

async_execution: true

generatingFeatureImage:
description: >
Given the story from blogWriting tasks, the background of the image should fit the story.
For more information how the ghost should look like, reference to the output from ghostlyResearch & detailResearch.
The image should highly matched the story & the topic being researched.
The image must should match the religion, ethncity, culture beliefs and country of origin.
The image should be realistic but not too scary.
Don't add word in the image
expected_output: >
Output the Image Link & Description
agent: aiDesigner
context:
- blogWriting
- detailResearch
- ghostBeingResearch

async_execution: true

seoTask:
description: >
With the given title and story,
Proofread the story and make sure the following
- The title should be related to the story.
- The story must be relevent to ghostlyResearch & detailResearch task.
- Make sure the title and the story are SEO friendly & eye catching & within 25 words
- Give a rating of 1 to 5 based on horror level, being 1 the not scary at all and 5 being horrific.
Below are dos and don'ts that need to follow strictly
Don'ts
- Dont rewrite of the story
- Dont inject featured images from generatingFeatureImage task into the story.
- Dont add the title into the story
Dos
- Minor adjustments to make the story more engaging.
- The story must only be in English or Mandrain.
- Rewrite any paragraph or sentence if its not in proper English or Mandrain, Make sure and Keep the same context and meaning.
- Inject images from searchImages task between relevent paragraph
- Injected images should have credits linking back to original website
- Make sure the story have at least 5 paragraph or within 2000 words.
- The story should be in third or first person view.
- Think of relevent tags & category based on the story
- At the end of the story, list down all the referencing site in bullet points.
expected_output: >
Remove title and featured images from the story
Full story with images injected should be in Markdown
Output must always fit into Article Pydantic Model that make sense.
Do not include title into content for Article Pydantic
Do not add extra value into the fields.
Do not cut short the story.
agent: seoExpert
context:
- ghostBeingResearch
- detailResearch
- blogWriting
- searchImages
- generatingFeatureImage

Operating System

macOS Sonoma

Python Version

3.12

crewAI Version

0.70.1

crewAI Tools Version

0.12.1

Virtual Environment

Poetry

Evidence

None as no error log

Possible Solution

None

Additional context

Once removed async tasks, the flow will run properly

@csim-sg csim-sg added the bug Something isn't working label Nov 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant