Merge pull request #76 from GoldenWind8/master

pull/77/head
Eternal Reclaimer 1 year ago committed by GitHub
commit 7986c09119
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,11 +0,0 @@
from swarms.models.openai_models import OpenAIChat
import PosMedPrompts
openai = OpenAIChat(openai_api_key="sk-S4xHnFJu7juD33jxjJZfZU1cZYi")
draft = openai(PosMedPrompts.getDraftPrompt("AI in healthcare", "Pyschology"))
review = openai(PosMedPrompts.getReviewPrompt(draft))
print(review)

@ -1,64 +1,74 @@
draftPrompt = """# MISSION from swarms import OpenAIChat
Write a 100% unique, creative and in human-like style article of a minimum of 2000 words using headings and sub-headings.
Ensure your tone is Professional and casual while focusing on presenting information and analysis without excessive embellishment. DRAFT_PROMPT = """# MISSION
Write a 100% unique, creative and in human-like style article of a minimum of 2000 words using headings and sub-headings.
The topic is: {{TOPIC}} Ensure your tone is Professional and casual while focusing on presenting information and analysis without excessive embellishment.
# GENERAL GUIDELINE The topic is: {{TOPIC}}
There should be minimum 15 headings and 10 sub-headings in the content.
Try to write at least 300-400 words of content for each heading or sub-heading. bold all the headings and sub-headings using Markdown formatting. # GENERAL GUIDELINE
Try to use contractions, idioms, transitional phrases, interjections, dangling modifiers, and colloquialisms, and avoid repetitive phrases and unnatural sentence structures. There should be minimum 15 headings and 10 sub-headings in the content.
When you write, you will correctly format the blog post according to proper SEO standards, with as much rich and detailed HTML as possible, for example, lists, bold, italics, quotes from the internet, tables, and external links to high-quality websites such as Wikipedia. Try to write at least 300-400 words of content for each heading or sub-heading. bold all the headings and sub-headings using Markdown formatting.
Try to ask questions and then immediately give a good and concise answer, to try to achieve the featured snippet on Google. Try to use contractions, idioms, transitional phrases, interjections, dangling modifiers, and colloquialisms, and avoid repetitive phrases and unnatural sentence structures.
The article should include SEO meta-description (must include the [PROMPT] in the description), an Introduction, and a click-worthy short title. Also, Use the seed keyword as the first H2. When you write, you will correctly format the blog post according to proper SEO standards, with as much rich and detailed HTML as possible, for example, lists, bold, italics, quotes from the internet, tables, and external links to high-quality websites such as Wikipedia.
Always use a combination of paragraphs, lists, and tables for a better reader experience. Try to ask questions and then immediately give a good and concise answer, to try to achieve the featured snippet on Google.
Write at least one paragraph with the heading {{TOPIC}}. The article should include SEO meta-description (must include the [PROMPT] in the description), an Introduction, and a click-worthy short title. Also, Use the seed keyword as the first H2.
Try not to change the original {{TOPIC}} while writing the Title. Always use a combination of paragraphs, lists, and tables for a better reader experience.
Try to mention "{{TOPIC}}" 2-3 times in the article. Write at least one paragraph with the heading {{TOPIC}}.
Write content that can easily pass the AI detection tools test. Try not to change the original {{TOPIC}} while writing the Title.
You should write a conclusion end with either a call to action or a clear and concise point. What is the key takeaway?""" Try to mention "{{TOPIC}}" 2-3 times in the article.
Write content that can easily pass the AI detection tools test.
You should write a conclusion end with either a call to action or a clear and concise point. What is the key takeaway?"""
reviewPrompt = """# MISSION
You are responsible for refining an article to meet PositiveMeds stringent publication standards.
Your role involves content analysis, editorial precision, expert validation, legal verification, and overall quality assurance. REVIEW_PROMPT = """# MISSION
You are responsible for refining an article to meet PositiveMeds stringent publication standards.
# ContentReview: Your role involves content analysis, editorial precision, expert validation, legal verification, and overall quality assurance.
- Provide constructive feedback on outline and drafts content
- Collect input on strengths to leverage and areas needing improvement. # ContentReview:
- Provide constructive feedback on outline and drafts content
# Editor Review: - Collect input on strengths to leverage and areas needing improvement.
- Evaluate initial drafts for errors, gaps that require additional research.
- Provide guidance on better organizing structure and flow. # Editor Review:
- Assess tone, voice and brand alignment. - Evaluate initial drafts for errors, gaps that require additional research.
- Provide guidance on better organizing structure and flow.
# Expert Review: - Assess tone, voice and brand alignment.
- Ask medical experts related to article topic to validate accuracy of information.
- Verify advice follows ethical guidelines accepted by the medical community. # Expert Review:
- Request quotes that lend credibility and reinforce key points. - Ask medical experts related to article topic to validate accuracy of information.
- Verify advice follows ethical guidelines accepted by the medical community.
# Legal Review: - Request quotes that lend credibility and reinforce key points.
- Confirm content meets regulatory standards for health claims and liability risks.
- Address any recommended edits to mitigate brand reputation risk. # Legal Review:
- Confirm content meets regulatory standards for health claims and liability risks.
# Quality Checklist: Scrutinize final draft against PositiveMed's standards: - Address any recommended edits to mitigate brand reputation risk.
- Medical accuracy - error-free facts/statistics, supported claims
- Logical flow - smooth transitions, complementary sections # Quality Checklist: Scrutinize final draft against PositiveMed's standards:
- Reader value - insightful analysis beyond fluffy content - Medical accuracy - error-free facts/statistics, supported claims
- Brand alignment - uplifting tone, inclusive messaging - Logical flow - smooth transitions, complementary sections
- Strong conclusion - memorable takeaways, relevant next steps/resources for readers - Reader value - insightful analysis beyond fluffy content
- Brand alignment - uplifting tone, inclusive messaging
# ARTICLE TO REVIEW: - Strong conclusion - memorable takeaways, relevant next steps/resources for readers
{{ARTICLE}}
# ARTICLE TO REVIEW:
# OUTPUT: {{ARTICLE}}
Re-Write the article, taking into account all review instructions and standards
""" # OUTPUT:
Re-Write the article, taking into account all review instructions and standards
def getDraftPrompt(topic, theme): """
prompt = draftPrompt.replace("{{TOPIC}}", topic).replace("{{THEME}}", theme)
return prompt def get_draft_prompt(topic, theme):
prompt = DRAFT_PROMPT.replace("{{TOPIC}}", topic).replace("{{THEME}}", theme)
def getReviewPrompt(article): return prompt
prompt = reviewPrompt.replace("{{ARTICLE}}", article)
return prompt def get_review_prompt(article):
prompt = REVIEW_PROMPT.replace("{{ARTICLE}}", article)
return prompt
openai = OpenAIChat(openai_api_key="sk-S4xHnFJu7juD33jxjJZfZU1cZYi")
draft = openai(get_draft_prompt("AI in healthcare", "Pyschology"))
review = openai(get_review_prompt(draft))
print(review)
Loading…
Cancel
Save