feat(ai): Enable browser support for OpenAI providers

- Added dangerouslyAllowBrowser: true to OpenAI client initialization
- Allows usage of the library in browser environments
- Applies to both OpenAICompletionsLLM and OpenAIResponsesLLM
This commit is contained in:
Mario Zechner 2025-08-30 22:29:14 +02:00
parent 444580fd2f
commit 2e90f8f8bc
2 changed files with 2 additions and 2 deletions

View file

@ -38,7 +38,7 @@ export class OpenAICompletionsLLM implements LLM<OpenAICompletionsLLMOptions> {
}
apiKey = process.env.OPENAI_API_KEY;
}
this.client = new OpenAI({ apiKey, baseURL: model.baseUrl });
this.client = new OpenAI({ apiKey, baseURL: model.baseUrl, dangerouslyAllowBrowser: true });
this.modelInfo = model;
}

View file

@ -39,7 +39,7 @@ export class OpenAIResponsesLLM implements LLM<OpenAIResponsesLLMOptions> {
}
apiKey = process.env.OPENAI_API_KEY;
}
this.client = new OpenAI({ apiKey, baseURL: model.baseUrl });
this.client = new OpenAI({ apiKey, baseURL: model.baseUrl, dangerouslyAllowBrowser: true });
this.modelInfo = model;
}