Skip to content

Commit

Permalink
chore: Update OpenAI and Anthropic clients with baseURL option
Browse files Browse the repository at this point in the history
  • Loading branch information
abubakarsohail committed Jun 6, 2024
1 parent bb59256 commit 9a057c1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -644,7 +644,9 @@ const openaiRequest = async (
kwargs: any
) => {
const OpenAI = require("openai").default;
const client = new OpenAI();
const client = new OpenAI({
baseURL: kwargs.baseURL,
});
const requestToMake =
MAP_TYPE_TO_OPENAI_FUNCTION[promptBlueprint.prompt_template.type];
return requestToMake(client, kwargs);
Expand All @@ -671,7 +673,9 @@ const anthropicRequest = async (
kwargs: any
) => {
const Anthropic = require("@anthropic-ai/sdk").default;
const client = new Anthropic();
const client = new Anthropic({
baseURL: kwargs.baseURL,
});
const requestToMake =
MAP_TYPE_TO_ANTHROPIC_FUNCTION[promptBlueprint.prompt_template.type];
return requestToMake(client, kwargs);
Expand Down

0 comments on commit 9a057c1

Please sign in to comment.