Skip to content

Commit

Permalink
Update openai.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
kyouheicf authored Feb 13, 2024
1 parent 29a78b7 commit 3c8ffd9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@ function getClient(
apiAuth: string,
basePath: string
) {
const configuration = new Configuration({
let configuration = new Configuration({
...((apiType === "openai" ||
(apiType === "custom" && apiAuth === "bearer-token")) && {
apiKey: apiKey,
}),
...(apiType === "custom" && { basePath: basePath }),
});
delete configuration.baseOptions.headers['User-Agent'];
return new OpenAIApi(configuration);
}

Expand Down

0 comments on commit 3c8ffd9

Please sign in to comment.