MCPcopy Create free account
hub / github.com/OpenPipe/OpenPipe / get_httpx_client

Method get_httpx_client

trainer/src/api_client/client.py:214–227  ·  view source on GitHub ↗

Get the underlying httpx.Client, constructing a new one if not previously set

(self)

Source from the content-addressed store, hash-verified

212 return self
213
214 def get_httpx_client(self) -> httpx.Client:
215 """Get the underlying httpx.Client, constructing a new one if not previously set"""
216 if self._client is None:
217 self._headers[self.auth_header_name] = f"{self.prefix} {self.token}" if self.prefix else self.token
218 self._client = httpx.Client(
219 base_url=self._base_url,
220 cookies=self._cookies,
221 headers=self._headers,
222 timeout=self._timeout,
223 verify=self._verify_ssl,
224 follow_redirects=self._follow_redirects,
225 **self._httpx_args,
226 )
227 return self._client
228
229 def __enter__(self) -> "AuthenticatedClient":
230 """Enter a context manager for self.client—you cannot enter twice (see httpx docs)"""

Callers 2

__enter__Method · 0.95
__exit__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected