Skip to content

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.py
index 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 json
import time
import re
from agno.agent import Agent
+from agno.run.agent import RunOutput
from agno.models.google import Gemini
from dotenv import load_dotenv
from firecrawl import FirecrawlApp
@@ -298,7 +299,7 @@ def run_sequential_analysis(city, state, user_criteria, selected_websites, firec
Keep 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.content
update_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.content
update_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.py
index 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 json
import time
import re
from agno.agent import Agent
+from agno.run.agent import RunOutput
from agno.models.ollama import Ollama
from dotenv import load_dotenv
from firecrawl import FirecrawlApp
@@ -296,7 +297,7 @@ def run_sequential_analysis(city, state, user_criteria, selected_websites, firec
Keep 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.content
update_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.content
update_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.txt
index 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.10
openai>=1.0.0
-firecrawl-py>=0.1.0
-pydantic>=2.0.0
+firecrawl-py>=1.9.0
+pydantic>=2.7.0
python-dotenv>=1.0.0
requests>=2.31.0
googlesearch-python>=1.2.3
-pycountry>=23.12.11
diff --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.py
index 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 pytz
import streamlit as st
from agno.agent import Agent
+from agno.run.agent import RunOutput
from agno.models.openai import OpenAIChat
from agno.tools.email import EmailTools
from 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.txt
index 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 dependencies
phidata
-agno
+agno>=2.2.10
streamlit==1.40.2
PyPDF2==3.0.1
streamlit-pdf-viewer==0.0.19
diff --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.txt
index 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.1
openai==1.58.1
duckduckgo-search==6.4.1
typing-extensions>=4.5.0
-agno
+agno>=2.2.10
composio-phidata==0.6.9
composio_core
composio==0.1.1
diff --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.py
index 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 RunOutput
from agno.models.openai import OpenAIChat
from composio_phidata import Action, ComposioToolSet
import 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 responses
with 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 responses
diff --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.py
index 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, Any
import streamlit as st
-from agno.agent import Agent, RunResponse
+from agno.agent import Agent
+from agno.run.agent import RunOutput
from agno.models.openai import OpenAIChat
from agno.models.google import Gemini
+from agno.media import Image as AgnoImage
from e2b_code_interpreter import Sandbox
import os
from PIL import Image
from io import BytesIO
import base64
+from pathlib import Path
def 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.content
except 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.content
except Exception as e:
# Reinitialize sandbox on error
@@ -220,7 +222,7 @@ def main() -> None:
# Pass extracted query to coding agent
with 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 processing
with 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.")