wren node: Train in the panel, as a run of wren's training flow

POST/GET /flows/{name}/nodes/{id}/train submit wren_train on the node's
targets, examples and tests and read its latest run (run.for_node,
cause "train"); "Use this model" writes `model` into the draft.
This commit is contained in:
2026-10-25 01:18:54 +02:00
parent 07fa5a2dc2
commit e9941b770d
11 changed files with 671 additions and 3 deletions
+55
View File
@@ -4505,6 +4505,61 @@ export const TokenRequestSchema = {
title: 'TokenRequest'
} as const;
export const TrainingSchema = {
properties: {
id: {
type: 'string',
title: 'Id'
},
status: {
type: 'string',
title: 'Status'
},
error: {
type: 'string',
title: 'Error',
default: ''
},
result: {
additionalProperties: true,
type: 'object',
title: 'Result',
default: {}
},
model: {
type: 'string',
title: 'Model',
default: ''
},
threshold: {
anyOf: [
{
type: 'number'
},
{
type: 'null'
}
],
title: 'Threshold'
},
test_exact_match: {
anyOf: [
{
type: 'number'
},
{
type: 'null'
}
],
title: 'Test Exact Match'
}
},
type: 'object',
required: ['id', 'status'],
title: 'Training',
description: "A wren node's latest training run, as its panel shows it."
} as const;
export const TriggerRequestSchema = {
properties: {
values: {
File diff suppressed because one or more lines are too long
+29
View File
@@ -1471,6 +1471,21 @@ export type TokenRequest = {
labels?: Array<(string)>;
};
/**
* A wren node's latest training run, as its panel shows it.
*/
export type Training = {
id: string;
status: string;
error?: string;
result?: {
[key: string]: unknown;
};
model?: string;
threshold?: (number | null);
test_exact_match?: (number | null);
};
export type TriggerRequest = {
values?: {
[key: string]: unknown;
@@ -2112,6 +2127,20 @@ export type FlowsAcknowledgeNodeErrorData = {
export type FlowsAcknowledgeNodeErrorResponse = (Message);
export type FlowsTrainNodeData = {
name: string;
nodeId: string;
};
export type FlowsTrainNodeResponse = (Training);
export type FlowsReadTrainingData = {
name: string;
nodeId: string;
};
export type FlowsReadTrainingResponse = ((Training | null));
export type FlowsReadFlowStateData = {
name: string;
};