MCPcopy
hub / github.com/openai/openai-python / _normalize_base_url

Function _normalize_base_url

src/openai/providers/bedrock.py:36–43  ·  view source on GitHub ↗
(base_url: str | httpx.URL)

Source from the content-addressed store, hash-verified

34
35
36def _normalize_base_url(base_url: str | httpx.URL) -> httpx.URL:
37 url = httpx.URL(base_url)
38 path = url.path.rstrip("/")
39 responses_match = re.search(r"/responses(?:/.*)?$", path)
40 if responses_match is not None:
41 path = path[: responses_match.start()]
42
43 return url.copy_with(path=path or "/")
44
45
46def _same_origin(left: httpx.URL, right: httpx.URL) -> bool:

Callers 2

configureMethod · 0.85
bedrockFunction · 0.85

Calls 2

startMethod · 0.80
searchMethod · 0.45

Tested by

no test coverage detected