diff --git a/alwrity.py b/alwrity.py index bf2f484d..648dd313 100644 --- a/alwrity.py +++ b/alwrity.py @@ -325,7 +325,7 @@ def main(): if check_api_keys() and check_llm_environs(): # Define the tabs tab1, tab2, tab3, tab4, tab5, tab6 = st.tabs( - ["AI Writers", "Content Planning", "Agents Teams", "AI SEO tools", "AI Social Tools", "Ask Alwrity"]) + ["βœοΈπŸ€–AI Writers", " πŸ“πŸ“…Content Planning", "πŸ€πŸ€–Agents Teams", "πŸ› οΈπŸ”AI SEO tools", "πŸ“±AI Social Tools", " πŸ’¬Ask Alwrity"]) with tab1: ai_writers() diff --git a/lib/ai_writers/facebook_ai_writer.py b/lib/ai_writers/facebook_ai_writer.py index 5fc5e47a..052e026c 100644 --- a/lib/ai_writers/facebook_ai_writer.py +++ b/lib/ai_writers/facebook_ai_writer.py @@ -4,7 +4,7 @@ import json import requests import streamlit as st -from streamlit_quill import st_quill +#from streamlit_quill import st_quill from ..gpt_providers.text_generation.main_text_generation import llm_text_gen diff --git a/lib/ai_writers/insta_ai_writer.py b/lib/ai_writers/insta_ai_writer.py index 85cf8ed4..01f2122e 100644 --- a/lib/ai_writers/insta_ai_writer.py +++ b/lib/ai_writers/insta_ai_writer.py @@ -4,6 +4,8 @@ import json import requests import streamlit as st +from ..gpt_providers.text_generation.main_text_generation import llm_text_gen + def insta_writer(): # Title and description @@ -42,7 +44,7 @@ def insta_writer(): ) if insta_captions: st.subheader('**πŸ‘©πŸ‘©πŸ”¬Go Viral, with these Instagram captions!πŸŽ†πŸŽ‡ πŸŽ‡**') - st.code(insta_captions) + st.markdown(insta_captions) else: st.error("πŸ’₯**Failed to generate instagram Captions. Please try again!**") @@ -69,5 +71,10 @@ def generate_insta_captions(input_insta_keywords, input_insta_type, input_insta_ \nInstagram caption keywords: '{input_insta_keywords}'\n """ - insta_captions = generate_text_with_exception_handling(prompt) - return insta_captions + + try: + response = llm_text_gen(prompt) + return response + except Exception as err: + st.error(f"Exit: Failed to get response from LLM: {err}") + exit(1) diff --git a/lib/ai_writers/twitter_ai_writer.py b/lib/ai_writers/twitter_ai_writer.py index ab937258..63f55c2d 100644 --- a/lib/ai_writers/twitter_ai_writer.py +++ b/lib/ai_writers/twitter_ai_writer.py @@ -4,6 +4,8 @@ import json import requests import streamlit as st +from ..gpt_providers.text_generation.main_text_generation import llm_text_gen + def tweet_writer(): """ AI Tweet Generator """ @@ -25,15 +27,14 @@ def tweet_writer(): ) if st.button('**Write Tweets**'): - with st.status("Assigning AI professional to write your Google Ads copy..", expanded=True) as status: - if not target_audience or not hook: - st.error("🚫 Please provide all required inputs.") - else: + if not target_audience or not hook: + st.error("🚫 Please provide all required inputs.") + else: + with st.status("Assigning AI professional to write your Google Ads copy..", expanded=True) as status: response = tweet_generator(target_audience, hook) if response: - st.subheader(f'**πŸ§•πŸ‘©: Your Final Tweets!**') - st.write(response) - st.write("\n\n\n\n\n\n") + st.subheader(f'**πŸ§•πŸ‘©: Your Tweets!**') + st.markdown(response) else: st.error("πŸ’₯**Failed to write Letter. Please try again!**") @@ -67,7 +68,7 @@ def tweet_generator(target_audience, hook): """ try: - response = generate_text_with_exception_handling(prompt) + response = llm_text_gen(prompt) return response except Exception as err: st.error(f"Exit: Failed to get response from LLM: {err}")