update doc ;perf: model test (#4098)

* perf: extract array

* update doc

* perf: model test

* perf: model test
This commit is contained in:
Archer
2025-03-11 14:56:13 +08:00
committed by archer
parent 9bb8525909
commit 75e671bb43
21 changed files with 144 additions and 79 deletions

View File

@@ -16,11 +16,13 @@ type ReRankCallResult = { id: string; score?: number }[];
export function reRankRecall({
model = getDefaultRerankModel(),
query,
documents
documents,
headers
}: {
model?: ReRankModelItemType;
query: string;
documents: { id: string; text: string }[];
headers?: Record<string, string>;
}): Promise<ReRankCallResult> {
if (!model) {
return Promise.reject('no rerank model');
@@ -41,7 +43,8 @@ export function reRankRecall({
},
{
headers: {
Authorization: model.requestAuth ? `Bearer ${model.requestAuth}` : authorization
Authorization: model.requestAuth ? `Bearer ${model.requestAuth}` : authorization,
...headers
},
timeout: 30000
}