4.8.9 test (#2299)

* perf: read file prompt

* perf: read file prompt

* perf: free plan tip

* feat: cron job usage

* perf: app templates

* perf: get llm model by name

* feat: support outlink upload file

* fix: upload limit
This commit is contained in:
Archer
2024-08-08 17:45:15 +08:00
committed by GitHub
parent c6dd3076c5
commit d682a8252f
18 changed files with 726 additions and 452 deletions

View File

@@ -1,20 +1,28 @@
export const getLLMModel = (model?: string) => {
return global.llmModels.find((item) => item.model === model) ?? global.llmModels[0];
return (
global.llmModels.find((item) => item.model === model || item.name === model) ??
global.llmModels[0]
);
};
export const getDatasetModel = (model?: string) => {
return (
global.llmModels?.filter((item) => item.datasetProcess)?.find((item) => item.model === model) ??
global.llmModels[0]
global.llmModels
?.filter((item) => item.datasetProcess)
?.find((item) => item.model === model || item.name === model) ?? global.llmModels[0]
);
};
export const getVectorModel = (model?: string) => {
return global.vectorModels.find((item) => item.model === model) || global.vectorModels[0];
return (
global.vectorModels.find((item) => item.model === model || item.name === model) ||
global.vectorModels[0]
);
};
export function getAudioSpeechModel(model?: string) {
return (
global.audioSpeechModels.find((item) => item.model === model) || global.audioSpeechModels[0]
global.audioSpeechModels.find((item) => item.model === model || item.name === model) ||
global.audioSpeechModels[0]
);
}

View File

@@ -95,7 +95,7 @@ export const dispatchReadFiles = async (props: Props): Promise<Response> => {
})
.filter(Boolean)
.slice(0, maxFiles);
console.log(parseUrlList);
const readFilesResult = await Promise.all(
parseUrlList
.map(async (url) => {