Skip to content

Commit

Permalink
Alwrity AI story writer
Browse files Browse the repository at this point in the history
  • Loading branch information
AJaySi committed Apr 14, 2024
1 parent c17dd2b commit 31995df
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 27 deletions.
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Coming Soon....
- **Analyzing and Extracting Image Details**: Uses OpenAI's Vision API, Google Gemini vision to analyze images and extract details such as alt text, descriptions, titles, and captions, enhancing the SEO of image content.

---
**Note**: This toolkit is designed for automated blog management and requires appropriate API keys and access credentials for full functionality.
### **Note**: This toolkit is designed for automated blog management and requires appropriate API keys and access credentials for full functionality.
---

### Web Research
Expand Down Expand Up @@ -131,13 +131,7 @@ Coming Soon....

## Packages, Tools, and APIs Used

- **Libraries**:
- PyInquirer: For creating interactive command-line interfaces.
- Typer: For building CLI applications with ease.
- Tabulate: For formatting data in tabular form.
- Requests: For making HTTP requests to web APIs.
- python-dotenv: For loading environment variables from a .env file.

### Standing on the shoulders of Giants:
- **APIs**:
- Metaphor API: Provides semantic search capabilities for finding similar topics and technologies.
- Tavily API: Offers AI-powered web search functionality for conducting in-depth keyword research.
Expand Down
67 changes: 49 additions & 18 deletions alwrity.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def write_story():
if os.getenv('GEMINI_API_KEY'):
ai_story_generator(selected_persona_name, selected_persona_name, character_input)
else:
print(f"Provide Google Gemini API keys. Openai, mistral, ollama coming up.")
print(f"ERROR: Provide Google Gemini API keys. Openai, mistral, ollama coming up.")
exit(1)


Expand All @@ -212,28 +212,59 @@ def blog_tools():
text += "_______________________________________________________________________\n"
print(text)

choices = [
personas = [
("Write Blog Title", "Write Blog Title"),
("Write Blog Meta Description", "Write Blog Meta Description"),
("Write Blog Introduction", "Write Blog Introduction"),
("Write Blog conclusion", "Write Blog conclusion"),
("Write Blog Outline", "Write Blog Outline"),
# ("Write Blog Introduction", "Write Blog Introduction"),
# ("Write Blog conclusion", "Write Blog conclusion"),
# ("Write Blog Outline", "Write Blog Outline"),
("Generate Blog FAQs", "Generate Blog FAQs"),
("Research blog references", "Research blog references"),
("Convert Blog To HTML", "Convert Blog To HTML"),
("Convert Blog To Markdown", "Convert Blog To Markdown"),
("Blog Proof Reader", "Blog Proof Reader"),
("Get Blog Tags", "Get Blog Tags"),
("Get blog categories", "Get blog categories"),
("Get Blog Code Examples", "Get Blog Code Examples"),
("Check WebPage Performance", "Check WebPage Performance"),
("AI Linkedin Post", "AI Linkedin Post"),
# ("Research blog references", "Research blog references"),
# ("Convert Blog To HTML", "Convert Blog To HTML"),
# ("Convert Blog To Markdown", "Convert Blog To Markdown"),
# ("Blog Proof Reader", "Blog Proof Reader"),
# ("Get Blog Tags", "Get Blog Tags"),
# ("Get blog categories", "Get blog categories"),
# ("Get Blog Code Examples", "Get Blog Code Examples"),
# ("Check WebPage Performance", "Check WebPage Performance"),
("Quit/Exit", "Quit/Exit")
]
selected_tool = radiolist_dialog(title="Choose a Blogging Tool:", values=choices).run()
if selected_tool:
tool = selected_tool[0]
if tool == 'Write Blog Title':
return
dialog = radiolist_dialog(
title = "Select Your AI content tool.",
text = "Choose a tool to use and visit provided online link to try them out.",
values = personas
)

selected_persona_name = dialog.run()

persona_descriptions = {
"Write Blog Title": "Write Blog Title - VISIT: https://alwrity-title.streamlit.app/",
"Write Blog Meta Description": "Write Blog Meta Description - VISIT: https://alwrity-metadesc.streamlit.app/",
# "Write Blog Introduction": "Write Blog Introduction - To Be Done (TBD)",
# "Write Blog conclusion": "Write Blog conclusion - ",
# "Write Blog Outline": "Write Blog Outline - ",
"Generate Blog FAQs": "Generate Blog FAQs - VISIT: https://alwrity-faq.streamlit.app/",
"AI Linkedin Post": "AI Linkedin Post writer - VISIT: https://alwrity-linkedin.streamlit.app/",
# "Research blog references": "Research blog references - Example: https://example.com/research-blog-references",
# "Convert Blog To HTML": "Convert Blog To HTML - Example: https://example.com/convert-blog-to-html",
# "Convert Blog To Markdown": "Convert Blog To Markdown - Example: https://example.com/convert-blog-to-markdown",
# "Blog Proof Reader": "Blog Proof Reader - Example: https://example.com/blog-proof-reader",
# "Get Blog Tags": "Get Blog Tags - Example: https://example.com/get-blog-tags",
# "Get blog categories": "Get blog categories - Example: https://example.com/get-blog-categories",
# "Get Blog Code Examples": "Get Blog Code Examples - Example: https://example.com/get-blog-code-examples",
# "SEO Checks": "SEO checks - TBD",
"Quit/Exit": "Quit/Exit - Example: Quit/Exit"
}

if selected_persona_name:
selected_persona = next((persona for persona in personas if persona[0] == selected_persona_name), None)
if selected_persona:
character_input = message_dialog(
title=f"To Try {selected_persona_name}, Visit below URL:",
text=persona_descriptions[selected_persona_name]
).run()



def competitor_analysis():
Expand Down
2 changes: 1 addition & 1 deletion main_config
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ num_results = 10
time_range = anytime

# include_domains (Give Full URLs, separate by comma): A list of domains to specifically include in the search results.
# Default is None, which includes all domains. Example: Wikipedia.com, stackoverflow.com, google schalor, reddit etc
# Default is None, which includes all domains. Example: https://wikipedia.com,https://stackoverflow.com,google schalor,reddit etc
include_domains =

# similar_url : A single URL, this will instruct search engines to give results similar to the given URL.
Expand Down

0 comments on commit 31995df

Please sign in to comment.