Update doc (#1430)

This commit is contained in:
Archer
2024-05-10 10:13:48 +08:00
committed by GitHub
parent 50716ff782
commit 08a310c41f
5 changed files with 37 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ import { VectorModelItemType } from '@fastgpt/global/core/ai/model.d';
import { getAIApi } from '../config';
import { countPromptTokens } from '../../../common/string/tiktoken/index';
import { EmbeddingTypeEnm } from '@fastgpt/global/core/ai/constants';
import { addLog } from '../../../common/system/log';
type GetVectorProps = {
model: VectorModelItemType;
@@ -32,6 +33,7 @@ export async function getVectorsByText({ model, input, type }: GetVectorProps) {
})
.then(async (res) => {
if (!res.data) {
addLog.error('Embedding API is not responding', res);
return Promise.reject('Embedding API is not responding');
}
if (!res?.data?.[0]?.embedding) {