Skip to content

Commit

Permalink
fix: error if openai baseURL is not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
darwintree authored Nov 21, 2024
1 parent 961816a commit 776de16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1035,7 +1035,8 @@ async function handleOpenAI({
mode,
modelOptions,
}: ProviderOptions): Promise<GenerateObjectResult<unknown>> {
const openai = createOpenAI({ apiKey, baseURL: models.openai.endpoint });
const baseURL = models.openai.endpoint || undefined
const openai = createOpenAI({ apiKey, baseURL });
return await aiGenerateObject({
model: openai.languageModel(model),
schema,
Expand Down

0 comments on commit 776de16

Please sign in to comment.