100+ AI Agents, Agent Skills and RAG Apps - Free and Open Source.
feat: Enhance multimodal AI agent with improved API key handling and model updates
Shubhamsaboo074320081e11
diff --git a/starter_ai_agents/multimodal_ai_agent/README.md b/starter_ai_agents/multimodal_ai_agent/README.mdindex 1cb9b4da..718ee919 100644--- a/starter_ai_agents/multimodal_ai_agent/README.md+++ b/starter_ai_agents/multimodal_ai_agent/README.md@@ -1,10 +1,10 @@## 𧬠Multimodal AI Agent-A Streamlit application that combines video analysis and web search capabilities using Google's Gemini 2.0 model. This agent can analyze uploaded videos and answer questions by combining visual understanding with web-search.+A Streamlit application that combines video analysis and web search capabilities using Google's Gemini 2.5 model. This agent can analyze uploaded videos and answer questions by combining visual understanding with web-search.### Features-- Video analysis using Gemini 2.0 Flash+- Video analysis using Gemini 2.5 Flash/Pro- Web research integration via DuckDuckGo- Support for multiple video formats (MP4, MOV, AVI)- Real-time video processingdiff --git a/starter_ai_agents/multimodal_ai_agent/multimodal_reasoning_agent.py b/starter_ai_agents/multimodal_ai_agent/multimodal_reasoning_agent.pyindex 428805a5..5c7487a3 100644--- a/starter_ai_agents/multimodal_ai_agent/multimodal_reasoning_agent.py+++ b/starter_ai_agents/multimodal_ai_agent/multimodal_reasoning_agent.py@@ -1,25 +1,40 @@import streamlit as stfrom agno.agent import Agent+from agno.run.agent import RunOutput+from agno.media import Imagefrom agno.models.google import Geminiimport tempfileimport osdef main():- # Set up the reasoning agent- agent = Agent(- model=Gemini(id="gemini-2.0-flash-thinking-exp-1219"),- markdown=True- )-# Streamlit app titlest.title("Multimodal Reasoning AI Agent π§ ")+ # Get Gemini API key from user in sidebar+ with st.sidebar:+ st.header("π Configuration")+ gemini_api_key = st.text_input("Enter your Gemini API Key", type="password")+ st.caption(+ "Get your API key from [Google AI Studio]"+ "(https://aistudio.google.com/apikey) π"+ )+# Instructionst.write("Upload an image and provide a reasoning-based task for the AI Agent. ""The AI Agent will analyze the image and respond based on your input.")+ if not gemini_api_key:+ st.warning("Please enter your Gemini API key in the sidebar to continue.")+ return++ # Set up the reasoning agent+ agent = Agent(+ model=Gemini(id="gemini-2.5-pro", api_key=gemini_api_key),+ markdown=True+ )+# File uploader for imageuploaded_file = st.file_uploader("Upload Image", type=["jpg", "jpeg", "png"])@@ -43,7 +58,7 @@ def main():with st.spinner("AI is thinking... π€"):try:# Call the agent with the dynamic task and image path- response = agent.run(task_input, images=[temp_path])+ response: RunOutput = agent.run(task_input, images=[Image(filepath=temp_path)])# Display the response from the modelst.markdown("### AI Response:")diff --git a/starter_ai_agents/multimodal_ai_agent/mutimodal_agent.py b/starter_ai_agents/multimodal_ai_agent/mutimodal_agent.pyindex 23b77c1b..d25fd605 100644--- a/starter_ai_agents/multimodal_ai_agent/mutimodal_agent.py+++ b/starter_ai_agents/multimodal_ai_agent/mutimodal_agent.py@@ -1,5 +1,6 @@import streamlit as stfrom agno.agent import Agent+from agno.run.agent import RunOutputfrom agno.models.google import Geminifrom agno.media import Videoimport time@@ -14,15 +15,21 @@ st.set_page_config(st.title("Multimodal AI Agent π§¬")-# Get Gemini API key from user-gemini_api_key = st.text_input("Enter your Gemini API Key", type="password")+# Get Gemini API key from user in sidebar+with st.sidebar:+ st.header("π Configuration")+ gemini_api_key = st.text_input("Enter your Gemini API Key", type="password")+ st.caption(+ "Get your API key from [Google AI Studio]"+ "(https://aistudio.google.com/apikey) π"+ )# Initialize single agent with both capabilities@st.cache_resourcedef initialize_agent(api_key):return Agent(name="Multimodal Analyst",- model=Gemini(id="gemini-2.0-flash", api_key=api_key),+ model=Gemini(id="gemini-2.5-flash", api_key=api_key),markdown=True,)@@ -60,7 +67,7 @@ if gemini_api_key:Provide a comprehensive response focusing on practical, actionable information."""- result = agent.run(prompt, videos=[video])+ result: RunOutput = agent.run(prompt, videos=[video])st.subheader("Result")st.markdown(result.content)diff --git a/starter_ai_agents/multimodal_ai_agent/requirements.txt b/starter_ai_agents/multimodal_ai_agent/requirements.txtindex fad806f6..0be70a43 100644--- a/starter_ai_agents/multimodal_ai_agent/requirements.txt+++ b/starter_ai_agents/multimodal_ai_agent/requirements.txt@@ -1,3 +1,3 @@-agno+agno>=2.2.10google-generativeai==0.8.3streamlit==1.40.2\ No newline at end of file