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

Function configure_openpipe_clients

client-libs/python/openpipe/shared.py:10–30  ·  view source on GitHub ↗
(
    reporting_client: Union[OpenPipe, AsyncOpenPipe],
    completions_client: Union[OpenAI, AsyncOpenAI],
    openpipe_options={},
)

Source from the content-addressed store, hash-verified

8
9
10def configure_openpipe_clients(
11 reporting_client: Union[OpenPipe, AsyncOpenPipe],
12 completions_client: Union[OpenAI, AsyncOpenAI],
13 openpipe_options={},
14):
15 completions_client.base_url = "https://app.openpipe.ai/api/v1"
16 if os.environ.get("OPENPIPE_API_KEY"):
17 reporting_client.api_key = os.environ["OPENPIPE_API_KEY"]
18 completions_client.api_key = os.environ["OPENPIPE_API_KEY"]
19
20 if os.environ.get("OPENPIPE_BASE_URL"):
21 reporting_client.base_url = os.environ["OPENPIPE_BASE_URL"]
22 completions_client.base_url = os.environ["OPENPIPE_BASE_URL"]
23
24 if openpipe_options and openpipe_options.get("api_key"):
25 reporting_client.api_key = openpipe_options["api_key"]
26 completions_client.api_key = openpipe_options["api_key"]
27
28 if openpipe_options and openpipe_options.get("base_url"):
29 reporting_client.base_url = openpipe_options["base_url"]
30 completions_client.base_url = openpipe_options["base_url"]
31
32
33def get_extra_headers(create_kwargs, openpipe_options):

Callers 2

__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected