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 bcd0b010a6
commit a3df9ea531
21 changed files with 144 additions and 79 deletions

View File

@@ -8,10 +8,11 @@ type GetVectorProps = {
model: EmbeddingModelItemType;
input: string;
type?: `${EmbeddingTypeEnm}`;
headers?: Record<string, string>;
};
// text to vector
export async function getVectorsByText({ model, input, type }: GetVectorProps) {
export async function getVectorsByText({ model, input, type, headers }: GetVectorProps) {
if (!input) {
return Promise.reject({
code: 500,
@@ -37,9 +38,10 @@ export async function getVectorsByText({ model, input, type }: GetVectorProps) {
path: model.requestUrl,
headers: model.requestAuth
? {
Authorization: `Bearer ${model.requestAuth}`
Authorization: `Bearer ${model.requestAuth}`,
...headers
}
: undefined
: headers
}
: {}
)