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

Method __init__

client-libs/python/openpipe/client.py:29–48  ·  view source on GitHub ↗
(
        self,
        api_key: typing.Union[str, None] = None,
        base_url: typing.Union[str, None] = None,
        timeout: typing.Union[float, None] = None,
    )

Source from the content-addressed store, hash-verified

27 base_client: OpenPipeApi
28
29 def __init__(
30 self,
31 api_key: typing.Union[str, None] = None,
32 base_url: typing.Union[str, None] = None,
33 timeout: typing.Union[float, None] = None,
34 ) -> None:
35 self.base_client = OpenPipeApi(
36 token="", base_url=DEFAULT_BASE_URL, timeout=timeout
37 )
38 # set API key
39 if os.environ.get("OPENPIPE_API_KEY"):
40 self.base_client._client_wrapper._token = os.environ["OPENPIPE_API_KEY"]
41 if api_key:
42 self.base_client._client_wrapper._token = api_key
43
44 # set base URL
45 if os.environ.get("OPENPIPE_BASE_URL"):
46 self.base_client._client_wrapper._base_url = os.environ["OPENPIPE_BASE_URL"]
47 if base_url:
48 self.base_client._client_wrapper._base_url = base_url
49
50 @property
51 def api_key(self) -> typing.Union[str, None]:

Callers

nothing calls this directly

Calls 1

OpenPipeApiClass · 0.85

Tested by

no test coverage detected