feat: openai base url

This commit is contained in:
archer
2023-04-25 20:02:35 +08:00
parent ce68791c3c
commit fb08f61eb5
21 changed files with 47 additions and 385 deletions

View File

@@ -8,7 +8,8 @@ import mongoose from 'mongoose';
export const getOpenAIApi = (apiKey: string) => {
const configuration = new Configuration({
apiKey
apiKey,
basePath: process.env.OPENAI_BASE_URL || 'https://api.openai.com/v1'
});
return new OpenAIApi(configuration, undefined);