Skip to content

Commit

Permalink
Create blog_gen_example.py
Browse files Browse the repository at this point in the history
  • Loading branch information
elder-plinius authored Nov 19, 2023
1 parent c852752 commit 7554fbd
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions blog_gen_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
from swarms.swarms.blog_gen import BlogGen


def main():
api_key = os.getenv("OPENAI_API_KEY")
if not api_key:
raise ValueError("OPENAI_API_KEY environment variable not set.")

blog_topic = input("Enter the topic for the blog generation: ")

blog_generator = BlogGen(api_key, blog_topic)
blog_generator.TOPIC_SELECTION_SYSTEM_PROMPT = (
blog_generator.TOPIC_SELECTION_SYSTEM_PROMPT.replace(
"{{BLOG_TOPIC}}", blog_topic
)
)

blog_generator.run_workflow()


if __name__ == "__main__":
main()

0 comments on commit 7554fbd

Please sign in to comment.