АДРЕСНЫЙ РЕЖИМ - авторан история - базовая версия + доп кля + конфиг дизапйна
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
import type {
|
||||
AutoGenHistoryResponse,
|
||||
AutoGenMode,
|
||||
AutoRunAnnotationsResponse,
|
||||
AutoRunAnnotationRecord,
|
||||
AutoRunDetailResponse,
|
||||
AutoRunDialogResponse,
|
||||
AutoRunHistoryResponse,
|
||||
AutoRunPostAnalysisResponse,
|
||||
AssistantMessageResultState,
|
||||
AssistantConversationItem,
|
||||
ConnectionState,
|
||||
HistoryItem,
|
||||
ManualCaseDecision,
|
||||
NormalizeResultState,
|
||||
PromptState,
|
||||
RuntimeRun
|
||||
@@ -281,5 +287,95 @@ export const apiClient = {
|
||||
|
||||
async loadAutoRunCaseDialog(runId: string, caseId: string): Promise<AutoRunDialogResponse> {
|
||||
return request(`/autoruns/history/${encodeURIComponent(runId)}/case/${encodeURIComponent(caseId)}/dialog`);
|
||||
},
|
||||
|
||||
async loadAutoRunAnnotations(input?: {
|
||||
run_id?: string;
|
||||
case_id?: string;
|
||||
min_rating?: number;
|
||||
manual_case_decision?: ManualCaseDecision | "all";
|
||||
limit?: number;
|
||||
}): Promise<AutoRunAnnotationsResponse> {
|
||||
const params = new URLSearchParams();
|
||||
if (input?.run_id) params.set("run_id", input.run_id);
|
||||
if (input?.case_id) params.set("case_id", input.case_id);
|
||||
if (typeof input?.min_rating === "number") params.set("min_rating", String(input.min_rating));
|
||||
if (input?.manual_case_decision) params.set("manual_case_decision", input.manual_case_decision);
|
||||
if (typeof input?.limit === "number") params.set("limit", String(input.limit));
|
||||
const query = params.toString();
|
||||
return request(`/autoruns/annotations${query ? `?${query}` : ""}`);
|
||||
},
|
||||
|
||||
async saveAutoRunAnnotation(input: {
|
||||
run_id: string;
|
||||
case_id: string;
|
||||
message_index: number;
|
||||
rating: number;
|
||||
comment: string;
|
||||
manual_case_decision: ManualCaseDecision;
|
||||
annotation_author?: string;
|
||||
}): Promise<{ ok: boolean; annotation: AutoRunAnnotationRecord; case_annotation_stats: { count: number; latest_at: string | null; avg_rating: number | null } | null }> {
|
||||
return request("/autoruns/annotations", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(input)
|
||||
});
|
||||
},
|
||||
|
||||
async loadAutoRunPostAnalysis(input?: {
|
||||
run_id?: string;
|
||||
limit_per_queue?: number;
|
||||
annotation_limit?: number;
|
||||
scan_limit?: number;
|
||||
from?: string;
|
||||
to?: string;
|
||||
target?: string;
|
||||
mode?: string;
|
||||
use_mock?: "any" | "true" | "false";
|
||||
prompt_contains?: string;
|
||||
}): Promise<AutoRunPostAnalysisResponse> {
|
||||
const params = new URLSearchParams();
|
||||
if (input?.run_id) params.set("run_id", input.run_id);
|
||||
if (typeof input?.limit_per_queue === "number") params.set("limit_per_queue", String(input.limit_per_queue));
|
||||
if (typeof input?.annotation_limit === "number") params.set("annotation_limit", String(input.annotation_limit));
|
||||
if (typeof input?.scan_limit === "number") params.set("scan_limit", String(input.scan_limit));
|
||||
if (input?.from) params.set("from", input.from);
|
||||
if (input?.to) params.set("to", input.to);
|
||||
if (input?.target) params.set("target", input.target);
|
||||
if (input?.mode) params.set("mode", input.mode);
|
||||
if (input?.use_mock) params.set("use_mock", input.use_mock);
|
||||
if (input?.prompt_contains) params.set("prompt_contains", input.prompt_contains);
|
||||
const query = params.toString();
|
||||
return request(`/autoruns/post-analysis${query ? `?${query}` : ""}`);
|
||||
},
|
||||
|
||||
async loadAutoRunAutogenHistory(input?: {
|
||||
mode?: AutoGenMode;
|
||||
limit?: number;
|
||||
}): Promise<AutoGenHistoryResponse> {
|
||||
const params = new URLSearchParams();
|
||||
if (input?.mode) params.set("mode", input.mode);
|
||||
if (typeof input?.limit === "number") params.set("limit", String(input.limit));
|
||||
const query = params.toString();
|
||||
return request(`/autoruns/autogen/history${query ? `?${query}` : ""}`);
|
||||
},
|
||||
|
||||
async generateAutoRunQuestions(input: {
|
||||
mode: AutoGenMode;
|
||||
count: number;
|
||||
domain?: string;
|
||||
persist_to_eval_cases?: boolean;
|
||||
generated_by?: string;
|
||||
context?: {
|
||||
llm_provider?: string;
|
||||
model?: string;
|
||||
assistant_prompt_version?: string;
|
||||
decomposition_prompt_version?: string;
|
||||
prompt_fingerprint?: string;
|
||||
};
|
||||
}): Promise<{ ok: boolean; generation: { generation_id: string; created_at: string; mode: AutoGenMode; count: number; domain: string | null; questions: string[]; generated_by: string | null; saved_case_set_file: string | null; context: Record<string, unknown> | null } }> {
|
||||
return request("/autoruns/autogen/generate", {
|
||||
method: "POST",
|
||||
body: JSON.stringify(input)
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user