feat(web): 完善 API 文档与异步任务说明
This commit is contained in:
@@ -605,6 +605,26 @@ export async function createCompatibleChatCompletion(
|
||||
});
|
||||
}
|
||||
|
||||
export async function createResponse(
|
||||
token: string,
|
||||
input: {
|
||||
model: string;
|
||||
input: unknown;
|
||||
instructions?: string;
|
||||
previous_response_id?: string;
|
||||
runMode?: string;
|
||||
simulation?: boolean;
|
||||
store?: boolean;
|
||||
stream?: boolean;
|
||||
},
|
||||
): Promise<Record<string, unknown>> {
|
||||
return request<Record<string, unknown>>('/v1/responses', {
|
||||
body: input,
|
||||
method: 'POST',
|
||||
token,
|
||||
});
|
||||
}
|
||||
|
||||
export async function createEmbedding(
|
||||
token: string,
|
||||
input: { model: string; input: string | string[]; dimensions?: number; runMode?: string; simulation?: boolean },
|
||||
@@ -818,6 +838,8 @@ export interface VideoGenerationParams {
|
||||
mode?: 'std' | 'pro';
|
||||
negative_prompt?: string;
|
||||
cfg_scale?: number;
|
||||
runMode?: string;
|
||||
simulation?: boolean;
|
||||
}
|
||||
|
||||
export async function createVideoGenerationTask(
|
||||
@@ -881,6 +903,10 @@ export async function getTask(token: string, taskId: string): Promise<GatewayTas
|
||||
return request<GatewayTask>(`/api/workspace/tasks/${taskId}`, { token });
|
||||
}
|
||||
|
||||
export async function getAPITask(token: string, taskId: string): Promise<GatewayTask> {
|
||||
return request<GatewayTask>(`/api/v1/tasks/${taskId}`, { token });
|
||||
}
|
||||
|
||||
export async function listTaskParamPreprocessing(
|
||||
token: string,
|
||||
taskId: string,
|
||||
|
||||
Reference in New Issue
Block a user