Replies: 1 comment
-
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: For web deployment, it's recommended to run the agent on a remote server. The OAuth flow is handled on the client-side, and API keys should be managed using environment variables for security. Hello! Here is some information regarding your questions on deploying a streaming agent. Remote Agent Authentication (OAuth)For your first concern, if a remotely deployed agent needs to connect to a service requiring authorization, the OAuth flow is handled on the user's (client) side. The ADK framework is designed to pause the agent's execution and signal your client application to initiate the interactive authentication process. Once the user completes the OAuth flow, the credentials are then passed to the remote agent. This is demonstrated in the "A2A OAuth Authentication Sample Agent" which shows a remote agent surfacing authentication requests to a root agent on the client side [1]. The documentation on "Authenticating with Tools" further explains that for flows requiring user interaction, a specific process is triggered in the Agent Client application [2]. Local Agent API Key InjectionFor your second question, if you are running the agent locally, the recommended and most secure way to handle API keys is by using environment variables. Hardcoding keys directly in the code is discouraged. You can load the API key from a Several quickstart guides and sample code snippets demonstrate this practice, showing how to set the General Deployment RecommendationsWhile running the agent locally is possible, for a production web application, the recommended approach is to deploy the agent to a remote server. This architecture is more scalable and secure. You can run multiple instances of your agent behind a load balancer to handle many users simultaneously. The documentation provides guidance on several deployment options, including:
The "Custom Streaming with WebSockets" documentation also advises deploying multiple instances and using a load balancer for production applications [9]. For a sample implementation using We hope this information helps you in deploying your streaming agent! [1] https://github.com/google/adk-python/blob/main/contributing/samples/a2a_auth/README.md |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
What's the best way to deploy the streaming live agent onto the web? Should the agent run locally on the user's machine, with the API key being injected via some sort of secure backend call, or should the agent be moved to a remote websocket server that can handle incoming/outgoing requests and sessions simultaneously?
Key concerns:
Beta Was this translation helpful? Give feedback.
All reactions