FoloUp icon indicating copy to clipboard operation
FoloUp copied to clipboard

不能生成题库

Open waylandGss opened this issue 1 year ago • 2 comments

Image

waylandGss avatar Feb 19 '25 09:02 waylandGss

If you have a custom OpenAI base URL (e.g., for using Azure OpenAI or a self-hosted instance), you need to specify it in the OpenAI client initialization. You can do this by adding the baseURL parameter like this:

const openai = new OpenAI({
  apiKey: process.env.OPENAI_API_KEY,
  baseURL: process.env.OPENAI_BASE_URL, // Add your custom base URL here
  maxRetries: 5,
  dangerouslyAllowBrowser: true,
});

Make sure your .env file or environment variables include:

OPENAI_API_KEY=your-api-key
OPENAI_BASE_URL=https://your-custom-openai-endpoint

This ensures that all requests are sent to your specified base URL instead of the default OpenAI API endpoint.

PanLu09 avatar Feb 21 '25 06:02 PanLu09

I get the same problem and don't set a custom OpenAI base URL.

I checked my OpenAI secret key. It shows never used.

ConquerBJ avatar Mar 24 '25 14:03 ConquerBJ