From ebed11e5ce8e56f483ec0f9d24e46486e440eb4d Mon Sep 17 00:00:00 2001 From: ajaysi Date: Thu, 2 May 2024 21:55:46 +0530 Subject: [PATCH] ai news writer, web apps, prompts --- README.md | 15 +++++++---- lib/ai_writers/blog_from_google_serp.py | 3 ++- lib/ai_writers/combine_research_and_blog.py | 17 +++--------- lib/ai_writers/keywords_to_blog.py | 30 ++++++++++----------- 4 files changed, 31 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index e7f7dd0c..3ecd28bd 100644 --- a/README.md +++ b/README.md @@ -10,19 +10,24 @@ If you have 💻 Laptop + 🛜 Internet + 20 minutes, you will be generating blo ### [Step-By-Step: Getting Started for Absolute Begginers](https://www.alwrity.com/post/getting-started-with-alwrity-ai-writer) -### [Getting started for pretentious Developers](https://github.com/AJaySi/AI-Writer/wiki/Alwrity--%E2%80%90-Get-started) +### [Getting started for Developers](https://github.com/AJaySi/AI-Writer/wiki/Alwrity--%E2%80%90-Get-started) **If you still Get stuck, Open a issue here & say pretty please** :: https://github.com/AJaySi/AI-Writer/issues --- +# AI Content Generation Toolkit - Alwrity +![](https://github.com/AJaySi/AI-Writer/blob/main/lib/workspace/keyword_blog.gif) ## Introduction -Alwrity automates and enhances the process of blog creation, optimization, and management. -Leveraging AI technologies, it assists content creators and digital marketers in generating, formatting, and uploading blog content efficiently. The toolkit integrates advanced AI models for text generation, image creation, and data analysis, streamlining the content creation pipeline. +Alwrity automates and enhances the process of blog creation, optimization, and management(Really ?). +Leveraging AI technologies, it assists content creators and digital marketers in generating, formatting, +and uploading blog content efficiently(Hmmmm, OK...). +The toolkit integrates advanced AI models for text generation, image creation, +and data analysis, streamlining the content creation pipeline(Who reads introductions, right!). -# AI Content Generation Toolkit - Alwrity -![](https://github.com/AJaySi/AI-Writer/blob/main/lib/workspace/keyword_blog.gif) +## [Read Alwrity Configuration Options](https://www.alwrity.com/post/know-powerful-alwrity-ai-writer-configuration): +Use the [main_config](https://github.com/AJaySi/AI-Writer/blob/main/main_config) file to modify Alwrity behavior for your content needs. --- diff --git a/lib/ai_writers/blog_from_google_serp.py b/lib/ai_writers/blog_from_google_serp.py index 7785a101..5caba83e 100644 --- a/lib/ai_writers/blog_from_google_serp.py +++ b/lib/ai_writers/blog_from_google_serp.py @@ -30,7 +30,8 @@ def write_blog_google_serp(search_keyword, search_results): Always include answers for each FAQ, use your knowledge and confirm with snippets given in search result. 3). Act as subject matter expert for given research keywords: {search_keyword}. 4). Your blog should be highly formatted in markdown style and highly readable. - 5). Always write in the first person. + 5). Always write in the first person. + 6). Inject Your Unique Voice and Style: Add personal insights, anecdotes, or experiences to infuse authenticity and humanize the content, making it engaging and authentic. \n\nWeb Research Keyword: "{search_keyword}" Google search Result: "{search_results}" diff --git a/lib/ai_writers/combine_research_and_blog.py b/lib/ai_writers/combine_research_and_blog.py index cf84089d..b85d350f 100644 --- a/lib/ai_writers/combine_research_and_blog.py +++ b/lib/ai_writers/combine_research_and_blog.py @@ -18,20 +18,11 @@ def blog_with_research(report, blog): She makes complex topics simple to understand and writes in a friendly, conversational tone that connects with everyone. She excels at simplifying complex topics and writes in the first person, for her audience. - I will provide you with a 'research report' and a 'blog content' on the same topic. - Your task is to follow below given guidelines to write a detailed blog article, - that will rank well in search engine results and engage readers effectively. + I will provide you with a latest 'research report' and a outdated 'blog content' on the same topic. + Your task is to update the given blog content, using the new research report, as context. - Follow below given guidelines: - 1. Master the report and blog content: Understand main ideas, key points, and the core message. - 2. Sentence Structure: Rephrase while preserving logical flow and conversational tone. - 3. Identify Main Keywords: Determine the primary topic and combine the articles on that main topic. - 5. Blog Structuring: Include an Introduction, subtopics and use bullet points or - numbered lists if appropriate. Important to include FAQs, Conclusion and Referances. - 7. .\n\n - - Research report: '{report}' - Blog content: '{blog}' + \n\nResearch report: '{report}' + \n\nBlog content: '{blog}' """ try: diff --git a/lib/ai_writers/keywords_to_blog.py b/lib/ai_writers/keywords_to_blog.py index 57376abf..6b509c4b 100644 --- a/lib/ai_writers/keywords_to_blog.py +++ b/lib/ai_writers/keywords_to_blog.py @@ -48,23 +48,23 @@ def write_blog_from_keywords(search_keywords, url=None): # TBD: The 3 drafts are very similar, the intention was to fact check the AI content multiple times. # Commenting it out for blog writing, using Tavily for other forms of writing. # Do Tavily AI research to augument the above blog. - #try: - # tavily_search_result, t_titles = do_tavily_ai_search(search_keywords) - # example_blog_titles.append(t_titles) - # blog_markdown_str = blog_with_research(blog_markdown_str, tavily_search_result) - # logger.info(f"######### Blog content after Tavily AI research: ######### \n\n{blog_markdown_str}\n\n") - #except Exception as err: - # logger.error(f"Failed to do Tavily AI research: {err}") - #logger.info("######### Draft2: Blog content after Tavily AI research: #########\n\n") - try: - # Do Metaphor/Exa AI search. - metaphor_search_result, m_titles = do_metaphor_ai_research(search_keywords) - example_blog_titles.append(m_titles) - blog_markdown_str = blog_with_research(blog_markdown_str, metaphor_search_result) + tavily_search_result, t_titles = do_tavily_ai_search(search_keywords) + example_blog_titles.append(t_titles) + blog_markdown_str = blog_with_research(blog_markdown_str, tavily_search_result) + logger.info(f"######### Blog content after Tavily AI research: ######### \n\n{blog_markdown_str}\n\n") except Exception as err: - logger.error(f"Failed to do Metaphor AI search: {err}") - logger.info("######### Draft3: Blog content after Tavily AI research: ######### \n\n") + logger.error(f"Failed to do Tavily AI research: {err}") + logger.info("######### Draft2: Blog content after Tavily AI research: #########\n\n") + +# try: +# # Do Metaphor/Exa AI search. +# metaphor_search_result, m_titles = do_metaphor_ai_research(search_keywords) +# example_blog_titles.append(m_titles) +# blog_markdown_str = blog_with_research(blog_markdown_str, metaphor_search_result) +# except Exception as err: +# logger.error(f"Failed to do Metaphor AI search: {err}") +# logger.info("######### Draft3: Blog content after Tavily AI research: ######### \n\n") # Do Google trends analysis and combine with latest blog. try: