Commit a21b2ccd by archer

fix: 反向代理

parent 8767c576
......@@ -12,7 +12,7 @@ export const getOpenAIApi = (apiKey: string) => {
basePath: process.env.OPENAI_BASE_URL || 'https://api.openai.com/v1'
});
return new OpenAIApi(configuration, undefined);
return new OpenAIApi(configuration);
};
// 模型使用权校验
......
......@@ -123,9 +123,9 @@ export const gpt35StreamResponse = ({
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('X-Accel-Buffering', 'no');
res.setHeader('Cache-Control', 'no-cache, no-transform');
stream.pipe(res);
let responseContent = '';
stream.pipe(res);
const onParse = async (event: ParsedEvent | ReconnectInterval) => {
if (event.type !== 'event') return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment