AI agents team, research report

This commit is contained in:
ajaysi
2024-05-08 10:06:08 +05:30
parent 6f88f9ba34
commit f9b9204349
4 changed files with 17 additions and 25 deletions

View File

@@ -167,9 +167,9 @@ def write_blog():
if blog_type: if blog_type:
if blog_type == 'Keywords': if blog_type == 'Keywords':
blog_from_keyword() blog_from_keyword()
elif mode == 'AI Story Writer': elif blog_type == 'AI Story Writer':
write_story() write_story()
elif mode == 'AI Essay Writer': elif blog_type == 'AI Essay Writer':
essay_writer() essay_writer()
elif blog_type == 'Audio To Blog': elif blog_type == 'Audio To Blog':
blog_from_audio() blog_from_audio()
@@ -179,7 +179,7 @@ def write_blog():
github = prompt("Enter GitHub URL, CSV file, or topic:") github = prompt("Enter GitHub URL, CSV file, or topic:")
print(f"Write blog based on GitHub: {github}") print(f"Write blog based on GitHub: {github}")
elif blog_type == 'Scholar': elif blog_type == 'Scholar':
scholar = prompt("Enter research papers keywords:") scholar = prompt("Enter research papers keywords Or URL:")
print(f"Write blog based on scholar: {scholar}") print(f"Write blog based on scholar: {scholar}")
elif blog_type == 'Quit': elif blog_type == 'Quit':
typer.echo("Exiting, Getting Lost..") typer.echo("Exiting, Getting Lost..")

View File

@@ -76,21 +76,12 @@ def long_form_generator(content_keywords):
7). Use simple {content_language} words, to appeal to all readers. 7). Use simple {content_language} words, to appeal to all readers.
7). Your content must be well formatted using {output_format} language. 7). Your content must be well formatted using {output_format} language.
8). Do not use words like: Unleash, ultimate, Uncover, Discover, Elevate, Revolutionizing, Unveiling, Harnessing, Dive, Delve into, Embrace. 8). Do not use words like: Unleash, ultimate, Uncover, Discover, Elevate, Revolutionizing, Unveiling, Harnessing, Dive, Delve into, Embrace.
9). Important: Ensure that content is not repeated, each section is unique and distinct.
Remember, your main goal is to write as much as you can. If you get through the content too fast, that is bad. Remember, your main goal is to write as much as you can. If you get through the content too fast, that is bad.
Expand, never summarize. Expand, never summarize.
''' '''
remove_ai_words = f'''\
As an expert content writer and editor, I will provide you with my 'blog content' and 'Exception-list'.
Your task is to replace all occurances of words from 'Exception-list' from given 'blog content'.
Before generating any text, examine the Exception-list and avoid all cases of these words and phrases.
These instructions are critical and require absolute adherence!
\n\nException-list: ["realm", "navigating", "beacon", "bustling", "treasure trove", "landscape", "tailored", "tailor", “roadmap” , "tailoring", "delving", “streamlining” "dynamic", "robust", "stay tuned", "in conclusion", "seamless", "bustling", “not just a”, “cornerstone”, “paramount” ,“diving into”, “delve into”, “pivotal”, “navigating”,“dive deep”, journey”, “maze”, “puzzle”, “overwhelmed” 'Tapestry', 'Bustling', 'In summary', 'In conclusion', 'Unleash', 'Unveiling', 'ever-evolving', 'Remember that', 'Take a dive into', 'Navigating', 'Navigating the landscape', 'Navigating the complexities of', 'Landscape', 'The landscape of', 'Testament', 'a testament to', 'In the world of', 'Realm', 'Embark', 'virtuoso', 'Let's explore', 'symphony', 'game changing', 'ever-changing', 'Embrace', 'Embracing', 'game-changing', 'ever-evolving']
\n\nBlog Content: '{{blog_content}}'
'''
# Generate prompts # Generate prompts
content_title = f'''\ content_title = f'''\
@@ -121,7 +112,7 @@ def long_form_generator(content_keywords):
{{web_research_result}} {{web_research_result}}
Write an outline for the content title using web research results. Write an outline of a content using above web research results.
''' '''
@@ -140,7 +131,6 @@ def long_form_generator(content_keywords):
Start to write the very beginning of the content. You are not expected to finish the whole content now. Start to write the very beginning of the content. You are not expected to finish the whole content now.
Your writing should be detailed enough that you are only scratching the surface of the first bullet of your outline. Your writing should be detailed enough that you are only scratching the surface of the first bullet of your outline.
Try to write AT MINIMUM 600 WORDS. Try to write AT MINIMUM 600 WORDS.
Pay special attention to orignality, formatting and readibility of your content.
{writing_guidelines} {writing_guidelines}
''' '''
@@ -162,20 +152,20 @@ def long_form_generator(content_keywords):
============\n ============\n
You've begun to write the essay and continue to do so. You've begun to write the content and continue to do so.
Here's what you've written so far: Here's what you've written so far:
{{content_text}} {{content_text}}
===== =====
First, silently review the outline and essay so far. First, silently review the outline and content written so far.
Identify what the single next part of your outline you should write. Identify what the single next part of your outline you should write.
Your task is to continue where you left off and write the next part of the Essay. Your task is to continue where you left off and write only the next parts of given outline.
You are not expected to finish the whole essay now. Your writing should be You are not expected to finish the whole content now. Your writing should be
detailed enough that you are only scratching the surface of the next part of detailed enough that you are only scratching the surface of the next part of
your outline. Try to write AT MINIMUM 600 WORDS. However, only once the essay your outline. Try to write AT MINIMUM 600 WORDS. However, only once the content
is COMPLETELY finished, write IAMDONE. Remember, do NOT write a whole chapter is COMPLETELY finished, write IAMDONE. Remember, do NOT write a whole chapter
right now. right now.
@@ -213,6 +203,8 @@ def long_form_generator(content_keywords):
logger.error(f"Failed to Generate Starting draft: {err}") logger.error(f"Failed to Generate Starting draft: {err}")
return return
print(starting_draft)
try: try:
draft = starting_draft draft = starting_draft
continuation = generate_with_retry(model, continuation = generate_with_retry(model,
@@ -221,12 +213,15 @@ def long_form_generator(content_keywords):
except Exception as err: except Exception as err:
logger.error(f"Failed to write the initial draft: {err}") logger.error(f"Failed to write the initial draft: {err}")
print(continuation)
# Add the continuation to the initial draft, keep building the story until we see 'IAMDONE' # Add the continuation to the initial draft, keep building the story until we see 'IAMDONE'
try: try:
draft += '\n\n' + continuation draft += '\n\n' + continuation
except Exception as err: except Exception as err:
logger.error(f"Failed as: {err} and {continuation}") logger.error(f"Failed as: {err} and {continuation}")
print(draft)
try: try:
# Do Metaphor/Exa AI search. # Do Metaphor/Exa AI search.
web_research_result, m_titles = do_metaphor_ai_research(content_keywords) web_research_result, m_titles = do_metaphor_ai_research(content_keywords)

View File

@@ -52,7 +52,6 @@ def ai_essay_generator(essay_title, selected_essay_type, selected_education_leve
1). You specialize in {selected_essay_type} essay writing. 1). You specialize in {selected_essay_type} essay writing.
2). Your target audiences include readers from {selected_education_level} level. 2). Your target audiences include readers from {selected_education_level} level.
3). The title of the essay is {essay_title}. 3). The title of the essay is {essay_title}.
4). I will provide you with web research for essay title.
5). The final essay should of {selected_num_pages} words/pages. 5). The final essay should of {selected_num_pages} words/pages.
3). Plant the seeds of subplots or potential character arc shifts that can be expanded later. 3). Plant the seeds of subplots or potential character arc shifts that can be expanded later.

View File

@@ -155,7 +155,6 @@ def ai_story_generator(persona, story_genre, characters):
try: try:
starting_draft = generate_with_retry(model, starting_draft = generate_with_retry(model,
starting_prompt.format(premise=premise, outline=outline)).text starting_prompt.format(premise=premise, outline=outline)).text
pprint(starting_draft)
except Exception as err: except Exception as err:
print(f"Failed to Generate Story draft: {err}") print(f"Failed to Generate Story draft: {err}")
return return
@@ -164,7 +163,6 @@ def ai_story_generator(persona, story_genre, characters):
draft = starting_draft draft = starting_draft
continuation = generate_with_retry(model, continuation = generate_with_retry(model,
continuation_prompt.format(premise=premise, outline=outline, story_text=draft)).text continuation_prompt.format(premise=premise, outline=outline, story_text=draft)).text
pprint(continuation)
except Exception as err: except Exception as err:
print(f"Failed to write the initial draft: {err}") print(f"Failed to write the initial draft: {err}")
@@ -184,7 +182,7 @@ def ai_story_generator(persona, story_genre, characters):
# Remove 'IAMDONE' and print the final story # Remove 'IAMDONE' and print the final story
final = draft.replace('IAMDONE', '').strip() final = draft.replace('IAMDONE', '').strip()
pprint(final) print(final)
except Exception as e: except Exception as e:
print(f"Main Story writing: An error occurred: {e}") print(f"Main Story writing: An error occurred: {e}")