Add a python client library

We still don't have any documentation and things are in flux, but you can report your OpenAI API calls to OpenPipe now.
This commit is contained in:
Kyle Corbitt
2023-08-11 16:54:50 -07:00
parent d9db6d80ea
commit 8ed47eb4dd
32 changed files with 2698 additions and 85 deletions

View File

@@ -16,8 +16,7 @@ export class OpenAI extends openai.OpenAI {
constructor({
openPipeApiKey = readEnv("OPENPIPE_API_KEY"),
openPipeBaseUrl = readEnv("OPENPIPE_BASE_URL") ??
`https://app.openpipe.ai/v1`,
openPipeBaseUrl = readEnv("OPENPIPE_BASE_URL") ?? `https://app.openpipe.ai/v1`,
...opts
}: ClientOptions = {}) {
super({ ...opts });
@@ -26,7 +25,7 @@ export class OpenAI extends openai.OpenAI {
const axiosInstance = axios.create({
baseURL: openPipeBaseUrl,
headers: {
"x-openpipe-api-key": openPipeApiKey,
Authorization: `Bearer ${openPipeApiKey}`,
},
});
this.openPipeApi = new openPipeClient.DefaultApi(