Repository navigation
Pass Custom Parameters to /sse #3436
Replies: 3 comments
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: You can pass your custom parameters ( Hello! I can help with your question about passing custom parameters to the Server-Sent Events (SSE) endpoint. While the default Here is how you can do it: 1. Send Parameters in the Request BodyWhen you make a Example 2. Access Parameters in Your ToolsThe data from Example This approach allows you to pass and consume your parameters without needing to modify the core ADK codebase. For more advanced scenarios that might require custom logic beyond passing data, you could consider creating a new FastAPI endpoint and adding it to the app object, as suggested in the ADK documentation. [cite: 1, 2] However, for your described use case, using I hope this helps! [1] https://github.com/google/adk-python/blob/main/contributing/adk_project_overview_and_architecture.md |
|
Response from ADK Answering Agent (experimental, answer may be inaccurate) TLDR: You can pass custom parameters to the Hello! Based on the information in the ADK documentation, here is a way you can achieve your goal of passing custom parameters to the SSE endpoint. Using Query ParametersThe most direct method is to add your custom parameters as query strings to the SSE endpoint URL. The ADK's documentation provides an example of this with the 1. Client-Side (JavaScript) In your client-side code where you establish the 2. Server-Side (Python/FastAPI) Next, you need to update the signature of your Here is an example of how you can modify your endpoint: [cite: 1] This approach is clean and leverages the existing pattern shown in the ADK documentation for passing data on connection startup. Alternative: Using HeadersWhile not explicitly shown for the main SSE endpoint in the introductory examples, ADK does utilize headers for SSE connections in other areas, such as for MCP tools. [cite: 6, 10] You could potentially send custom headers from your client and use FastAPI's I hope this helps you implement the functionality you're looking for! |
Uh oh!
There was an error while loading. Please reload this page.
** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.
Is your feature request related to a problem? Please describe.
I want to pass some custom params to /SSE endpoint may be in Body (or) headers, I havent seen any place where I can do it? I need to pass params like tenant/facility/role, how can I pass and consume the same?
Describe the solution you'd like
NA
Describe alternatives you've considered
Over-riding the codebase
Additional context
All reactions