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

Method _prepare_url

src/opencode_ai/_base_client.py:457–468  ·  view source on GitHub ↗

Merge a URL argument together with any 'base_url' on the client, to create the URL used for the outgoing request.

(self, url: str)

Source from the content-addressed store, hash-verified

455 return headers
456
457 def _prepare_url(self, url: str) -> URL:
458 """
459 Merge a URL argument together with any 'base_url' on the client,
460 to create the URL used for the outgoing request.
461 """
462 # Copied from httpx's `_merge_url` method.
463 merge_url = URL(url)
464 if merge_url.is_relative_url:
465 merge_raw_path = self.base_url.raw_path + merge_url.raw_path.lstrip(b"/")
466 return self.base_url.copy_with(raw_path=merge_raw_path)
467
468 return merge_url
469
470 def _make_sse_decoder(self) -> SSEDecoder | SSEBytesDecoder:
471 return SSEDecoder()

Callers 1

_build_requestMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected