You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Fixed the google search tool name and model name (#226)
* fix: Fixed the google search tool name and model name
- With 0.4.0, the tool name has changed to google_search
- As of today, gemini-2.0-flash-exp is the workable model with Streaming for ADK that is soon to be replaced with gemini-2.0-flash-live-001.
* Formatting
---------
Co-authored-by: Kristopher Overholt <[email protected]>
Co-authored-by: Kristopher Overholt <[email protected]>
Copy file name to clipboardExpand all lines: docs/get-started/quickstart-streaming.md
+16-16Lines changed: 16 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -57,8 +57,8 @@ root_agent = Agent(
57
57
# A unique name for the agent.
58
58
name="basic_search_agent",
59
59
# The Large Language Model (LLM) that agent will use.
60
-
model="gemini-2.0-flash-exp",# Google AI Studio
61
-
#model="gemini-2.0-flash-live-preview-04-09" # Vertex AI Studio
60
+
model="gemini-2.0-flash-exp",
61
+
#model="gemini-2.0-flash-live-001", # New streaming model version as of Feb 2025
62
62
# A short description of the agent's purpose.
63
63
description="Agent to answer questions using Google Search.",
64
64
# Instructions to set the agent's behavior.
@@ -352,12 +352,12 @@ This code creates a real-time chat application using ADK and FastAPI. It sets up
352
352
353
353
Key functionalities:
354
354
355
-
* Loads the Gemini API key.
356
-
* Uses ADK to manage agent sessions and run the \`google\_search\_agent\`.
357
-
*\`start\_agent\_session\` initializes an agent session with a live request queue for real-time communication.
358
-
*\`agent\_to\_client\_messaging\` asynchronously streams the agent's text responses and status updates (turn complete, interrupted) to the connected WebSocket client.
359
-
*\`client\_to\_agent\_messaging\` asynchronously receives text messages from the WebSocket client and sends them as user input to the agent.
360
-
* FastAPI serves a static frontend and handles WebSocket connections at \`/ws/{session\_id}\`.
355
+
* Loads the Gemini API key.
356
+
* Uses ADK to manage agent sessions and run the \`google\_search\_agent\`.
357
+
*\`start\_agent\_session\` initializes an agent session with a live request queue for real-time communication.
358
+
*\`agent\_to\_client\_messaging\` asynchronously streams the agent's text responses and status updates (turn complete, interrupted) to the connected WebSocket client.
359
+
*\`client\_to\_agent\_messaging\` asynchronously receives text messages from the WebSocket client and sends them as user input to the agent.
360
+
* FastAPI serves a static frontend and handles WebSocket connections at \`/ws/{session\_id}\`.
361
361
* When a client connects, it starts an agent session and creates concurrent tasks for bidirectional communication between the client and the agent via WebSockets.
362
362
363
363
Copy-paste the following code block to the `index.html` file.
@@ -472,12 +472,12 @@ Copy-paste the following code block to the `index.html` file.
472
472
473
473
This HTML file sets up a basic webpage with:
474
474
475
-
* A form (\`messageForm\`) with an input field for typing messages and a "Send" button.
476
-
* JavaScript that:
477
-
* Connects to a WebSocket server at \`wss://\[current host\]/ws/\[random session ID\]\`.
478
-
* Enables the "Send" button upon successful connection.
479
-
* Appends received messages from the WebSocket to the \`messages\` div, handling streaming responses and turn completion.
480
-
* Sends the text entered in the input field to the WebSocket server when the form is submitted.
475
+
* A form (\`messageForm\`) with an input field for typing messages and a "Send" button.
476
+
* JavaScript that:
477
+
* Connects to a WebSocket server at \`wss://\[current host\]/ws/\[random session ID\]\`.
478
+
* Enables the "Send" button upon successful connection.
479
+
* Appends received messages from the WebSocket to the \`messages\` div, handling streaming responses and turn completion.
480
+
* Sends the text entered in the input field to the WebSocket server when the form is submitted.
481
481
* Attempts to reconnect if the WebSocket connection closes.
482
482
483
483
## 6\. Interact with Your Streaming app {#4.-interact-with-your-streaming-app}
@@ -502,8 +502,8 @@ Try asking a question `What is Gemini?`. The agent will use Google Search to res
0 commit comments