完善文档页文本向量与重排序调用支持
This commit is contained in:
@@ -547,6 +547,39 @@ export async function createChatTask(
|
||||
});
|
||||
}
|
||||
|
||||
export async function createCompatibleChatCompletion(
|
||||
token: string,
|
||||
input: { model: string; messages: Array<Record<string, unknown>>; runMode?: string; simulation?: boolean; stream?: boolean },
|
||||
): Promise<Record<string, unknown>> {
|
||||
return request<Record<string, unknown>>('/v1/chat/completions', {
|
||||
body: input,
|
||||
method: 'POST',
|
||||
token,
|
||||
});
|
||||
}
|
||||
|
||||
export async function createEmbedding(
|
||||
token: string,
|
||||
input: { model: string; input: string | string[]; dimensions?: number; runMode?: string; simulation?: boolean },
|
||||
): Promise<Record<string, unknown>> {
|
||||
return request<Record<string, unknown>>('/v1/embeddings', {
|
||||
body: input,
|
||||
method: 'POST',
|
||||
token,
|
||||
});
|
||||
}
|
||||
|
||||
export async function createRerank(
|
||||
token: string,
|
||||
input: { model: string; query: string; documents: string[]; top_n?: number; runMode?: string; simulation?: boolean },
|
||||
): Promise<Record<string, unknown>> {
|
||||
return request<Record<string, unknown>>('/v1/reranks', {
|
||||
body: input,
|
||||
method: 'POST',
|
||||
token,
|
||||
});
|
||||
}
|
||||
|
||||
export async function streamChatCompletions(
|
||||
token: string,
|
||||
input: { model: string; messages: Array<Record<string, unknown>>; simulation?: boolean },
|
||||
|
||||
Reference in New Issue
Block a user