mirror of
https://github.com/labring/FastGPT.git
synced 2025-12-26 04:32:50 +00:00
Some checks failed
Deploy doc image by kubeconfig / build-fastgpt-docs-images (push) Has been cancelled
Deploy doc image to vercel / deploy-production (push) Has been cancelled
Build FastGPT images in Personal warehouse / build-fastgpt-images (push) Has been cancelled
Sync images / sync (push) Has been cancelled
Deploy doc image by kubeconfig / update-docs-image (push) Has been cancelled
* pr code * perf: model table show * perf: model provider show * perf: get init data buffer * perf: get init data buffer * perf: icon
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import type { NextApiResponse } from 'next';
|
|
import { ApiRequestProps } from '@fastgpt/service/type/next';
|
|
import { NextAPI } from '@/service/middleware/entry';
|
|
|
|
async function handler(req: ApiRequestProps<{}, { bufferId?: string }>, res: NextApiResponse) {
|
|
const { bufferId } = req.query;
|
|
|
|
// If bufferId is the same as the current bufferId, return directly
|
|
if (bufferId && global.systemInitBufferId && global.systemInitBufferId === bufferId) {
|
|
return {
|
|
bufferId: global.systemInitBufferId
|
|
};
|
|
}
|
|
|
|
return {
|
|
bufferId: global.systemInitBufferId,
|
|
feConfigs: global.feConfigs,
|
|
subPlans: global.subPlans,
|
|
llmModels: global.llmModels.map((model) => ({
|
|
...model,
|
|
customCQPrompt: '',
|
|
customExtractPrompt: '',
|
|
defaultSystemChatPrompt: ''
|
|
})),
|
|
vectorModels: global.vectorModels,
|
|
reRankModels:
|
|
global.reRankModels?.map((item) => ({
|
|
...item,
|
|
requestUrl: '',
|
|
requestAuth: ''
|
|
})) || [],
|
|
whisperModel: global.whisperModel,
|
|
audioSpeechModels: global.audioSpeechModels,
|
|
systemVersion: global.systemVersion || '0.0.0'
|
|
};
|
|
}
|
|
|
|
export default NextAPI(handler);
|