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

Function patch_request

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

Sends a PATCH request to the GitHub API with automatic retries. Args: url (str): The URL endpoint. payload (Any): The JSON payload. Returns: Any: The JSON response.

(url: str, payload: Any)

Source from the content-addressed store, hash-verified

142
143
144def patch_request(url: str, payload: Any) -> Any:
145 """
146 Sends a PATCH request to the GitHub API with automatic retries.
147
148 Args:
149 url (str): The URL endpoint.
150 payload (Any): The JSON payload.
151
152 Returns:
153 Any: The JSON response.
154 """
155 _increment_api_call_count()
156 try:
157 response = _session.patch(url, json=payload, timeout=60)
158 response.raise_for_status()
159 return response.json()
160 except requests.exceptions.RequestException as e:
161 logger.error(f"PATCH request failed for {url}: {e}")
162 raise
163
164
165def delete_request(url: str) -> Any:

Callers 1

close_as_staleFunction · 0.90

Calls 5

patchMethod · 0.80
jsonMethod · 0.80
raise_for_statusMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected