From c9369baacda54130498c0cd6b6d35d6a091cd9f8 Mon Sep 17 00:00:00 2001 From: priyanshm07 Date: Sat, 29 Mar 2025 16:54:14 +0530 Subject: [PATCH 1/6] feature : multiagent breakup recovery --- .../ai_breakup_recovery_agent/.gitignore | 42 ++++++ .../ai_breakup_recovery_agent/agents.py | 122 ++++++++++++++++++ .../ai_breakup_recovery_agent/app.py | 72 +++++++++++ 3 files changed, 236 insertions(+) create mode 100644 ai_agent_tutorials/ai_breakup_recovery_agent/.gitignore create mode 100644 ai_agent_tutorials/ai_breakup_recovery_agent/agents.py create mode 100644 ai_agent_tutorials/ai_breakup_recovery_agent/app.py diff --git a/ai_agent_tutorials/ai_breakup_recovery_agent/.gitignore b/ai_agent_tutorials/ai_breakup_recovery_agent/.gitignore new file mode 100644 index 0000000..cb4801b --- /dev/null +++ b/ai_agent_tutorials/ai_breakup_recovery_agent/.gitignore @@ -0,0 +1,42 @@ +# Python-related +__pycache__/ +*.pyc +*.pyo +*.pyd +*.db +*.sqlite3 +*.log +*.json + +# Environment and secrets +.env +*.env + +# Streamlit cache and temporary files +.streamlit/ +.history/ +.cache/ +*.stcache +.stcache/ + +# Logs and temp files +*.log +*.out +*.err + +# IDE and editor config files +.vscode/ +.idea/ +*.swp +*.swo +*.bak +*.tmp + +# System files +.DS_Store +Thumbs.db + +# OCR and image processing cache (if any) +~/.EasyOCR/ +*.easyocr +*.txt diff --git a/ai_agent_tutorials/ai_breakup_recovery_agent/agents.py b/ai_agent_tutorials/ai_breakup_recovery_agent/agents.py new file mode 100644 index 0000000..757683c --- /dev/null +++ b/ai_agent_tutorials/ai_breakup_recovery_agent/agents.py @@ -0,0 +1,122 @@ +from agno.agent import Agent +from agno.team.team import Team +from agno.models.openai import OpenAIChat +from agno.tools.duckduckgo import DuckDuckGoTools +from PIL import Image +import easyocr + +# --- Therapist Agent --- +def create_therapist_agent(): + return Agent( + name="Therapist Agent", + role="You are a therapist who validates feelings and encourages reflection without judgment.", + instructions=[ + "Listen to the user's feelings with empathy and compassion.", + "Ask reflective questions to help them explore their emotions.", + "Offer coping strategies without being dismissive.", + "Validate their experiences and provide emotional support.", + ], + model=OpenAIChat(id="gpt-4o-mini"), + tools=[DuckDuckGoTools()], + add_datetime_to_instructions=True, # Add timestamp context + show_tool_calls=True, + markdown=True + ) + +# --- Closure Agent --- +def create_closure_agent(): + return Agent( + name="Closure Agent", + role="You write emotional closure messages the user *should not* send.", + instructions=[ + "Create emotional messages that express raw, honest feelings.", + "The messages should NOT be sent — they are only for emotional release.", + "Format the output clearly with a header: **Message Drafts You Shouldn’t Send**", + "Ensure the tone is heartfelt, authentic, and honest.", + ], + model=OpenAIChat(id="gpt-4o-mini"), + tools=[DuckDuckGoTools()], + add_datetime_to_instructions=True, # Add timestamp context + show_tool_calls=True, + markdown=True + ) + + + # --- Routine Planner Agent --- +def create_routine_agent(): + """Creates the Routine Planner Agent with recovery routines.""" + return Agent( + name="Routine Planner Agent", + role="Create a realistic daily routine to help someone emotionally recover after a breakup.", + instructions=[ + "Suggest a balanced daily routine with healthy habits.", + "Include time for self-reflection, creative outlets, and physical activities.", + "Suggest social interactions, like reconnecting with friends or family.", + "Include healthy distractions, such as hobbies, reading, or new experiences.", + "Format the output clearly with a header: **Daily Recovery Routine**", + ], + model=OpenAIChat(id="gpt-4o-mini"), + tools=[DuckDuckGoTools()], + add_datetime_to_instructions=True, + show_tool_calls=True, + markdown=True + ) + +# --- Brutal Honesty Agent --- +def create_honesty_agent(): + """Creates the Brutal Honesty Agent with no-nonsense, direct responses.""" + return Agent( + name="Brutal Honesty Agent", + role="Be brutally honest and objective about what went wrong and why the user needs to move on. No sugar-coating.", + instructions=[ + "Give raw, direct, and objective feedback about the breakup.", + "Explain why the relationship failed with clear, straightforward reasoning.", + "Use blunt, factual language. No sugar-coating or emotional cushioning.", + "Include reasons why the user should move on, based on the situation.", + "Format the output clearly with a header: **Brutal Honesty**", + ], + model=OpenAIChat(id="gpt-4o-mini"), + tools=[DuckDuckGoTools()], + add_datetime_to_instructions=True, + show_tool_calls=True, + markdown=True + ) + + +# # --- Texts Analyzer Agent (Updated with easyocr) --- +# def extract_text_with_easyocr(image): +# """Extract text from image using EasyOCR.""" +# reader = easyocr.Reader(['en']) # Specify language +# results = reader.readtext(image) + +# # Extract and combine text +# extracted_text = " ".join([result[1] for result in results]) +# return extracted_text + +# --- Team Leader (Breakup Recovery Team) --- +def create_breakup_team(): + return Team( + name="Breakup Recovery Team", + mode="coordinate", # Team execution mode: coordinate or parallel + model=OpenAIChat(id="gpt-4o-mini"), + members=[ + create_therapist_agent(), + create_closure_agent(), + create_routine_agent(), # Added Routine Planner Agent + create_honesty_agent(), # Added Brutal Honesty Agent + # extract_text_with_easyocr() + ], + description="You are a team helping someone recover from a breakup.", + instructions=[ + "First, ask the Therapist Agent to help the user explore their emotions.", + "Then, ask the Closure Agent to create unsent emotional messages.", + "Next, ask the Routine Planner Agent to suggest a healthy daily routine.", + "Finally, ask the Brutal Honesty Agent to give direct and objective feedback.", + "Summarize and refine all responses into a personalized recovery guide.", + "Ensure the responses are supportive, encouraging, and insightful.", + "Use markdown formatting for clear, readable output.", + ], + add_datetime_to_instructions=True, # Add timestamp context + show_members_responses=True, # Display individual agent responses + markdown=True, + ) diff --git a/ai_agent_tutorials/ai_breakup_recovery_agent/app.py b/ai_agent_tutorials/ai_breakup_recovery_agent/app.py new file mode 100644 index 0000000..13d1c73 --- /dev/null +++ b/ai_agent_tutorials/ai_breakup_recovery_agent/app.py @@ -0,0 +1,72 @@ +import streamlit as st +from agents import create_breakup_team +from PIL import Image + +# --- Streamlit Layout --- +st.title("💔 Breakup Recovery Agent Team") +st.write("Receive support and emotional outlet messages from specialized AI agents.") + +# --- API Keys Input --- +openai_api_key = st.sidebar.text_input("OpenAI API Key", type="password") +submit_button = st.sidebar.button("Submit") + +# --- Store API Keys --- +if submit_button: + if openai_api_key: + st.session_state["openai_api_key"] = openai_api_key + st.success("API keys saved successfully!") + else: + st.error("Please enter both API keys!") + +# --- User Input --- +user_input = st.text_area("Describe how you're feeling...") +print(user_input) + +# --- Image Upload --- +uploaded_image = st.file_uploader("Upload a chat screenshot (optional)", type=["png", "jpg", "jpeg"]) + +# --- Display Uploaded Image --- +extracted_text = "" +if uploaded_image: + image = Image.open(uploaded_image) + st.image(image, caption="Uploaded Screenshot", use_column_width=True) + + # # ✅ Extract text from the image + # extracted_text = extract_text_with_easyocr(image) + # st.text_area("Extracted Text from Image:", extracted_text) + +# --- Execute Agent Team --- +if st.button("Get Recovery Support"): + with st.spinner("Agents are processing..."): + if not user_input and not uploaded_image: + st.error("Please enter what you feel.") + else: + breakup_team = create_breakup_team() + + # Set environment variables + import os + os.environ["OPENAI_API_KEY"] = st.session_state.get("openai_api_key", "") + # os.environ["AGNO_API_KEY"] = st.session_state.get("agno_api_key", "") + + # Prepare the input + input_data = user_input + if uploaded_image: + input_data += "\n\n[Attached Image Included]" # Add image indicator + + # Execute the team + response = breakup_team.run(user_input) + + # Display responses + st.subheader("💡 Team's Responses") + + # Display individual agent responses + if response.member_responses: + for member_response in response.member_responses: + st.markdown(f"### 🛡️ {member_response.agent_id}") + st.write(member_response.content) + else: + st.warning("⚠️ No individual agent responses received. Showing team leader's summary only.") + + # Display team leader's final summary + st.subheader("📜 Team Leader's Summary") + st.write(response.content) From 3735946ad0bf19100b16fa6fc8ffae9df516d1d4 Mon Sep 17 00:00:00 2001 From: priyanshm07 Date: Mon, 31 Mar 2025 13:11:47 +0530 Subject: [PATCH 2/6] fix : Readme, requirements.txt added --- .../ai_breakup_recovery_agent/.gitignore | 42 ------- .../ai_breakup_recovery_agent/README.md | 115 ++++++++++++++++++ .../ai_breakup_recovery_agent/app.py | 2 - .../requirements.txt | 3 + 4 files changed, 118 insertions(+), 44 deletions(-) delete mode 100644 ai_agent_tutorials/ai_breakup_recovery_agent/.gitignore create mode 100644 ai_agent_tutorials/ai_breakup_recovery_agent/README.md create mode 100644 ai_agent_tutorials/ai_breakup_recovery_agent/requirements.txt diff --git a/ai_agent_tutorials/ai_breakup_recovery_agent/.gitignore b/ai_agent_tutorials/ai_breakup_recovery_agent/.gitignore deleted file mode 100644 index cb4801b..0000000 --- a/ai_agent_tutorials/ai_breakup_recovery_agent/.gitignore +++ /dev/null @@ -1,42 +0,0 @@ -# Python-related -__pycache__/ -*.pyc -*.pyo -*.pyd -*.db -*.sqlite3 -*.log -*.json - -# Environment and secrets -.env -*.env - -# Streamlit cache and temporary files -.streamlit/ -.history/ -.cache/ -*.stcache -.stcache/ - -# Logs and temp files -*.log -*.out -*.err - -# IDE and editor config files -.vscode/ -.idea/ -*.swp -*.swo -*.bak -*.tmp - -# System files -.DS_Store -Thumbs.db - -# OCR and image processing cache (if any) -~/.EasyOCR/ -*.easyocr -*.txt diff --git a/ai_agent_tutorials/ai_breakup_recovery_agent/README.md b/ai_agent_tutorials/ai_breakup_recovery_agent/README.md new file mode 100644 index 0000000..afc25c9 --- /dev/null +++ b/ai_agent_tutorials/ai_breakup_recovery_agent/README.md @@ -0,0 +1,115 @@ + +# 💔 Breakup Recovery Agent Team + +This is an AI-powered application designed to help users emotionally recover from breakups by providing support, guidance, and emotional outlet messages from a team of specialized AI agents. The app is built using **Streamlit** and **Agno**, leveraging **OpenAI's GPT models**. + +## 🚀 Features + +- 🧠 **Multi-Agent Team:** + - **Therapist Agent:** Offers empathetic support and coping strategies. + - **Closure Agent:** Writes emotional messages users shouldn't send for catharsis. + - **Routine Planner Agent:** Suggests daily routines for emotional recovery. + - **Brutal Honesty Agent:** Provides direct, no-nonsense feedback on the breakup. +- 📷 **Chat Screenshot Analysis:** (Planned) + - Upload screenshots for chat analysis. +- 🔑 **API Key Management:** + - Store and manage your OpenAI API keys securely via Streamlit's sidebar. +- ⚡ **Parallel Execution:** + - Agents process inputs in coordination mode for comprehensive results. +- ✅ **User-Friendly Interface:** + - Simple, intuitive UI with easy interaction and display of agent responses. + +--- + +## 🛠️ Tech Stack + +- **Frontend:** Streamlit (Python) +- **AI Models:** OpenAI GPT-4o (via Agno) +- **Image Processing:** PIL (for displaying screenshots) +- **Text Extraction:** EasyOCR (planned feature for extracting text from screenshots) +- **Environment Variables:** API keys managed with `st.session_state` in Streamlit + +--- + +## 📦 Installation + +1. **Clone the Repository:** + ```bash + git clone + cd breakup-recovery-agent-team + ``` + +2. **Create a Virtual Environment (Optional but Recommended):** + ```bash + conda create --name python= + conda activate + ``` + +3. **Install Dependencies:** + ```bash + pip install -r requirements.txt + ``` + +4. **Run the Streamlit App:** + ```bash + streamlit run app.py + ``` + +--- + +## 🔑 Environment Variables + +Make sure to provide your **OpenAI API key** in the Streamlit sidebar: + +- `OpenAI API Key` → Add your API key in the sidebar form. + +--- + +## 🛠️ Usage + +1. **Enter Your Feelings:** + - Describe how you're feeling in the text area. +2. **Upload Screenshot (Optional):** + - Upload a chat screenshot (PNG, JPG, JPEG) for analysis (planned feature). +3. **Execute Agents:** + - Click **"Get Recovery Support"** to run the multi-agent team. +4. **View Results:** + - Individual agent responses are displayed. + - A final summary is provided by the Team Leader. + +--- + +## 🧑‍💻 Agents Overview + +- **Therapist Agent** + - Provides empathetic support and coping strategies. + - Uses **OpenAI GPT-4o-mini** and DuckDuckGo tools for insights. + +- **Closure Agent** + - Generates unsent emotional messages for emotional release. + - Ensures heartfelt and authentic messages. + +- **Routine Planner Agent** + - Creates a daily recovery routine with balanced activities. + - Includes self-reflection, social interaction, and healthy distractions. + +- **Brutal Honesty Agent** + - Offers direct, objective feedback on the breakup. + - Uses factual language with no sugar-coating. + +--- + +## 🔥 Future Enhancements + +- ✅ **Text Extraction from Screenshots:** + - Use EasyOCR to extract text from uploaded screenshots for chat analysis. +- ✅ **Improved Image Analysis:** + - Integrate image analysis tools for detecting visual patterns in chat screenshots. + +--- + +## 📄 License + +This project is licensed under the **MIT License**. + +--- diff --git a/ai_agent_tutorials/ai_breakup_recovery_agent/app.py b/ai_agent_tutorials/ai_breakup_recovery_agent/app.py index 13d1c73..b11054b 100644 --- a/ai_agent_tutorials/ai_breakup_recovery_agent/app.py +++ b/ai_agent_tutorials/ai_breakup_recovery_agent/app.py @@ -20,7 +20,6 @@ if submit_button: # --- User Input --- user_input = st.text_area("Describe how you're feeling...") -print(user_input) # --- Image Upload --- uploaded_image = st.file_uploader("Upload a chat screenshot (optional)", type=["png", "jpg", "jpeg"]) @@ -46,7 +45,6 @@ if st.button("Get Recovery Support"): # Set environment variables import os os.environ["OPENAI_API_KEY"] = st.session_state.get("openai_api_key", "") - # os.environ["AGNO_API_KEY"] = st.session_state.get("agno_api_key", "") # Prepare the input input_data = user_input diff --git a/ai_agent_tutorials/ai_breakup_recovery_agent/requirements.txt b/ai_agent_tutorials/ai_breakup_recovery_agent/requirements.txt new file mode 100644 index 0000000..25c0952 --- /dev/null +++ b/ai_agent_tutorials/ai_breakup_recovery_agent/requirements.txt @@ -0,0 +1,3 @@ +agno==1.2.4 +pillow==11.1.0 +streamlit==1.44.0 From a25e103189b6ee9eb75199db31bab40be1dc9152 Mon Sep 17 00:00:00 2001 From: priyanshm07 Date: Tue, 1 Apr 2025 23:02:55 +0530 Subject: [PATCH 3/6] update : multi-agent with file ss upload --- .../__pycache__/agents.cpython-39.pyc | Bin 0 -> 4122 bytes .../__pycache__/image_input.cpython-39.pyc | Bin 0 -> 2694 bytes .../ai_breakup_recovery_agent/agents.py | 32 ++++-- .../ai_breakup_recovery_agent/app.py | 91 +++++++++++------- .../ai_breakup_recovery_agent/image_input.py | 86 +++++++++++++++++ .../requirements.txt | 2 +- 6 files changed, 167 insertions(+), 44 deletions(-) create mode 100644 ai_agent_tutorials/ai_breakup_recovery_agent/__pycache__/agents.cpython-39.pyc create mode 100644 ai_agent_tutorials/ai_breakup_recovery_agent/__pycache__/image_input.cpython-39.pyc create mode 100644 ai_agent_tutorials/ai_breakup_recovery_agent/image_input.py diff --git a/ai_agent_tutorials/ai_breakup_recovery_agent/__pycache__/agents.cpython-39.pyc b/ai_agent_tutorials/ai_breakup_recovery_agent/__pycache__/agents.cpython-39.pyc new file mode 100644 index 0000000000000000000000000000000000000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0zLpQNs~cAog6|ka6(&+$`x#I zA&AiuN_=@4WGOt){N~}!rC}8Y8p@XXnMZ@4kVZ7r{$B7Xq|swU;}c&;#~u_Dl;BAW zDVT3Qz6oZ5^O#^&u@sEu4TGFm`!U2DvP1G|WAl-YiN+Ptn#oc%%Qx-orkzz>;Z3`t zDIbU$+dTfAHf=Yw>fk)5O{J1C2(i%09VS^$G#4P@)!9+5KvGc@b;(mVjk!`aQ@w7| zeC#Y}7}jIYU-RP?|#z zaV|*7tJ=ChVK^scRznV&FF)wvFV1GHiZk0XqH>;%HCVTbvzq66O-o)??j00@Ra%1M z*7_kElL;46HMg#VLjDj^e3xgCJhg#uG0jqqc?mlpmD*+=d{c0~vX<3lnlmC{ft|A1 zX+GPPQ2*5CnKDhl1q9FhsqSjFT*qxG3 zal0Q(vPZdSF_MmFsl$3&vF7#-2-4+-JYI!)wE~Uj`^f&|j%_=Cg<*{R-{l)H^9*U* zLoA~>wxBR*R<(EN9b39aj;{SZpl=-<0*AP32WZ>U^uXT|7tOci~;QZft*c@x;xCGnA4SFxqmxMd=It)976&Jiwas+F=}+<~ibU z1@bIA%+kIJ1<+!UoMCYFDWHjR)s;@+@Ss{e^nQU0&teB^-QGElidFOamXt5D;S>Ja zz<0WHj-FlAO(5%11`uKS7Bpsl>tV`VwV41)r5nlfR(!5ye|P&v&HH!(QGNYT99hNzMvwR{H{b1FA* z_hr)|St)wXL5G4kX8_d4*u`JIXSXiFMGu$tEbQ_fyVG8!CUP@RCBfm- rp)&agm|ExTQ~OP%-i2lX&Hf3D5=1.2.4 pillow==11.1.0 streamlit==1.44.0 From f41c3582b9e12ae6016162df43e5862f8932195c Mon Sep 17 00:00:00 2001 From: priyanshm07 Date: Wed, 2 Apr 2025 03:06:57 +0530 Subject: [PATCH 4/6] fix : files cleaned --- .../__pycache__/agents.cpython-39.pyc | Bin 4122 -> 0 bytes .../__pycache__/image_input.cpython-39.pyc | Bin 2694 -> 0 bytes .../ai_breakup_recovery_agent/agents.py | 24 +++------------- .../ai_breakup_recovery_agent/image_input.py | 26 +----------------- 4 files changed, 5 insertions(+), 45 deletions(-) delete mode 100644 ai_agent_tutorials/ai_breakup_recovery_agent/__pycache__/agents.cpython-39.pyc delete mode 100644 ai_agent_tutorials/ai_breakup_recovery_agent/__pycache__/image_input.cpython-39.pyc diff --git a/ai_agent_tutorials/ai_breakup_recovery_agent/__pycache__/agents.cpython-39.pyc b/ai_agent_tutorials/ai_breakup_recovery_agent/__pycache__/agents.cpython-39.pyc deleted file mode 100644 index dbe72c28d139df508eaacc8b7ed095159a2552e0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4122 zcmcInTW{pH6`uQyZ|hCEc6v!$0xb~O7|ZD;1#)SyyS~MZ<1DgHfcRy=5jh&IB~c|Q z&st9f(${_K4`}nYZ~Z-bY|)1TMce0~DEb{r8jm+FiUg_0LvbYX@Er0x-}%JX)|MOi z+r0O;;E$V)#-HiO;$I6t?&E8oq7ec#!@ zzUz0RLA-RnUVo5CHx+Ye{Dz10Lnz)1Ox>y%?alI>g zj~iPr{S~V>wwguvK_C;0PUlSW7}wsBjKd^EZ+$=WFX(%u&XkG_jXsWfAWwaoy!b~U z@8N4+M`IC`Xax_pD{RpEZIeoTbm;*#OQgo#yLjQ>l3x z8q1tR`6r*MjBza)XLkN*HdXABN1@1}oLw@$E%Oqf+?`~*2Ijo{mk-Rv-2SCx zzs{tgg$!An$|xn1F_TZzNWpjf2sMl;H^$3<^5JA6HS<*pznQTbaReb;uKgTKdLTj* zhgk7adik55RPolvo~BZVh!(Rb?o_MGP{?`_9x;=psnXW_;%?wha_6Vs>pPQ(n`v?9 z=-`9n)8o;DN5`Z04?ca~Dq5i^`q=l;g}gd@J}5c~k7d!(Dw4%&n83x%?W8HXu@W*W zx|X0&yvl_b(J|OCmLsc1H^#1;shZ)gibg()EtNAA{GOMa21BQ1S(DfLx3X4j20UV2q*`WRsm zS&hAN1mWC#7fqwta-Uw0uFL=Kbb95Tf9mh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4kX8_d4*u`JIXSXiFMGu$tEbQ_fyVG8!CUP@RCBfm- rp)&agm|ExTQ~OP%-i2lX&Hf3D5 Date: Wed, 2 Apr 2025 03:14:41 +0530 Subject: [PATCH 5/6] fix : requirements.txt updated --- .../ai_breakup_recovery_agent/requirements.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ai_agent_tutorials/ai_breakup_recovery_agent/requirements.txt b/ai_agent_tutorials/ai_breakup_recovery_agent/requirements.txt index 84af6db..9a97ff1 100644 --- a/ai_agent_tutorials/ai_breakup_recovery_agent/requirements.txt +++ b/ai_agent_tutorials/ai_breakup_recovery_agent/requirements.txt @@ -1,3 +1,9 @@ -agno>=1.2.4 -pillow==11.1.0 streamlit==1.44.0 +torch==1.13.0 +torchvision==0.14.0 +scikit-image==0.24.0 +scipy==1.13.1 +pillow=11.1.0 +tqdm==4.67.1 +websockets==15.0.1 +typer==0.15.2 From 4027a14fec8650a8a1ec1a5ab119bde4efd22e34 Mon Sep 17 00:00:00 2001 From: priyanshm07 Date: Tue, 8 Apr 2025 07:06:59 +0530 Subject: [PATCH 6/6] fix : README.md fixed --- .../ai_breakup_recovery_agent/README.md | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/ai_agent_tutorials/ai_breakup_recovery_agent/README.md b/ai_agent_tutorials/ai_breakup_recovery_agent/README.md index afc25c9..4841802 100644 --- a/ai_agent_tutorials/ai_breakup_recovery_agent/README.md +++ b/ai_agent_tutorials/ai_breakup_recovery_agent/README.md @@ -1,7 +1,7 @@ # 💔 Breakup Recovery Agent Team -This is an AI-powered application designed to help users emotionally recover from breakups by providing support, guidance, and emotional outlet messages from a team of specialized AI agents. The app is built using **Streamlit** and **Agno**, leveraging **OpenAI's GPT models**. +This is an AI-powered application designed to help users emotionally recover from breakups by providing support, guidance, and emotional outlet messages from a team of specialized AI agents. The app is built using **Streamlit** and **Agno**, leveraging **Gemini 2.0 Flash (Google Vision Model) **. ## 🚀 Features @@ -10,7 +10,7 @@ This is an AI-powered application designed to help users emotionally recover fro - **Closure Agent:** Writes emotional messages users shouldn't send for catharsis. - **Routine Planner Agent:** Suggests daily routines for emotional recovery. - **Brutal Honesty Agent:** Provides direct, no-nonsense feedback on the breakup. -- 📷 **Chat Screenshot Analysis:** (Planned) +- 📷 **Chat Screenshot Analysis:** - Upload screenshots for chat analysis. - 🔑 **API Key Management:** - Store and manage your OpenAI API keys securely via Streamlit's sidebar. @@ -24,9 +24,9 @@ This is an AI-powered application designed to help users emotionally recover fro ## 🛠️ Tech Stack - **Frontend:** Streamlit (Python) -- **AI Models:** OpenAI GPT-4o (via Agno) +- **AI Models:** Gemini 2.0 Flash (Google Vision Model) - **Image Processing:** PIL (for displaying screenshots) -- **Text Extraction:** EasyOCR (planned feature for extracting text from screenshots) +- **Text Extraction:** Google's Gemini Vision model to analyze chat screenshots - **Environment Variables:** API keys managed with `st.session_state` in Streamlit --- @@ -59,9 +59,9 @@ This is an AI-powered application designed to help users emotionally recover fro ## 🔑 Environment Variables -Make sure to provide your **OpenAI API key** in the Streamlit sidebar: +Make sure to provide your **Gemini API key** in the Streamlit sidebar: -- `OpenAI API Key` → Add your API key in the sidebar form. +- GEMINI_API_KEY=your_google_gemini_api_key --- @@ -70,7 +70,7 @@ Make sure to provide your **OpenAI API key** in the Streamlit sidebar: 1. **Enter Your Feelings:** - Describe how you're feeling in the text area. 2. **Upload Screenshot (Optional):** - - Upload a chat screenshot (PNG, JPG, JPEG) for analysis (planned feature). + - Upload a chat screenshot (PNG, JPG, JPEG) for analysis. 3. **Execute Agents:** - Click **"Get Recovery Support"** to run the multi-agent team. 4. **View Results:** @@ -83,7 +83,7 @@ Make sure to provide your **OpenAI API key** in the Streamlit sidebar: - **Therapist Agent** - Provides empathetic support and coping strategies. - - Uses **OpenAI GPT-4o-mini** and DuckDuckGo tools for insights. + - Uses **Gemini 2.0 Flash (Google Vision Model)** and DuckDuckGo tools for insights. - **Closure Agent** - Generates unsent emotional messages for emotional release. @@ -99,14 +99,6 @@ Make sure to provide your **OpenAI API key** in the Streamlit sidebar: --- -## 🔥 Future Enhancements - -- ✅ **Text Extraction from Screenshots:** - - Use EasyOCR to extract text from uploaded screenshots for chat analysis. -- ✅ **Improved Image Analysis:** - - Integrate image analysis tools for detecting visual patterns in chat screenshots. - ---- ## 📄 License