MCPcopy Create free account
hub / github.com/anomalyco/opencode-sdk-python / platform_headers

Method platform_headers

src/opencode_ai/_base_client.py:684–688  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

682 self._base_url = self._enforce_trailing_slash(url if isinstance(url, URL) else URL(url))
683
684 def platform_headers(self) -> Dict[str, str]:
685 # the actual implementation is in a separate `lru_cache` decorated
686 # function because adding `lru_cache` to methods will leak memory
687 # https://github.com/python/cpython/issues/88476
688 return platform_headers(self._version, platform=self._platform)
689
690 def _parse_retry_after_header(self, response_headers: Optional[httpx.Headers] = None) -> float | None:
691 """Returns a float of the number of seconds (not milliseconds) to wait after retrying, or None if unspecified.

Callers 1

default_headersMethod · 0.95

Calls 1

platform_headersFunction · 0.85

Tested by

no test coverage detected