100+ AI Agents, Agent Skills and RAG Apps - Free and Open Source.
refactor: Update AI real estate and recruitment agent teams to use RunOutput for type safety
Shubhamsaboodad9e3537412
diff --git a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_real_estate_agent_team/ai_real_estate_agent_team.py b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_real_estate_agent_team/ai_real_estate_agent_team.pyindex 37439fd2..b4aba2c0 100644--- a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_real_estate_agent_team/ai_real_estate_agent_team.py+++ b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_real_estate_agent_team/ai_real_estate_agent_team.py@@ -4,6 +4,7 @@ import jsonimport timeimport refrom agno.agent import Agent+from agno.run.agent import RunOutputfrom agno.models.google import Geminifrom dotenv import load_dotenvfrom firecrawl import FirecrawlApp@@ -298,7 +299,7 @@ def run_sequential_analysis(city, state, user_criteria, selected_websites, firecKeep each section under 100 words. Use bullet points."""- market_result = market_analysis_agent.run(market_analysis_prompt)+ market_result: RunOutput = market_analysis_agent.run(market_analysis_prompt)market_analysis = market_result.contentupdate_callback(0.7, "Market analysis complete", "✅ Market analysis completed")@@ -353,7 +354,7 @@ def run_sequential_analysis(city, state, user_criteria, selected_websites, firec- Use bullet points as shown"""- valuation_result = property_valuation_agent.run(valuation_prompt)+ valuation_result: RunOutput = property_valuation_agent.run(valuation_prompt)property_valuations = valuation_result.contentupdate_callback(0.9, "Valuation complete", "✅ Property valuations completed")diff --git a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_real_estate_agent_team/local_ai_real_estate_agent_team.py b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_real_estate_agent_team/local_ai_real_estate_agent_team.pyindex b5615d6e..5cb5ca74 100644--- a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_real_estate_agent_team/local_ai_real_estate_agent_team.py+++ b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_real_estate_agent_team/local_ai_real_estate_agent_team.py@@ -4,6 +4,7 @@ import jsonimport timeimport refrom agno.agent import Agent+from agno.run.agent import RunOutputfrom agno.models.ollama import Ollamafrom dotenv import load_dotenvfrom firecrawl import FirecrawlApp@@ -296,7 +297,7 @@ def run_sequential_analysis(city, state, user_criteria, selected_websites, firecKeep each section under 100 words. Use bullet points."""- market_result = market_analysis_agent.run(market_analysis_prompt)+ market_result: RunOutput = market_analysis_agent.run(market_analysis_prompt)market_analysis = market_result.contentupdate_callback(0.7, "Market analysis complete", "✅ Market analysis completed")@@ -351,7 +352,7 @@ def run_sequential_analysis(city, state, user_criteria, selected_websites, firec- Use bullet points as shown"""- valuation_result = property_valuation_agent.run(valuation_prompt)+ valuation_result: RunOutput = property_valuation_agent.run(valuation_prompt)property_valuations = valuation_result.contentupdate_callback(0.9, "Valuation complete", "✅ Property valuations completed")diff --git a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_real_estate_agent_team/requirements.txt b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_real_estate_agent_team/requirements.txtindex 4e1c53b1..9ea8ed6c 100644--- a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_real_estate_agent_team/requirements.txt+++ b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_real_estate_agent_team/requirements.txt@@ -1,9 +1,8 @@streamlit>=1.28.0-agno>=0.1.0+agno>=2.2.10openai>=1.0.0-firecrawl-py>=0.1.0-pydantic>=2.0.0+firecrawl-py>=1.9.0+pydantic>=2.7.0python-dotenv>=1.0.0requests>=2.31.0googlesearch-python>=1.2.3-pycountry>=23.12.11diff --git a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_recruitment_agent_team/ai_recruitment_agent_team.py b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_recruitment_agent_team/ai_recruitment_agent_team.pyindex 59e56dc0..c5292cd2 100644--- a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_recruitment_agent_team/ai_recruitment_agent_team.py+++ b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_recruitment_agent_team/ai_recruitment_agent_team.py@@ -9,6 +9,7 @@ import pytzimport streamlit as stfrom agno.agent import Agent+from agno.run.agent import RunOutputfrom agno.models.openai import OpenAIChatfrom agno.tools.email import EmailToolsfrom phi.tools.zoom import ZoomTool@@ -142,7 +143,7 @@ def create_email_agent() -> Agent:f"The name of the company is '{st.session_state.company_name}'"],markdown=True,- show_tool_calls=True+ debug_mode=True)@@ -170,7 +171,7 @@ def create_scheduler_agent() -> Agent:"Handle scheduling errors gracefully"],markdown=True,- show_tool_calls=True+ debug_mode=True)@@ -192,7 +193,7 @@ def analyze_resume(analyzer: Agent) -> Tuple[bool, str]:try:- response = analyzer.run(+ response: RunOutput = analyzer.run(f"""Please analyze this resume against the following requirements and provide your response in valid JSON format:Role Requirements:{ROLE_REQUIREMENTS[role]}diff --git a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_recruitment_agent_team/requirements.txt b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_recruitment_agent_team/requirements.txtindex caaaa4e0..deff70d7 100644--- a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_recruitment_agent_team/requirements.txt+++ b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_recruitment_agent_team/requirements.txt@@ -1,6 +1,6 @@# Core dependenciesphidata-agno+agno>=2.2.10streamlit==1.40.2PyPDF2==3.0.1streamlit-pdf-viewer==0.0.19diff --git a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_teaching_agent_team/requirements.txt b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_teaching_agent_team/requirements.txtindex 7b16c6c8..b7d538c4 100644--- a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_teaching_agent_team/requirements.txt+++ b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_teaching_agent_team/requirements.txt@@ -2,7 +2,7 @@ streamlit==1.41.1openai==1.58.1duckduckgo-search==6.4.1typing-extensions>=4.5.0-agno+agno>=2.2.10composio-phidata==0.6.9composio_corecomposio==0.1.1diff --git a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_teaching_agent_team/teaching_agent_team.py b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_teaching_agent_team/teaching_agent_team.pyindex 8306ae35..03683d0e 100644--- a/advanced_ai_agents/multi_agent_apps/agent_teams/ai_teaching_agent_team/teaching_agent_team.py+++ b/advanced_ai_agents/multi_agent_apps/agent_teams/ai_teaching_agent_team/teaching_agent_team.py@@ -1,5 +1,6 @@import streamlit as st-from agno.agent import Agent, RunResponse+from agno.agent import Agent+from agno.run.agent import RunOutputfrom agno.models.openai import OpenAIChatfrom composio_phidata import Action, ComposioToolSetimport os@@ -58,7 +59,7 @@ professor_agent = Agent("Make sure it is formatted in a way that is easy to read and understand. DONT FORGET TO CREATE THE GOOGLE DOCUMENT.","Open a new Google Doc and write down the response of the agent neatly with great formatting and structure in it. **Include the Google Doc link in your response.**",],- show_tool_calls=True,+ debug_mode=True,markdown=True,)@@ -76,7 +77,7 @@ academic_advisor_agent = Agent("Open a new Google Doc and write down the response of the agent neatly with great formatting and structure in it. **Include the Google Doc link in your response.**",],- show_tool_calls=True,+ debug_mode=True,markdown=True)@@ -93,7 +94,7 @@ research_librarian_agent = Agent("Present the resources in a curated list with descriptions and quality assessments. DONT FORGET TO CREATE THE GOOGLE DOCUMENT.","Open a new Google Doc and write down the response of the agent neatly with great formatting and structure in it. **Include the Google Doc link in your response.**",],- show_tool_calls=True,+ debug_mode=True,markdown=True,)@@ -111,7 +112,7 @@ teaching_assistant_agent = Agent("Provide detailed solutions and explanations for all practice materials.DONT FORGET TO CREATE THE GOOGLE DOCUMENT.","Open a new Google Doc and write down the response of the agent neatly with great formatting and structure in it. **Include the Google Doc link in your response.**",],- show_tool_calls=True,+ debug_mode=True,markdown=True,)@@ -132,27 +133,23 @@ if st.button("Start"):else:# Display loading animations while generating responseswith st.spinner("Generating Knowledge Base..."):- professor_response: RunResponse = professor_agent.run(- f"the topic is: {st.session_state['topic']},Don't forget to add the Google Doc link in your response.",- stream=False+ professor_response: RunOutput = professor_agent.run(+ f"the topic is: {st.session_state['topic']},Don't forget to add the Google Doc link in your response.")with st.spinner("Generating Learning Roadmap..."):- academic_advisor_response: RunResponse = academic_advisor_agent.run(- f"the topic is: {st.session_state['topic']},Don't forget to add the Google Doc link in your response.",- stream=False+ academic_advisor_response: RunOutput = academic_advisor_agent.run(+ f"the topic is: {st.session_state['topic']},Don't forget to add the Google Doc link in your response.")with st.spinner("Curating Learning Resources..."):- research_librarian_response: RunResponse = research_librarian_agent.run(- f"the topic is: {st.session_state['topic']},Don't forget to add the Google Doc link in your response.",- stream=False+ research_librarian_response: RunOutput = research_librarian_agent.run(+ f"the topic is: {st.session_state['topic']},Don't forget to add the Google Doc link in your response.")with st.spinner("Creating Practice Materials..."):- teaching_assistant_response: RunResponse = teaching_assistant_agent.run(- f"the topic is: {st.session_state['topic']},Don't forget to add the Google Doc link in your response.",- stream=False+ teaching_assistant_response: RunOutput = teaching_assistant_agent.run(+ f"the topic is: {st.session_state['topic']},Don't forget to add the Google Doc link in your response.")# Extract Google Doc links from the responsesdiff --git a/advanced_ai_agents/multi_agent_apps/agent_teams/multimodal_coding_agent_team/ai_coding_agent_o3.py b/advanced_ai_agents/multi_agent_apps/agent_teams/multimodal_coding_agent_team/ai_coding_agent_o3.pyindex 22c91e60..37f1fe5f 100644--- a/advanced_ai_agents/multi_agent_apps/agent_teams/multimodal_coding_agent_team/ai_coding_agent_o3.py+++ b/advanced_ai_agents/multi_agent_apps/agent_teams/multimodal_coding_agent_team/ai_coding_agent_o3.py@@ -1,13 +1,16 @@from typing import Optional, Dict, Anyimport streamlit as st-from agno.agent import Agent, RunResponse+from agno.agent import Agent+from agno.run.agent import RunOutputfrom agno.models.openai import OpenAIChatfrom agno.models.google import Gemini+from agno.media import Image as AgnoImagefrom e2b_code_interpreter import Sandboximport osfrom PIL import Imagefrom io import BytesIOimport base64+from pathlib import Pathdef initialize_session_state() -> None:if 'openai_key' not in st.session_state:@@ -110,14 +113,13 @@ def process_image_with_gemini(vision_agent: Agent, image: Image) -> str:image = image.convert('RGB')image.save(temp_path, format="PNG")- # Read the file and create image data- with open(temp_path, 'rb') as img_file:- img_bytes = img_file.read()+ # Create Agno Image object+ agno_image = AgnoImage(filepath=Path(temp_path))# Pass image to Gemini- response = vision_agent.run(+ response: RunOutput = vision_agent.run(prompt,- images=[{"filepath": temp_path}] # Use filepath instead of content+ images=[agno_image])return response.contentexcept Exception as e:@@ -143,7 +145,7 @@ def execute_code_with_agent(execution_agent: Agent, code: str, sandbox: Sandbox)Error: {execution.error}Please analyze the error and provide a clear explanation of what went wrong."""- response = execution_agent.run(error_prompt)+ response: RunOutput = execution_agent.run(error_prompt)return f"⚠️ Execution Error:\n{response.content}"# Get files list safely@@ -158,7 +160,7 @@ def execute_code_with_agent(execution_agent: Agent, code: str, sandbox: Sandbox)Please provide a clear explanation of the results and any outputs."""- response = execution_agent.run(prompt)+ response: RunOutput = execution_agent.run(prompt)return response.contentexcept Exception as e:# Reinitialize sandbox on error@@ -220,7 +222,7 @@ def main() -> None:# Pass extracted query to coding agentwith st.spinner("Generating solution..."):- response = coding_agent.run(extracted_query)+ response: RunOutput = coding_agent.run(extracted_query)except Exception as e:st.error(f"Error processing image: {str(e)}")return@@ -228,7 +230,7 @@ def main() -> None:elif user_query and not uploaded_image:# Direct text input processingwith st.spinner("Generating solution..."):- response = coding_agent.run(user_query)+ response: RunOutput = coding_agent.run(user_query)elif user_query and uploaded_image:st.error("Please use either image upload OR text input, not both.")