diff --git a/README.md b/README.md index 68ea241754..1748baac27 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ from google.adk.tools import google_search root_agent = Agent( name="search_assistant", - model="gemini-2.0-flash", + model="gemini-2.0-flash-exp", instruction="You are a helpful assistant. Answer user questions using Google Search when needed.", description="An assistant that can search the web.", tools=[google_search] diff --git a/docs/agents/custom-agents.md b/docs/agents/custom-agents.md index c2a7d35da5..affcef6164 100644 --- a/docs/agents/custom-agents.md +++ b/docs/agents/custom-agents.md @@ -220,7 +220,7 @@ These are standard `LlmAgent` definitions, responsible for specific tasks. Their ```python # agent.py (LLM Agent Definitions part) -GEMINI_FLASH = "gemini-1.5-flash" # Define model constant +GEMINI_FLASH = "gemini-2.0-flash-exp" # Define model constant story_generator = LlmAgent( name="StoryGenerator", model=GEMINI_FLASH, diff --git a/docs/agents/llm-agents.md b/docs/agents/llm-agents.md index 2229312ef6..0d06ebdb44 100644 --- a/docs/agents/llm-agents.md +++ b/docs/agents/llm-agents.md @@ -14,12 +14,12 @@ First, you need to establish what the agent *is* and what it's *for*. * **`description` (Optional, Recommended for Multi-Agent):** Provide a concise summary of the agent's capabilities. This description is primarily used by *other* LLM agents to determine if they should route a task to this agent. Make it specific enough to differentiate it from peers (e.g., "Handles inquiries about current billing statements," not just "Billing agent"). -* **`model` (Required):** Specify the underlying LLM that will power this agent's reasoning. This is a string identifier like `"gemini-2.0-flash-001"`. The choice of model impacts the agent's capabilities, cost, and performance. See the [Models](models.md) page for available options and considerations. +* **`model` (Required):** Specify the underlying LLM that will power this agent's reasoning. This is a string identifier like `"gemini-2.0-flash-exp"`. The choice of model impacts the agent's capabilities, cost, and performance. See the [Models](models.md) page for available options and considerations. ```python # Example: Defining the basic identity capital_agent = LlmAgent( - model="gemini-2.0-flash-001", + model="gemini-2.0-flash-exp", name="capital_agent", description="Answers user questions about the capital city of a given country." # instruction and tools will be added next @@ -46,7 +46,7 @@ The `instruction` parameter is arguably the most critical for shaping an `LlmAge ```python # Example: Adding instructions capital_agent = LlmAgent( - model="gemini-1.5-flash", + model="gemini-2.0-flash-exp", name="capital_agent", description="Answers user questions about the capital city of a given country.", instruction="""You are an agent that provides the capital city of a country. @@ -84,7 +84,7 @@ def get_capital_city(country: str) -> str: # Add the tool to the agent capital_agent = LlmAgent( - model="gemini-1.5-flash", + model="gemini-2.0-flash-exp", name="capital_agent", description="Answers user questions about the capital city of a given country.", instruction="""You are an agent that provides the capital city of a country... (previous instruction text)""", @@ -171,7 +171,7 @@ Here's the complete basic `capital_agent`: ```python # Full example code for the basic capital agent ---8<-- "examples/python/snippets/agents/llm-agent/capital-agent.py" +--8<-- "examples/python/snippets/agents/llm-agent/capital_agent.py" ``` _(This example demonstrates the core concepts. More complex agents might incorporate schemas, context control, planning, etc.)_ diff --git a/docs/agents/models.md b/docs/agents/models.md index d2f013cd1d..0439f2d28d 100644 --- a/docs/agents/models.md +++ b/docs/agents/models.md @@ -56,7 +56,7 @@ from google.adk.agents import LlmAgent # --- Example using a stable Gemini Flash model --- agent_gemini_flash = LlmAgent( # Use the latest stable Flash model identifier - model="gemini-2.0-flash-001", + model="gemini-2.0-flash-exp", name="gemini_flash_agent", instruction="You are a fast and helpful Gemini assistant.", # ... other agent parameters diff --git a/docs/agents/multi-agents.md b/docs/agents/multi-agents.md index 85fa5cb179..ceb31a396c 100644 --- a/docs/agents/multi-agents.md +++ b/docs/agents/multi-agents.md @@ -29,13 +29,13 @@ The foundation for structuring multi-agent systems is the parent-child relations from google.adk.agents import LlmAgent, BaseAgent # Define individual agents -greeter = LlmAgent(name="Greeter", model="gemini-2.0-flash-001") +greeter = LlmAgent(name="Greeter", model="gemini-2.0-flash-exp") task_doer = BaseAgent(name="TaskExecutor") # Custom non-LLM agent # Create parent agent and assign children via sub_agents coordinator = LlmAgent( name="Coordinator", - model="gemini-2.0-flash-001", + model="gemini-2.0-flash-exp", description="I coordinate greetings and tasks.", sub_agents=[ # Assign sub_agents here greeter, @@ -196,7 +196,7 @@ image_tool = AgentTool(agent=image_agent) # Wrap the agent # Parent agent uses the AgentTool artist_agent = LlmAgent( name="Artist", - model="gemini-1.5-flash", + model="gemini-2.0-flash-exp", instruction="Create a prompt and use the ImageGen tool to generate the image.", tools=[image_tool] # Include the AgentTool ) @@ -229,7 +229,7 @@ support_agent = LlmAgent(name="Support", description="Handles technical support coordinator = LlmAgent( name="HelpDeskCoordinator", - model="gemini-1.5-flash", + model="gemini-2.0-flash-exp", instruction="Route user requests: Use Billing agent for payment issues, Support agent for technical problems.", description="Main help desk router.", # allow_transfer=True is often implicit with sub_agents in AutoFlow @@ -317,7 +317,7 @@ summarizer = LlmAgent(name="Summarizer", description="Summarizes text.") # Mid-level agent combining tools research_assistant = LlmAgent( name="ResearchAssistant", - model="gemini-1.5-flash", + model="gemini-2.0-flash-exp", description="Finds and summarizes information on a topic.", tools=[AgentTool(agent=web_searcher), AgentTool(agent=summarizer)] ) @@ -325,7 +325,7 @@ research_assistant = LlmAgent( # High-level agent delegating research report_writer = LlmAgent( name="ReportWriter", - model="gemini-1.5-flash", + model="gemini-2.0-flash-exp", instruction="Write a report on topic X. Use the ResearchAssistant to gather information.", tools=[AgentTool(agent=research_assistant)] # Alternatively, could use LLM Transfer if research_assistant is a sub_agent diff --git a/docs/agents/workflow-agents/loop-agents.md b/docs/agents/workflow-agents/loop-agents.md index 6b6a7e8de8..9b037e23d1 100644 --- a/docs/agents/workflow-agents/loop-agents.md +++ b/docs/agents/workflow-agents/loop-agents.md @@ -42,5 +42,5 @@ In this setup, the `LoopAgent` would manage the iterative process. The `CriticA #### Full code ```py ---8<-- "examples/python/snippets/agents/workflow-agents/loop-agent-doc-improv-agent.py" +--8<-- "examples/python/snippets/agents/workflow-agents/loop_agent_doc_improv_agent.py" ``` diff --git a/docs/callbacks/index.md b/docs/callbacks/index.md index ab84f69633..26f0b94c4b 100644 --- a/docs/callbacks/index.md +++ b/docs/callbacks/index.md @@ -36,7 +36,7 @@ def my_before_model_logic( # --- Register it during Agent creation --- my_agent = LlmAgent( name="MyCallbackAgent", - model="gemini-2.0-flash", # Or your desired model + model="gemini-2.0-flash-exp", # Or your desired model instruction="Be helpful.", # Other agent parameters... before_model_callback=my_before_model_logic # Pass the function here @@ -132,7 +132,7 @@ def block_forbidden_input( # Agent definition using the callback guardrail_agent = LlmAgent( name="GuardrailAgent", - model="gemini-2.0-flash", + model="gemini-2.0-flash-exp", instruction="Answer user questions.", before_model_callback=block_forbidden_input ) diff --git a/docs/get-started/running-the-agent.md b/docs/get-started/running-the-agent.md index 9483eb9c31..9aa877b03d 100644 --- a/docs/get-started/running-the-agent.md +++ b/docs/get-started/running-the-agent.md @@ -125,7 +125,7 @@ from agents.sessions import InMemorySessionService # Step 1: Define your agent: root_agent = Agent(name="my_agent", - model="gemini-2.0-flash", + model="gemini-2.0-flash-exp", instruction="Answer questions.") # Step 2: Initiate Session diff --git a/docs/guides/responsible-agents.md b/docs/guides/responsible-agents.md index fe12a5427c..aa0d81df6a 100644 --- a/docs/guides/responsible-agents.md +++ b/docs/guides/responsible-agents.md @@ -156,7 +156,7 @@ def validate_tool_params( # Hypothetical Agent setup root_agent = LlmAgent( # Use specific agent type - model='gemini-1.5-flash-001', + model='gemini-2.0-flash-exp', name='root_agent', instruction="...", before_tool_callback=validate_tool_params, # Assign the callback diff --git a/docs/runtime/artifacts.md b/docs/runtime/artifacts.md index 07766941f9..39daac39f3 100644 --- a/docs/runtime/artifacts.md +++ b/docs/runtime/artifacts.md @@ -106,7 +106,7 @@ from google.adk.agents import LlmAgent # Any agent from google.adk.sessions import InMemorySessionService # Example: Configuring the Runner with an Artifact Service -my_agent = LlmAgent(name="artifact_user_agent", model="gemini-2.0-flash") +my_agent = LlmAgent(name="artifact_user_agent", model="gemini-2.0-flash-exp") artifact_service = InMemoryArtifactService() # Choose an implementation session_service = InMemorySessionService() @@ -206,7 +206,7 @@ from google.adk.agents import LlmAgent from google.adk.sessions import InMemorySessionService # Your agent definition -agent = LlmAgent(name="my_agent", model="gemini-2.0-flash") +agent = LlmAgent(name="my_agent", model="gemini-2.0-flash-exp") # Instantiate the desired artifact service artifact_service = InMemoryArtifactService() diff --git a/docs/sessions/memory.md b/docs/sessions/memory.md index a3bd894ef4..620338a9e6 100644 --- a/docs/sessions/memory.md +++ b/docs/sessions/memory.md @@ -83,7 +83,7 @@ from google.genai.types import Content, Part # --- Constants --- APP_NAME = "memory_example_app" USER_ID = "mem_user" -MODEL = "gemini-1.5-flash" # Use a valid model +MODEL = "gemini-2.0-flash-exp" # Use a valid model # --- Agent Definitions --- # Agent 1: Simple agent to capture information diff --git a/docs/sessions/state.md b/docs/sessions/state.md index 6b8ae5a0ac..6012def6a0 100644 --- a/docs/sessions/state.md +++ b/docs/sessions/state.md @@ -81,7 +81,7 @@ from google.genai.types import Content, Part # Define agent with output_key greeting_agent = LlmAgent( name="Greeter", - model="gemini-1.5-flash", # Use a valid model + model="gemini-2.0-flash-exp", # Use a valid model instruction="Generate a short, friendly greeting.", output_key="last_greeting" # Save response to state['last_greeting'] ) diff --git a/docs/tools/google-cloud-tools.md b/docs/tools/google-cloud-tools.md index b2d4e58b41..bced94f115 100644 --- a/docs/tools/google-cloud-tools.md +++ b/docs/tools/google-cloud-tools.md @@ -83,7 +83,7 @@ Note: this tutorial includes an agent creation. If you already have an agent, yo from .tools import sample_toolset root_agent = LlmAgent( - model='gemini-2.0-flash', + model='gemini-2.0-flash-exp', name='enterprise_assistant', instruction='Help user, leverage the tools you have access to', tools=sample_toolset.get_tools(),) diff --git a/docs/tools/mcp-tools.md b/docs/tools/mcp-tools.md index 08d78fe48f..e5c9acc481 100644 --- a/docs/tools/mcp-tools.md +++ b/docs/tools/mcp-tools.md @@ -234,7 +234,7 @@ async def get_agent_async(): tools, exit_stack = await get_tools_async() print(f"Fetched {len(tools)} tools from MCP server.") root_agent = LlmAgent( - model='gemini-1.5-flash', # Adjust if needed + model='gemini-2.0-flash-exp', # Adjust if needed name='maps_assistant', instruction='Help user with mapping and directions using available tools.', tools=tools, diff --git a/docs/tools/openapi-tools.md b/docs/tools/openapi-tools.md index 71edc50f7a..88950a9bfe 100644 --- a/docs/tools/openapi-tools.md +++ b/docs/tools/openapi-tools.md @@ -70,7 +70,7 @@ Follow these steps to integrate an OpenAPI spec into your agent: my_agent = LlmAgent( name="api_interacting_agent", - model="gemini-2.0-flash-001", # Or your preferred model + model="gemini-2.0-flash-exp", # Or your preferred model tools=api_tools, # Pass the list of generated tools # ... other agent config ... ) diff --git a/docs/tools/third-party-tools.md b/docs/tools/third-party-tools.md index e69ec904fb..7c3aa50447 100644 --- a/docs/tools/third-party-tools.md +++ b/docs/tools/third-party-tools.md @@ -55,7 +55,7 @@ ADK provides the `LangchainTool` wrapper to integrate tools from the LangChain e # Define the ADK agent, including the wrapped tool my_agent = Agent( name="langchain_tool_agent", - model="gemini-2.0-flash", + model="gemini-2.0-flash-exp", description="Agent to answer questions using TavilySearch.", instruction="I can answer your questions by searching the internet. Just ask me anything!", tools=[adk_tavily_tool] # Add the wrapped tool here @@ -125,7 +125,7 @@ ADK provides the `CrewaiTool` wrapper to integrate tools from the CrewAI library # Define the ADK agent my_agent = Agent( name="crewai_search_agent", - model="gemini-2.0-flash", + model="gemini-2.0-flash-exp", description="Agent to find recent news using the Serper search tool.", instruction="I can find the latest news for you. What topic are you interested in?", tools=[adk_serper_tool] # Add the wrapped tool here diff --git a/examples/python/snippets/agents/custom-agent/storyflow-agent.py b/examples/python/snippets/agents/custom-agent/storyflow-agent.py index d6452eebc1..0cbceddad1 100644 --- a/examples/python/snippets/agents/custom-agent/storyflow-agent.py +++ b/examples/python/snippets/agents/custom-agent/storyflow-agent.py @@ -2,7 +2,7 @@ from typing import AsyncGenerator from typing_extensions import override -from google.adk.agents import Agent, LlmAgent, BaseAgent, LoopAgent, SequentialAgent +from google.adk.agents import LlmAgent, BaseAgent, LoopAgent, SequentialAgent from google.adk.agents.invocation_context import InvocationContext from google.genai import types from google.adk.sessions import InMemorySessionService @@ -14,7 +14,7 @@ APP_NAME = "story_app" USER_ID = "12345" SESSION_ID = "123344" -GEMINI_2_FLASH = "gemini-2.0-flash-001" +GEMINI_2_FLASH = "gemini-2.0-flash-exp" # --- Configure Logging --- logging.basicConfig(level=logging.INFO) @@ -240,7 +240,9 @@ def call_agent(user_input_topic: str): Sends a new topic to the agent (overwriting the initial one if needed) and runs the workflow. """ - current_session = session_service.get_session(APP_NAME, USER_ID, SESSION_ID) + current_session = session_service.get_session(app_name=APP_NAME, + user_id=USER_ID, + session_id=SESSION_ID) if not current_session: logger.error("Session not found!") return @@ -260,7 +262,9 @@ def call_agent(user_input_topic: str): print("\n--- Agent Interaction Result ---") print("Agent Final Response: ", final_response) - final_session = session_service.get_session(APP_NAME, USER_ID, SESSION_ID) + final_session = session_service.get_session(app_name=APP_NAME, + user_id=USER_ID, + session_id=SESSION_ID) print("Final Session State:") import json print(json.dumps(final_session.state, indent=2)) diff --git a/examples/python/snippets/agents/llm-agent/capital-agent.py b/examples/python/snippets/agents/llm-agent/capital_agent.py similarity index 96% rename from examples/python/snippets/agents/llm-agent/capital-agent.py rename to examples/python/snippets/agents/llm-agent/capital_agent.py index 17f8a2ed16..a90ed8090d 100644 --- a/examples/python/snippets/agents/llm-agent/capital-agent.py +++ b/examples/python/snippets/agents/llm-agent/capital_agent.py @@ -1,5 +1,4 @@ # --- Full example code demonstrating LlmAgent with Tools vs. Output Schema --- -import asyncio import json # Needed for pretty printing dicts from google.adk.agents import LlmAgent @@ -13,7 +12,7 @@ USER_ID = "test_user_456" SESSION_ID_TOOL_AGENT = "session_tool_agent_xyz" SESSION_ID_SCHEMA_AGENT = "session_schema_agent_xyz" -MODEL_NAME = "gemini-2.0-flash-001" +MODEL_NAME = "gemini-2.0-flash-exp" # --- 2. Define Schemas --- @@ -117,7 +116,9 @@ async def call_agent_and_print( print(f"<<< Agent '{agent_instance.name}' Response: {final_response_content}") - current_session = session_service.get_session(APP_NAME, USER_ID, session_id) + current_session = session_service.get_session(app_name=APP_NAME, + user_id=USER_ID, + session_id=session_id) stored_output = current_session.state.get(agent_instance.output_key) # Pretty print if the stored output looks like JSON (likely from output_schema) diff --git a/examples/python/snippets/agents/workflow-agents/loop-agent-doc-improv-agent.py b/examples/python/snippets/agents/workflow-agents/loop_agent_doc_improv_agent.py similarity index 84% rename from examples/python/snippets/agents/workflow-agents/loop-agent-doc-improv-agent.py rename to examples/python/snippets/agents/workflow-agents/loop_agent_doc_improv_agent.py index 2b1a2edc77..c88bc4948c 100644 --- a/examples/python/snippets/agents/workflow-agents/loop-agent-doc-improv-agent.py +++ b/examples/python/snippets/agents/workflow-agents/loop_agent_doc_improv_agent.py @@ -8,7 +8,7 @@ APP_NAME = "doc_writing_app" USER_ID = "dev_user_01" SESSION_ID = "session_01" -GEMINI_MODEL = "gemini-2.0-flash-001" +GEMINI_MODEL = "gemini-2.0-flash-exp" # --- State Keys --- STATE_INITIAL_TOPIC = "quantum physics" @@ -55,12 +55,12 @@ # Agent Interaction def call_agent(query): - content = types.Content(role='user', parts=[types.Part(text=query)]) - events = runner.run(user_id=USER_ID, session_id=SESSION_ID, new_message=content) + content = types.Content(role='user', parts=[types.Part(text=query)]) + events = runner.run(user_id=USER_ID, session_id=SESSION_ID, new_message=content) - for event in events: - if event.is_final_response(): - final_response = event.content.parts[0].text - print("Agent Response: ", final_response) + for event in events: + if event.is_final_response(): + final_response = event.content.parts[0].text + print("Agent Response: ", final_response) -call_agent("execute") \ No newline at end of file +call_agent("execute") diff --git a/examples/python/snippets/agents/workflow-agents/parallel_agent_web_research.py b/examples/python/snippets/agents/workflow-agents/parallel_agent_web_research.py index c1461f7edb..f63651db76 100644 --- a/examples/python/snippets/agents/workflow-agents/parallel_agent_web_research.py +++ b/examples/python/snippets/agents/workflow-agents/parallel_agent_web_research.py @@ -8,7 +8,7 @@ APP_NAME = "parallel_research_app" USER_ID = "research_user_01" SESSION_ID = "parallel_research_session" -GEMINI_MODEL = "gemini-2.0-flash-001" +GEMINI_MODEL = "gemini-2.0-flash-exp" # --- Define Researcher Sub-Agents --- diff --git a/examples/python/snippets/agents/workflow-agents/sequential-agent-code-development-agent.py b/examples/python/snippets/agents/workflow-agents/sequential_agent_code_development_agent.py similarity index 88% rename from examples/python/snippets/agents/workflow-agents/sequential-agent-code-development-agent.py rename to examples/python/snippets/agents/workflow-agents/sequential_agent_code_development_agent.py index f99fa28fa8..b881cc03b8 100644 --- a/examples/python/snippets/agents/workflow-agents/sequential-agent-code-development-agent.py +++ b/examples/python/snippets/agents/workflow-agents/sequential_agent_code_development_agent.py @@ -8,7 +8,7 @@ APP_NAME = "code_pipeline_app" USER_ID = "dev_user_01" SESSION_ID = "pipeline_session_01" -GEMINI_MODEL = "gemini-2.0-flash-001" +GEMINI_MODEL = "gemini-2.0-flash-exp" # --- 1. Define Sub-Agents for Each Pipeline Stage --- @@ -77,12 +77,12 @@ # Agent Interaction def call_agent(query): - content = types.Content(role='user', parts=[types.Part(text=query)]) - events = runner.run(user_id=USER_ID, session_id=SESSION_ID, new_message=content) + content = types.Content(role='user', parts=[types.Part(text=query)]) + events = runner.run(user_id=USER_ID, session_id=SESSION_ID, new_message=content) - for event in events: - if event.is_final_response(): - final_response = event.content.parts[0].text - print("Agent Response: ", final_response) + for event in events: + if event.is_final_response(): + final_response = event.content.parts[0].text + print("Agent Response: ", final_response) -call_agent("perform math addition") \ No newline at end of file +call_agent("perform math addition") diff --git a/examples/python/snippets/get-started/google_search_agent/agent.py b/examples/python/snippets/get-started/google_search_agent/agent.py index f7703494d7..241f521486 100644 --- a/examples/python/snippets/get-started/google_search_agent/agent.py +++ b/examples/python/snippets/get-started/google_search_agent/agent.py @@ -5,7 +5,7 @@ # A unique name for the agent. name="basic_search_agent", # The Large Language Model (LLM) that agent will use. - model="gemini-2.0-flash", + model="gemini-2.0-flash-exp", # A short description of the agent's purpose. description="Agent to answer questions using Google Search.", # Instructions to set the agent's behavior. diff --git a/examples/python/snippets/get-started/multi_tool_agent/agent.py b/examples/python/snippets/get-started/multi_tool_agent/agent.py index 91f2f2d32b..f6d61e7ea2 100644 --- a/examples/python/snippets/get-started/multi_tool_agent/agent.py +++ b/examples/python/snippets/get-started/multi_tool_agent/agent.py @@ -57,7 +57,7 @@ def get_current_time(city: str) -> dict: root_agent = Agent( name="weather_time_agent", - model="gemini-2.0-flash", + model="gemini-2.0-flash-exp", description=( "Agent to answer questions about the time and weather in a city." ), diff --git a/examples/python/snippets/tools/built-in-tools/code-execution.py b/examples/python/snippets/tools/built-in-tools/code-execution.py index 4d25f1e316..ac5c2637ce 100644 --- a/examples/python/snippets/tools/built-in-tools/code-execution.py +++ b/examples/python/snippets/tools/built-in-tools/code-execution.py @@ -9,7 +9,7 @@ APP_NAME="calculator" USER_ID="user1234" SESSION_ID="session_code_exec_async" -GEMINI_MODEL = "gemini-2.0-flash-001" +GEMINI_MODEL = "gemini-2.0-flash-exp" # Agent Definition code_agent = LlmAgent( diff --git a/examples/python/snippets/tools/built-in-tools/google-search.py b/examples/python/snippets/tools/built-in-tools/google-search.py index 0e841fd4a7..5a491ebec9 100644 --- a/examples/python/snippets/tools/built-in-tools/google-search.py +++ b/examples/python/snippets/tools/built-in-tools/google-search.py @@ -11,7 +11,7 @@ root_agent = Agent( name="basic_search_agent", - model="gemini-2.0-flash-001", + model="gemini-2.0-flash-exp", description="Agent to answer questions using Google Search.", instruction="I can answer your questions by searching the internet. Just ask me anything!", # google_search is a pre-built tool which allows the agent to perform Google searches. diff --git a/examples/python/snippets/tools/built-in-tools/vertexai-search.py b/examples/python/snippets/tools/built-in-tools/vertexai-search.py index 64bebd487f..6e33918963 100644 --- a/examples/python/snippets/tools/built-in-tools/vertexai-search.py +++ b/examples/python/snippets/tools/built-in-tools/vertexai-search.py @@ -16,7 +16,7 @@ USER_ID_VSEARCH = "user_vsearch_1" SESSION_ID_VSEARCH = "session_vsearch_1" AGENT_NAME_VSEARCH = "doc_qa_agent" -GEMINI_2_FLASH = "gemini-2.0-flash-001" +GEMINI_2_FLASH = "gemini-2.0-flash-exp" # Tool Instantiation # You MUST provide your datastore ID here. diff --git a/examples/python/snippets/tools/function-tools/file-processor.py b/examples/python/snippets/tools/function-tools/file-processor.py index d5e9525e46..36a78a587d 100644 --- a/examples/python/snippets/tools/function-tools/file-processor.py +++ b/examples/python/snippets/tools/function-tools/file-processor.py @@ -40,7 +40,7 @@ def process_large_file(file_path: str) -> dict: # 3. Use the tool in an Agent file_processor_agent = Agent( # Use a model compatible with function calling - model="gemini-2.0-flash", + model="gemini-2.0-flash-exp", name='file_processor_agent', instruction="""You are an agent that processes large files. When the user provides a file path, use the 'process_large_file' tool. Keep the user informed about the progress based on the tool's updates (which arrive as function responses). Only provide the final result when the tool indicates completion in its final function response.""", tools=[long_running_tool] diff --git a/examples/python/snippets/tools/function-tools/func-tool.py b/examples/python/snippets/tools/function-tools/func-tool.py index 04f8bd4d3f..15dd8fa310 100644 --- a/examples/python/snippets/tools/function-tools/func-tool.py +++ b/examples/python/snippets/tools/function-tools/func-tool.py @@ -34,7 +34,7 @@ def get_stock_price(symbol: str): stock_price_agent = Agent( - model='gemini-2.0-flash', + model='gemini-2.0-flash-exp', name='stock_agent', instruction= 'You are an agent to retrieve stock prices. If a ticker symbol is provided, fetch the current price. If only a company name is given, first perform a Google search to find the correct ticker symbol before retrieving the stock price.If the provided ticker symbol is invalid or data cannot be retrieved, inform the user that the stock price could not be found.', description='You specialize in retrieving real-time stock prices. Given a stock ticker symbol (e.g., AAPL, GOOG, MSFT) or the stock name, use the tools and reliable data sources to provide the most up-to-date price.', diff --git a/examples/python/snippets/tools/function-tools/summarizer.py b/examples/python/snippets/tools/function-tools/summarizer.py index 09cf01ffd3..278de5a917 100644 --- a/examples/python/snippets/tools/function-tools/summarizer.py +++ b/examples/python/snippets/tools/function-tools/summarizer.py @@ -9,14 +9,14 @@ SESSION_ID="1234" summary_agent = Agent( - model="gemini-2.0-flash", + model="gemini-2.0-flash-exp", name="summary_agent", instruction="""You are an expert summarizer. Please read the following text and provide a concise summary.""", description="Agent to summarize text", ) root_agent = Agent( - model='gemini-2.0-flash', + model='gemini-2.0-flash-exp', name='root_agent', instruction="""You are a helpful assistant. When the user provides a long text, use the 'summarize' tool to get a summary and then present it to the user.""", tools=[AgentTool(agent=summary_agent)] diff --git a/examples/python/snippets/tools/openapi-tool.py b/examples/python/snippets/tools/openapi-tool.py index a4f0fc1891..b1cafd53c9 100644 --- a/examples/python/snippets/tools/openapi-tool.py +++ b/examples/python/snippets/tools/openapi-tool.py @@ -14,7 +14,7 @@ USER_ID_OPENAPI = "user_openapi_1" SESSION_ID_OPENAPI = f"session_openapi_{uuid.uuid4()}" # Unique session ID AGENT_NAME_OPENAPI = "petstore_manager_agent" -GEMINI_MODEL = "gemini-2.0-flash-001" +GEMINI_MODEL = "gemini-2.0-flash-exp" # --- Sample OpenAPI Specification (JSON String) --- # A basic Pet Store API example using httpbin.org as a mock server diff --git a/examples/python/snippets/tools/overview/customer-support-agent.py b/examples/python/snippets/tools/overview/customer-support-agent.py index 37a070de29..451c24e457 100644 --- a/examples/python/snippets/tools/overview/customer-support-agent.py +++ b/examples/python/snippets/tools/overview/customer-support-agent.py @@ -22,14 +22,14 @@ def check_and_transfer(query: str, tool_context: ToolContext) -> str: escalation_tool = FunctionTool(func=check_and_transfer) main_agent = Agent( - model='gemini-2.0-flash', + model='gemini-2.0-flash-exp', name='main_agent', instruction="""You are the first point of contact for customer support of an analytics tool. Answer general queries. If the user indicates urgency, use the 'check_and_transfer' tool.""", tools=[check_and_transfer] ) support_agent = Agent( - model='gemini-2.0-flash', + model='gemini-2.0-flash-exp', name='support_agent', instruction="""You are the dedicated support agent. Mentioned you are a support handler and please help the user with their urgent issue.""" ) diff --git a/examples/python/snippets/tools/overview/weather-sentiment.py b/examples/python/snippets/tools/overview/weather-sentiment.py index 3828cd642e..4ba4f4fdfd 100644 --- a/examples/python/snippets/tools/overview/weather-sentiment.py +++ b/examples/python/snippets/tools/overview/weather-sentiment.py @@ -7,7 +7,7 @@ APP_NAME="weather_sentiment_agent" USER_ID="user1234" SESSION_ID="1234" -MODEL_ID="gemini-2.0-flash" +MODEL_ID="gemini-2.0-flash-exp" # Tool 1 def get_weather_report(city: str) -> dict: diff --git a/examples/python/snippets/tools/third-party/crewai-serper-search.py b/examples/python/snippets/tools/third-party/crewai-serper-search.py index f77a81ad85..636c994d8b 100644 --- a/examples/python/snippets/tools/third-party/crewai-serper-search.py +++ b/examples/python/snippets/tools/third-party/crewai-serper-search.py @@ -28,7 +28,7 @@ serper_agent = Agent( name="basic_search_agent", - model="gemini-2.0-flash", + model="gemini-2.0-flash-exp", description="Agent to answer questions using Google Search.", instruction="I can answer your questions by searching the internet. Just ask me anything!", # Add the Serper tool diff --git a/examples/python/snippets/tools/third-party/langchain-tavily-search.py b/examples/python/snippets/tools/third-party/langchain-tavily-search.py index 89cc8eb570..67e8add8b4 100644 --- a/examples/python/snippets/tools/third-party/langchain-tavily-search.py +++ b/examples/python/snippets/tools/third-party/langchain-tavily-search.py @@ -28,7 +28,7 @@ # Define Agent with the wrapped tool my_agent = Agent( name="langchain_tool_agent", - model="gemini-2.0-flash", + model="gemini-2.0-flash-exp", description="Agent to answer questions using TavilySearch.", instruction="I can answer your questions by searching the internet. Just ask me anything!", tools=[adk_tavily_tool] # Add the wrapped tool here