fix: request config

This commit is contained in:
archer
2023-04-28 16:47:55 +08:00
parent 56b3ddc147
commit cd9acab938
12 changed files with 22 additions and 20 deletions

View File

@@ -85,7 +85,7 @@ export const openaiCreateEmbedding = async ({
},
{
timeout: 60000,
...axiosConfig
...axiosConfig()
}
)
.then((res) => ({

View File

@@ -85,12 +85,12 @@ export const authOpenApiKey = async (req: NextApiRequest) => {
};
/* openai axios config */
export const axiosConfig = {
export const axiosConfig = () => ({
httpsAgent: global.httpsAgent,
headers: {
auth: process.env.OPENAI_BASE_URL_AUTH || ''
}
};
});
/* delete invalid symbol */
const simplifyStr = (str: string) =>