Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ def _prepare_request_params(
Example:
self._prepare_request_params({"input_id": "test-id"})
"""

method = self.endpoint.method.lower()
if not method:
raise ValueError("Operation method not found.")
Expand All @@ -254,6 +255,12 @@ def _prepare_request_params(
header_params: Dict[str, Any] = {}
cookie_params: Dict[str, Any] = {}

from ....version import __version__ as adk_version

# Set the custom User-Agent header
user_agent = f"google-adk/{adk_version} (tool: {self.name})"
header_params["User-Agent"] = user_agent

params_map: Dict[str, ApiParameter] = {p.py_name: p for p in parameters}

# Fill in path, query, header and cookie parameters to the request
Expand Down