-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Content Creator Agent Workflow #1614
base: main
Are you sure you want to change the base?
Content Creator Agent Workflow #1614
Conversation
cookbook/examples/workflows/social_media_content_planner/readme.md
Outdated
Show resolved
Hide resolved
cookbook/examples/workflows/social_media_content_planner/readme.md
Outdated
Show resolved
Hide resolved
cookbook/examples/workflows/social_media_content_planner/readme.md
Outdated
Show resolved
Hide resolved
cookbook/examples/workflows/social_media_content_planner/readme.md
Outdated
Show resolved
Hide resolved
cookbook/examples/workflows/social_media_content_planner/social_media_content_planner.py
Outdated
Show resolved
Hide resolved
cookbook/examples/workflows/social_media_content_planner/social_media_content_planner.py
Outdated
Show resolved
Hide resolved
cookbook/examples/workflows/social_media_content_planner/social_media_content_planner.py
Outdated
Show resolved
Hide resolved
cookbook/examples/workflows/social_media_content_planner/social_media_content_planner.py
Outdated
Show resolved
Hide resolved
Represents a LinkedIn post. | ||
""" | ||
content: str | ||
media_url: Optional[str] = None # Optional media attachment URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't attach multiple media to LinkedIn post?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't test it for multiple media
cookbook/examples/workflows/social_media_content_planner/scheduler.py
Outdated
Show resolved
Hide resolved
cookbook/examples/workflows/social_media_content_planner/social_media_content_planner.py
Outdated
Show resolved
Hide resolved
def generate_plan(self, blog_content: str, post_type: PostType) -> dict: | ||
plan_response: RunResponse = RunResponse(content=None) | ||
if post_type == PostType.TWITTER: | ||
logger.info(f"Generating post plan for {post_type}") | ||
plan_response = self.twitter_thread_planner.run(blog_content) | ||
elif post_type == PostType.LINKEDIN: | ||
logger.info(f"Generating post plan for {post_type}") | ||
plan_response = self.linkedin_post_planner.run(blog_content) | ||
else: | ||
raise ValueError(f"Unsupported post type: {post_type}") | ||
|
||
if plan_response.content_type == "Thread" or plan_response.content_type == LinkedInPost: | ||
return plan_response.content | ||
elif plan_response.content_type == "application/json": | ||
data = json.loads(plan_response.content) | ||
if post_type == PostType.TWITTER: | ||
return Thread(**data) | ||
else: | ||
return LinkedInPost(**data) | ||
else: | ||
raise ValueError("Unexpected content type received from planner.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic will need a revisit as it's not clean. Look at line 131.
Also the return type is dict but you are returning 3 completely different types at line 132, 136, and 138
Description
This PR introduces the ContentPlanningWorkflow, which automates the creation, planning, and scheduling of social media content based on blog posts. This is an example use-case of workflow agents.
Type of change
Please check the options that are relevant:
Checklist