Performance optimizations, Improved SEO tools & error handling
This commit is contained in:
@@ -23,15 +23,6 @@ import PyPDF2
|
||||
import tiktoken
|
||||
import openai
|
||||
from lib.gpt_providers.text_to_image_generation.main_generate_image_from_prompt import generate_image
|
||||
from lib.ai_seo_tools.seo_structured_data import ai_structured_data
|
||||
from lib.ai_seo_tools.content_title_generator import ai_title_generator
|
||||
from lib.ai_seo_tools.meta_desc_generator import metadesc_generator_main
|
||||
from lib.ai_seo_tools.image_alt_text_generator import alt_text_gen
|
||||
from lib.ai_seo_tools.opengraph_generator import og_tag_generator
|
||||
from lib.ai_seo_tools.optimize_images_for_upload import main_img_optimizer
|
||||
from lib.ai_seo_tools.google_pagespeed_insights import google_pagespeed_insights
|
||||
from lib.ai_seo_tools.on_page_seo_analyzer import analyze_onpage_seo
|
||||
from lib.ai_seo_tools.weburl_seo_checker import url_seo_checker
|
||||
from lib.utils.voice_processing import record_voice
|
||||
from lib.content_planning_calender.content_planning_agents_alwrity_crew import ai_agents_content_planner
|
||||
from ..gpt_providers.text_generation.main_text_generation import llm_text_gen
|
||||
@@ -87,44 +78,6 @@ def process_input(input_text, uploaded_file):
|
||||
return None
|
||||
|
||||
|
||||
def ai_seo_tools():
|
||||
""" Collection SEO tools for content creators. """
|
||||
options = [
|
||||
"Generate Structured Data - Rich Snippet",
|
||||
"Generate SEO optimized Blog Titles",
|
||||
"Generate Meta Description for SEO",
|
||||
"Generate Image Alt Text",
|
||||
"Generate OpenGraph Tags",
|
||||
"Optimize/Resize Image",
|
||||
"Run Google PageSpeed Insights",
|
||||
"Analyze On Page SEO",
|
||||
"URL SEO Checker"
|
||||
]
|
||||
|
||||
# Using st.radio instead of st.selectbox
|
||||
choice = st.radio("**👇 Select AI SEO Tool:**", options, index=0, format_func=lambda x: f"📝 {x}")
|
||||
|
||||
# Handle choices based on the selected option
|
||||
if choice == "Generate Structured Data - Rich Snippet":
|
||||
ai_structured_data()
|
||||
elif choice == "Generate Meta Description for SEO":
|
||||
metadesc_generator_main()
|
||||
elif choice == "Generate SEO optimized Blog Titles":
|
||||
ai_title_generator()
|
||||
elif choice == "Generate Image Alt Text":
|
||||
alt_text_gen()
|
||||
elif choice == "Generate OpenGraph Tags":
|
||||
og_tag_generator()
|
||||
elif choice == "Optimize/Resize Image":
|
||||
main_img_optimizer()
|
||||
elif choice == "Run Google PageSpeed Insights":
|
||||
google_pagespeed_insights()
|
||||
elif choice == "Analyze On Page SEO":
|
||||
analyze_onpage_seo()
|
||||
elif choice == "URL SEO Checker":
|
||||
url_seo_checker()
|
||||
|
||||
|
||||
def blog_from_keyword():
|
||||
""" Input blog keywords, research and write a factual blog."""
|
||||
st.header("Blog Content Writer")
|
||||
|
||||
@@ -34,6 +34,8 @@ def check_api_keys():
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
|
||||
@st.cache_data
|
||||
def check_llm_environs():
|
||||
"""
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import streamlit as st
|
||||
from lib.utils.alwrity_utils import (
|
||||
blog_from_keyword, ai_agents_team, essay_writer, ai_news_writer, ai_seo_tools,
|
||||
blog_from_keyword, ai_agents_team, essay_writer, ai_news_writer,
|
||||
ai_finance_ta_writer, ai_social_writer, do_web_research, competitor_analysis
|
||||
)
|
||||
from lib.ai_writers.ai_story_writer.story_writer import story_input_section
|
||||
from lib.ai_writers.ai_product_description_writer import write_ai_prod_desc
|
||||
from lib.content_planning_calender.content_planning_agents_alwrity_crew import ai_agents_content_planner
|
||||
from lib.utils.seo_tools import ai_seo_tools
|
||||
|
||||
|
||||
def ai_writers():
|
||||
options = [
|
||||
|
||||
@@ -8,40 +8,80 @@ from lib.ai_seo_tools.optimize_images_for_upload import main_img_optimizer
|
||||
from lib.ai_seo_tools.google_pagespeed_insights import google_pagespeed_insights
|
||||
from lib.ai_seo_tools.on_page_seo_analyzer import analyze_onpage_seo
|
||||
from lib.ai_seo_tools.weburl_seo_checker import url_seo_checker
|
||||
from lib.ai_marketing_tools.backlinking_ui_streamlit import backlinking_ui
|
||||
|
||||
|
||||
def ai_seo_tools():
|
||||
""" Collection SEO tools for content creators. """
|
||||
"""
|
||||
A collection of AI-powered SEO tools for content creators, providing various options
|
||||
such as generating structured data, optimizing images, checking page speed,
|
||||
and analyzing on-page SEO.
|
||||
"""
|
||||
st.markdown(
|
||||
"""
|
||||
Welcome to your one-stop solution for AI-driven SEO optimization. Select a tool from the options below
|
||||
to improve your website’s SEO with cutting-edge AI technology.
|
||||
"""
|
||||
)
|
||||
# List of SEO tools with unique emojis for each option
|
||||
options = [
|
||||
"Generate Structured Data - Rich Snippet",
|
||||
"Generate SEO optimized Blog Titles",
|
||||
"Generate Meta Description for SEO",
|
||||
"Generate Image Alt Text",
|
||||
"Generate OpenGraph Tags",
|
||||
"Optimize/Resize Image",
|
||||
"Run Google PageSpeed Insights",
|
||||
"Analyze On Page SEO",
|
||||
"URL SEO Checker"
|
||||
"📝 Generate Structured Data - Rich Snippet",
|
||||
"✏️ Generate SEO Optimized Blog Titles",
|
||||
"📝 Generate Meta Description for SEO",
|
||||
"🖼️ Generate Image Alt Text",
|
||||
"📄 Generate OpenGraph Tags",
|
||||
"📉 Optimize/Resize Image",
|
||||
"⚡ Run Google PageSpeed Insights",
|
||||
"🔍 Analyze On-Page SEO",
|
||||
"🌐 URL SEO Checker",
|
||||
"🔗 AI Backlinking Tool"
|
||||
]
|
||||
|
||||
# Using st.radio instead of st.selectbox
|
||||
choice = st.radio("**👇 Select AI SEO Tool:**", options, index=0, format_func=lambda x: f"📝 {x}")
|
||||
# User selection of SEO tools using radio buttons
|
||||
choice = st.radio(
|
||||
"**👇 Select an AI SEO Tool:**",
|
||||
options,
|
||||
index=0,
|
||||
format_func=lambda x: x
|
||||
)
|
||||
|
||||
# Handle choices based on the selected option
|
||||
if choice == "Generate Structured Data - Rich Snippet":
|
||||
# Call the respective functions based on the user selection
|
||||
if choice == "📝 Generate Structured Data - Rich Snippet":
|
||||
# Generate Structured Data for Rich Snippets
|
||||
ai_structured_data()
|
||||
elif choice == "Generate Meta Description for SEO":
|
||||
|
||||
elif choice == "📝 Generate Meta Description for SEO":
|
||||
# Generate SEO-optimized meta descriptions
|
||||
metadesc_generator_main()
|
||||
elif choice == "Generate SEO optimized Blog Titles":
|
||||
|
||||
elif choice == "✏️ Generate SEO Optimized Blog Titles":
|
||||
# Generate SEO-friendly blog titles
|
||||
ai_title_generator()
|
||||
elif choice == "Generate Image Alt Text":
|
||||
|
||||
elif choice == "🖼️ Generate Image Alt Text":
|
||||
# Generate alternative text for images
|
||||
alt_text_gen()
|
||||
elif choice == "Generate OpenGraph Tags":
|
||||
|
||||
elif choice == "📄 Generate OpenGraph Tags":
|
||||
# Generate OpenGraph tags for social media sharing
|
||||
og_tag_generator()
|
||||
elif choice == "Optimize/Resize Image":
|
||||
|
||||
elif choice == "📉 Optimize/Resize Image":
|
||||
# Optimize images by resizing or compressing them
|
||||
main_img_optimizer()
|
||||
elif choice == "Run Google PageSpeed Insights":
|
||||
|
||||
elif choice == "⚡ Run Google PageSpeed Insights":
|
||||
# Run Google PageSpeed Insights for performance analysis
|
||||
google_pagespeed_insights()
|
||||
elif choice == "Analyze On Page SEO":
|
||||
|
||||
elif choice == "🔍 Analyze On-Page SEO":
|
||||
# Analyze on-page SEO elements
|
||||
analyze_onpage_seo()
|
||||
elif choice == "URL SEO Checker":
|
||||
|
||||
elif choice == "🌐 URL SEO Checker":
|
||||
# Check SEO health of a specific URL
|
||||
url_seo_checker()
|
||||
|
||||
elif choice == "🔗 AI Backlinking Tool":
|
||||
# Run AI Backlinking tool for link-building opportunities
|
||||
backlinking_ui()
|
||||
|
||||
@@ -2,7 +2,9 @@ import os
|
||||
import streamlit as st
|
||||
from .file_processor import load_image
|
||||
from .content_generators import content_planning_tools, ai_writers
|
||||
from .alwrity_utils import ai_agents_team, ai_seo_tools, ai_social_writer
|
||||
from .alwrity_utils import ai_agents_team, ai_social_writer
|
||||
from .seo_tools import ai_seo_tools
|
||||
|
||||
|
||||
def setup_ui():
|
||||
"""Sets up the Streamlit UI with custom CSS and logo."""
|
||||
@@ -23,6 +25,7 @@ def setup_ui():
|
||||
</div>
|
||||
""", unsafe_allow_html=True)
|
||||
|
||||
|
||||
def setup_tabs():
|
||||
"""Sets up the main tabs in the Streamlit app."""
|
||||
tab1, tab2, tab3, tab4, tab5, tab6 = st.tabs(
|
||||
|
||||
Reference in New Issue
Block a user