必填入口没有值时停在 needs_input,不再把试运行判成失败

草稿图建出来后,start/end 这类必填入口往往没有缺省值,系统不会替你编日期去跑。现在记成
needs_input:入口字段做成可填表单(日期预填七天前/今天,可改),点「试运行」按这些值跑
一次;缺值仍回 422,不会发请求。试运行只跑取数与口径卡,参数按发布同一套规则校验。
This commit is contained in:
ThearchyHelios
2026-11-04 13:35:21 +08:00
parent 62c8702478
commit 1048905095
6 changed files with 256 additions and 17 deletions
+6
View File
@@ -58,6 +58,12 @@ export const caliberLedger = {
draft: (draftId: string, opts?: RequestOptions) => get<CaliberDraft>(draftAt(draftId), opts),
/** 起草后自动发起的那次只读试运行:状态和每个指标的值,running 时轮询到终态 */
draftTrial: (draftId: string, opts?: RequestOptions) => get<DraftTrialOut>(`${draftAt(draftId)}/trial`, opts),
/**
* 按填好的入口字段再试运行一次(POST 同一个路径):参数按入口字段校验,缺必填回 422;
* 返回 {run_id, status, metrics, error},status 是 running / succeeded / failed / needs_input
*/
runDraftTrial: (draftId: string, inputs: Record<string, unknown>) =>
post<DraftTrialOut>(`${draftAt(draftId)}/trial`, { inputs }),
/** 选文档发起起草:documents 是要用的知识库文档 id,guidance 是给模型看的附加要求 */
extractDraft: (body: { documents: string[]; collection?: string; datasource_id?: string; guidance?: string }) =>
post<{ draft_id: string; status: string }>('/ledger/drafts/extract', body),