MCPcopy Create free account
hub / github.com/google/adk-python / get_request

Function get_request

contributing/samples/adk_team/adk_stale_agent/utils.py:99–120  ·  view source on GitHub ↗

Sends a GET request to the GitHub API with automatic retries. Args: url (str): The URL endpoint. params (Optional[Dict[str, Any]]): Query parameters. Returns: Any: The JSON response parsed into a dict or list. Raises: requests.exceptions.RequestException: If retri

(url: str, params: Optional[Dict[str, Any]] = None)

Source from the content-addressed store, hash-verified

97
98
99def get_request(url: str, params: Optional[Dict[str, Any]] = None) -> Any:
100 """
101 Sends a GET request to the GitHub API with automatic retries.
102
103 Args:
104 url (str): The URL endpoint.
105 params (Optional[Dict[str, Any]]): Query parameters.
106
107 Returns:
108 Any: The JSON response parsed into a dict or list.
109
110 Raises:
111 requests.exceptions.RequestException: If retries are exhausted.
112 """
113 _increment_api_call_count()
114 try:
115 response = _session.get(url, params=params or {}, timeout=60)
116 response.raise_for_status()
117 return response.json()
118 except requests.exceptions.RequestException as e:
119 logger.error(f"GET request failed for {url}: {e}")
120 raise
121
122
123def post_request(url: str, payload: Any) -> Any:

Callers 2

_get_cached_maintainersFunction · 0.90

Calls 5

jsonMethod · 0.80
getMethod · 0.45
raise_for_statusMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected