mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-01 20:27:45 +00:00
perf: 专线代理配置
This commit is contained in:
@@ -85,7 +85,7 @@ export const openaiCreateEmbedding = async ({
|
||||
},
|
||||
{
|
||||
timeout: 60000,
|
||||
httpsAgent
|
||||
httpsAgent: httpsAgent(isPay)
|
||||
}
|
||||
)
|
||||
.then((res) => ({
|
||||
|
@@ -83,15 +83,8 @@ export const authOpenApiKey = async (req: NextApiRequest) => {
|
||||
};
|
||||
|
||||
/* 代理 */
|
||||
export const httpsAgent =
|
||||
process.env.AXIOS_PROXY_HOST && process.env.AXIOS_PROXY_PORT
|
||||
? tunnel.httpsOverHttp({
|
||||
proxy: {
|
||||
host: process.env.AXIOS_PROXY_HOST,
|
||||
port: +process.env.AXIOS_PROXY_PORT
|
||||
}
|
||||
})
|
||||
: undefined;
|
||||
export const httpsAgent = (fast: boolean) =>
|
||||
fast ? global.httpsAgentFast : global.httpsAgentNormal;
|
||||
|
||||
/* tokens 截断 */
|
||||
export const openaiChatFilter = (prompts: ChatItemType[], maxTokens: number) => {
|
||||
|
Reference in New Issue
Block a user