@takeshape/schema 11.104.4 → 11.105.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agents.d.ts +1 -0
- package/dist/agents.js +13 -0
- package/dist/builtin-schema.js +7 -0
- package/dist/project-schema/latest.d.ts +10 -1
- package/dist/project-schema/v3.56.0.d.ts +11 -6
- package/dist/resolvers/ai/agent-message-payload.d.ts +70 -0
- package/dist/resolvers/ai/agent-message-payload.js +55 -0
- package/dist/resolvers/ai/constants.d.ts +1 -0
- package/dist/resolvers/ai/constants.js +1 -0
- package/dist/resolvers/ai/get-agent-message-response.d.ts +55 -0
- package/dist/resolvers/ai/send-agent-feedback-args.d.ts +52 -0
- package/dist/resolvers/ai/send-agent-feedback-args.js +17 -0
- package/dist/schemas/project-schema/experimental.json +22 -0
- package/dist/schemas/project-schema/latest.json +3 -0
- package/dist/schemas/project-schema/v3.56.0.json +3 -0
- package/package.json +5 -5
package/dist/agents.d.ts
CHANGED
|
@@ -23,6 +23,7 @@ export declare const getSendAgentMessageShapeName: (agentName: string) => string
|
|
|
23
23
|
export declare const getAgentMessageShapeName: (inputName: string) => string;
|
|
24
24
|
export declare const getCreateAgentSessionMutationName: (agentName: string) => string;
|
|
25
25
|
export declare const getInspectAgentQueryName: (agentName: string) => string;
|
|
26
|
+
export declare const getSendAgentFeedbackMutationName: (agentName: string) => string;
|
|
26
27
|
export declare const getSendAgentMessageMutationName: (inputName: string) => string;
|
|
27
28
|
export declare const getGetAgentMessageQueryName: (inputName: string) => string;
|
|
28
29
|
export declare const getAbortAgentMessageMutationName: (inputName: string) => string;
|
package/dist/agents.js
CHANGED
|
@@ -10,6 +10,7 @@ import * as getAgentMessageArgs from "./resolvers/ai/get-agent-message-args.js";
|
|
|
10
10
|
import * as getAgentMessageResponse from "./resolvers/ai/get-agent-message-response.js";
|
|
11
11
|
import * as inspectAgentArgs from "./resolvers/ai/inspect-agent-args.js";
|
|
12
12
|
import * as inspectAgentResponse from "./resolvers/ai/inspect-agent-response.js";
|
|
13
|
+
import * as sendAgentFeedbackArgs from "./resolvers/ai/send-agent-feedback-args.js";
|
|
13
14
|
import * as sendAgentMessageArgs from "./resolvers/ai/send-agent-message-args.js";
|
|
14
15
|
import * as sendAgentMessageResponse from "./resolvers/ai/send-agent-message-response.js";
|
|
15
16
|
import { JSON_SHAPE_NAME } from "./resolvers/takeshape/builtins/constants.js";
|
|
@@ -71,6 +72,9 @@ export const getCreateAgentSessionMutationName = (agentName) => {
|
|
|
71
72
|
export const getInspectAgentQueryName = (agentName) => {
|
|
72
73
|
return `inspect${upperFirst(agentName)}`;
|
|
73
74
|
};
|
|
75
|
+
export const getSendAgentFeedbackMutationName = (agentName) => {
|
|
76
|
+
return `send${upperFirst(agentName)}Feedback`;
|
|
77
|
+
};
|
|
74
78
|
export const getSendAgentMessageMutationName = (inputName) => {
|
|
75
79
|
return `send${upperFirst(inputName)}Message`;
|
|
76
80
|
};
|
|
@@ -215,6 +219,15 @@ export function getAgentFeatures(agents) {
|
|
|
215
219
|
agentName
|
|
216
220
|
}
|
|
217
221
|
};
|
|
222
|
+
result.mutations[getSendAgentFeedbackMutationName(agentName)] ||= {
|
|
223
|
+
description: `Send feedback for the ${agentName} agent`,
|
|
224
|
+
args: sendAgentFeedbackArgs.shapeName,
|
|
225
|
+
shape: 'boolean',
|
|
226
|
+
resolver: {
|
|
227
|
+
name: 'ai:sendAgentFeedback',
|
|
228
|
+
agentName
|
|
229
|
+
}
|
|
230
|
+
};
|
|
218
231
|
}
|
|
219
232
|
return result;
|
|
220
233
|
}
|
package/dist/builtin-schema.js
CHANGED
|
@@ -7,6 +7,7 @@ import * as agentRunMode from "./resolvers/ai/agent-run-mode.js";
|
|
|
7
7
|
import * as createAgentSessionResponse from "./resolvers/ai/create-agent-session-response.js";
|
|
8
8
|
import * as embeddingSearchArgs from "./resolvers/ai/embedding-search.js";
|
|
9
9
|
import * as inspectAgentResponse from "./resolvers/ai/inspect-agent-response.js";
|
|
10
|
+
import * as sendAgentFeedbackArgs from "./resolvers/ai/send-agent-feedback-args.js";
|
|
10
11
|
import * as asset from "./resolvers/takeshape/assets/asset.js";
|
|
11
12
|
import * as assetImage from "./resolvers/takeshape/assets/asset-image.js";
|
|
12
13
|
import * as assetImageMeta from "./resolvers/takeshape/assets/asset-image-meta.js";
|
|
@@ -396,6 +397,12 @@ export const builtInShapes = {
|
|
|
396
397
|
id: abortAgentMessageResponse.shapeName,
|
|
397
398
|
name: abortAgentMessageResponse.shapeName,
|
|
398
399
|
schema: abortAgentMessageResponse.schema
|
|
400
|
+
},
|
|
401
|
+
[sendAgentFeedbackArgs.shapeName]: {
|
|
402
|
+
title: 'Send Agent Feedback Args',
|
|
403
|
+
id: sendAgentFeedbackArgs.shapeName,
|
|
404
|
+
name: sendAgentFeedbackArgs.shapeName,
|
|
405
|
+
schema: sendAgentFeedbackArgs.schema
|
|
399
406
|
}
|
|
400
407
|
};
|
|
401
408
|
export const builtInForms = {
|
|
@@ -74,7 +74,7 @@ export type Resolver = BasicResolver | ComposeResolver;
|
|
|
74
74
|
* This interface was referenced by `ProjectSchemaJSON`'s JSON-Schema
|
|
75
75
|
* via the `definition` "basicResolver".
|
|
76
76
|
*/
|
|
77
|
-
export type BasicResolver = UtilResolver | DelegateResolver | TakeshapeResolver | ShapedbResolver | ShapedbResolverShapeNameNotRequired | GraphqlResolver | RestResolver | AwsLambdaResolver | SalsifyResolver | SyndigoResolver | FunctionResolver | AIGenerateTextResolver | AIGeneratePropertyResolver | AIEmbeddingResolver | AIEmbeddingSearchResolver | AIParseFileResolver | ChunkResolver | AISendAgentMessageResolver | AIInspectAgentResolver | AICreateAgentSessionResolver | AIGetAgentMessageResolver | AIAbortAgentMessageResolver;
|
|
77
|
+
export type BasicResolver = UtilResolver | DelegateResolver | TakeshapeResolver | ShapedbResolver | ShapedbResolverShapeNameNotRequired | GraphqlResolver | RestResolver | AwsLambdaResolver | SalsifyResolver | SyndigoResolver | FunctionResolver | AIGenerateTextResolver | AIGeneratePropertyResolver | AIEmbeddingResolver | AIEmbeddingSearchResolver | AIParseFileResolver | ChunkResolver | AISendAgentMessageResolver | AIInspectAgentResolver | AICreateAgentSessionResolver | AIGetAgentMessageResolver | AIAbortAgentMessageResolver | AISendAgentFeedbackResolver;
|
|
78
78
|
/**
|
|
79
79
|
* Name of the resolver function.
|
|
80
80
|
*/
|
|
@@ -262,6 +262,10 @@ export type AIResolverName8 = 'ai:getAgentMessage';
|
|
|
262
262
|
* Name of the resolver function.
|
|
263
263
|
*/
|
|
264
264
|
export type AIResolverName9 = 'ai:abortAgentMessage';
|
|
265
|
+
/**
|
|
266
|
+
* Name of the resolver function.
|
|
267
|
+
*/
|
|
268
|
+
export type AIResolverName10 = 'ai:sendAgentFeedback';
|
|
265
269
|
/**
|
|
266
270
|
* This interface was referenced by `ProjectSchemaJSON`'s JSON-Schema
|
|
267
271
|
* via the `definition` "dependencies".
|
|
@@ -1545,6 +1549,11 @@ export interface AIAbortAgentMessageResolver {
|
|
|
1545
1549
|
name: AIResolverName9;
|
|
1546
1550
|
agentName: string;
|
|
1547
1551
|
}
|
|
1552
|
+
export interface AISendAgentFeedbackResolver {
|
|
1553
|
+
id?: string;
|
|
1554
|
+
name: AIResolverName10;
|
|
1555
|
+
agentName: string;
|
|
1556
|
+
}
|
|
1548
1557
|
/**
|
|
1549
1558
|
* This interface was referenced by `ProjectSchemaJSON`'s JSON-Schema
|
|
1550
1559
|
* via the `definition` "composeResolver".
|
|
@@ -74,7 +74,7 @@ export type ResolverV3_56_0 = BasicResolverV3_56_0 | ComposeResolverV3_56_0;
|
|
|
74
74
|
* This interface was referenced by `ProjectSchemaJSONV3_56_0`'s JSON-Schema
|
|
75
75
|
* via the `definition` "basicResolver".
|
|
76
76
|
*/
|
|
77
|
-
export type BasicResolverV3_56_0 = UtilResolverV3_56_0 | DelegateResolverV3_56_0 | TakeshapeResolverV3_56_0 | ShapedbResolverV3_56_0 | ShapedbResolverShapeNameNotRequiredV3_56_0 | GraphqlResolverV3_56_0 | RestResolverV3_56_0 | AwsLambdaResolverV3_56_0 | SalsifyResolverV3_56_0 | SyndigoResolverV3_56_0 | FunctionResolverV3_56_0 | AIGenerateTextResolverV3_56_0 | AIGeneratePropertyResolverV3_56_0 | AIEmbeddingResolverV3_56_0 | AIEmbeddingSearchResolverV3_56_0 | AIParseFileResolverV3_56_0 | ChunkResolverV3_56_0 | AISendAgentMessageResolverV3_56_0 | AIInspectAgentResolverV3_56_0 | AICreateAgentSessionResolverV3_56_0 | AIGetAgentMessageResolverV3_56_0 | AIAbortAgentMessageResolverV3_56_0;
|
|
77
|
+
export type BasicResolverV3_56_0 = UtilResolverV3_56_0 | DelegateResolverV3_56_0 | TakeshapeResolverV3_56_0 | ShapedbResolverV3_56_0 | ShapedbResolverShapeNameNotRequiredV3_56_0 | GraphqlResolverV3_56_0 | RestResolverV3_56_0 | AwsLambdaResolverV3_56_0 | SalsifyResolverV3_56_0 | SyndigoResolverV3_56_0 | FunctionResolverV3_56_0 | AIGenerateTextResolverV3_56_0 | AIGeneratePropertyResolverV3_56_0 | AIEmbeddingResolverV3_56_0 | AIEmbeddingSearchResolverV3_56_0 | AIParseFileResolverV3_56_0 | ChunkResolverV3_56_0 | AISendAgentMessageResolverV3_56_0 | AIInspectAgentResolverV3_56_0 | AICreateAgentSessionResolverV3_56_0 | AIGetAgentMessageResolverV3_56_0 | AIAbortAgentMessageResolverV3_56_0 | AISendAgentFeedbackResolverV3_56_0;
|
|
78
78
|
/**
|
|
79
79
|
* Name of the resolver function.
|
|
80
80
|
*/
|
|
@@ -262,6 +262,10 @@ export type AIResolverNameV3_56_08 = 'ai:getAgentMessage';
|
|
|
262
262
|
* Name of the resolver function.
|
|
263
263
|
*/
|
|
264
264
|
export type AIResolverNameV3_56_09 = 'ai:abortAgentMessage';
|
|
265
|
+
/**
|
|
266
|
+
* Name of the resolver function.
|
|
267
|
+
*/
|
|
268
|
+
export type AIResolverNameV3_56_010 = 'ai:sendAgentFeedback';
|
|
265
269
|
/**
|
|
266
270
|
* This interface was referenced by `ProjectSchemaJSONV3_56_0`'s JSON-Schema
|
|
267
271
|
* via the `definition` "dependencies".
|
|
@@ -383,7 +387,7 @@ export type StripMarkdownV3_56_0 = boolean;
|
|
|
383
387
|
* These steps are evaluated in order until a destination is found.
|
|
384
388
|
*/
|
|
385
389
|
export type AgentTransitionV3_56_0 = AgentTransitionImmediateV3_56_0 | AgentTransitionSuspendV3_56_0;
|
|
386
|
-
export type AgentStateSessionMemoryV3_56_01 =
|
|
390
|
+
export type AgentStateSessionMemoryV3_56_01 = AgentStateSessionMemoryAssignmentV3_56_0[];
|
|
387
391
|
export type GuardIDV3_56_0 = string;
|
|
388
392
|
export type VariablesV3_56_01 = AgentVariableV3_56_0[];
|
|
389
393
|
export type HistoryStrategyTransformV3_56_0 = HistoryStrategyTransformNoneV3_56_0 | HistoryStrategyTransformReplaceV3_56_0 | HistoryStrategyTransformSummarizeV3_56_0;
|
|
@@ -1545,6 +1549,11 @@ export interface AIAbortAgentMessageResolverV3_56_0 {
|
|
|
1545
1549
|
name: AIResolverNameV3_56_09;
|
|
1546
1550
|
agentName: string;
|
|
1547
1551
|
}
|
|
1552
|
+
export interface AISendAgentFeedbackResolverV3_56_0 {
|
|
1553
|
+
id?: string;
|
|
1554
|
+
name: AIResolverNameV3_56_010;
|
|
1555
|
+
agentName: string;
|
|
1556
|
+
}
|
|
1548
1557
|
/**
|
|
1549
1558
|
* This interface was referenced by `ProjectSchemaJSONV3_56_0`'s JSON-Schema
|
|
1550
1559
|
* via the `definition` "composeResolver".
|
|
@@ -1944,10 +1953,6 @@ export interface AgentTransitionImmediateV3_56_0 {
|
|
|
1944
1953
|
sessionMemory?: AgentStateSessionMemoryV3_56_01;
|
|
1945
1954
|
historyStrategy?: string;
|
|
1946
1955
|
}
|
|
1947
|
-
export interface AgentStateSessionMemoryAssignmentV3_56_01 {
|
|
1948
|
-
memoryPath?: string;
|
|
1949
|
-
expression: string;
|
|
1950
|
-
}
|
|
1951
1956
|
export interface AgentGuardV3_56_0 {
|
|
1952
1957
|
guardId: GuardIDV3_56_0;
|
|
1953
1958
|
}
|
|
@@ -56,6 +56,61 @@ export declare const schema: {
|
|
|
56
56
|
readonly type: "number";
|
|
57
57
|
readonly description: "Timestamp when the message finished processing";
|
|
58
58
|
};
|
|
59
|
+
readonly span: {
|
|
60
|
+
readonly type: "object";
|
|
61
|
+
readonly description: "The span for the agent run associated with this message";
|
|
62
|
+
readonly properties: {
|
|
63
|
+
readonly traceId: {
|
|
64
|
+
readonly type: "string";
|
|
65
|
+
};
|
|
66
|
+
readonly spanId: {
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
};
|
|
69
|
+
readonly name: {
|
|
70
|
+
readonly type: "string";
|
|
71
|
+
};
|
|
72
|
+
readonly createdAt: {
|
|
73
|
+
readonly type: "number";
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
readonly required: ["traceId", "spanId", "name", "createdAt"];
|
|
77
|
+
readonly additionalProperties: false;
|
|
78
|
+
};
|
|
79
|
+
readonly feedback: {
|
|
80
|
+
readonly type: "object";
|
|
81
|
+
readonly properties: {
|
|
82
|
+
readonly name: {
|
|
83
|
+
readonly type: "string";
|
|
84
|
+
readonly description: "Name of the feedback, e.g., \"Quality\", \"Relevance\"";
|
|
85
|
+
};
|
|
86
|
+
readonly label: {
|
|
87
|
+
readonly type: "string";
|
|
88
|
+
readonly description: "String feedback for the agent message, e.g., \"helpful\", \"not helpful\". If a label is provided, a score must not be provided.";
|
|
89
|
+
};
|
|
90
|
+
readonly score: {
|
|
91
|
+
readonly type: "number";
|
|
92
|
+
readonly description: "Numeric feedback for the agent message, typically between 1 and 5. If a score is provided, a label must not be provided.";
|
|
93
|
+
};
|
|
94
|
+
readonly text: {
|
|
95
|
+
readonly type: "string";
|
|
96
|
+
readonly description: "Freeform text feedback for the agent message.";
|
|
97
|
+
};
|
|
98
|
+
readonly note: {
|
|
99
|
+
readonly type: "string";
|
|
100
|
+
readonly description: "Optional note for the feedback, e.g., \"This was helpful because...\"";
|
|
101
|
+
};
|
|
102
|
+
readonly updatedBy: {
|
|
103
|
+
readonly type: "string";
|
|
104
|
+
readonly description: "A string identifying the user who is adding the annotation, such as a name or email address.";
|
|
105
|
+
};
|
|
106
|
+
readonly createdAt: {
|
|
107
|
+
readonly type: "number";
|
|
108
|
+
readonly description: "Timestamp when the feedback was created";
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
readonly additionalProperties: false;
|
|
112
|
+
readonly required: ["name"];
|
|
113
|
+
};
|
|
59
114
|
};
|
|
60
115
|
readonly required: ["messageId", "sessionId", "projectId", "runMode"];
|
|
61
116
|
readonly additionalProperties: false;
|
|
@@ -77,6 +132,21 @@ export declare const validate: import("ajv").ValidateFunction<{
|
|
|
77
132
|
sentAt?: number | undefined;
|
|
78
133
|
startedAt?: number | undefined;
|
|
79
134
|
finishedAt?: number | undefined;
|
|
135
|
+
span?: {
|
|
136
|
+
name: string;
|
|
137
|
+
traceId: string;
|
|
138
|
+
spanId: string;
|
|
139
|
+
createdAt: number;
|
|
140
|
+
} | undefined;
|
|
141
|
+
feedback?: {
|
|
142
|
+
createdAt?: number | undefined;
|
|
143
|
+
label?: string | undefined;
|
|
144
|
+
score?: number | undefined;
|
|
145
|
+
text?: string | undefined;
|
|
146
|
+
note?: string | undefined;
|
|
147
|
+
updatedBy?: string | undefined;
|
|
148
|
+
name: string;
|
|
149
|
+
} | undefined;
|
|
80
150
|
messageId: string;
|
|
81
151
|
projectId: string;
|
|
82
152
|
sessionId: string;
|
|
@@ -49,6 +49,61 @@ export const schema = {
|
|
|
49
49
|
finishedAt: {
|
|
50
50
|
type: 'number',
|
|
51
51
|
description: 'Timestamp when the message finished processing'
|
|
52
|
+
},
|
|
53
|
+
span: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
description: 'The span for the agent run associated with this message',
|
|
56
|
+
properties: {
|
|
57
|
+
traceId: {
|
|
58
|
+
type: 'string'
|
|
59
|
+
},
|
|
60
|
+
spanId: {
|
|
61
|
+
type: 'string'
|
|
62
|
+
},
|
|
63
|
+
name: {
|
|
64
|
+
type: 'string'
|
|
65
|
+
},
|
|
66
|
+
createdAt: {
|
|
67
|
+
type: 'number'
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
required: ['traceId', 'spanId', 'name', 'createdAt'],
|
|
71
|
+
additionalProperties: false
|
|
72
|
+
},
|
|
73
|
+
feedback: {
|
|
74
|
+
type: 'object',
|
|
75
|
+
properties: {
|
|
76
|
+
name: {
|
|
77
|
+
type: 'string',
|
|
78
|
+
description: 'Name of the feedback, e.g., "Quality", "Relevance"'
|
|
79
|
+
},
|
|
80
|
+
label: {
|
|
81
|
+
type: 'string',
|
|
82
|
+
description: 'String feedback for the agent message, e.g., "helpful", "not helpful". If a label is provided, a score must not be provided.'
|
|
83
|
+
},
|
|
84
|
+
score: {
|
|
85
|
+
type: 'number',
|
|
86
|
+
description: 'Numeric feedback for the agent message, typically between 1 and 5. If a score is provided, a label must not be provided.'
|
|
87
|
+
},
|
|
88
|
+
text: {
|
|
89
|
+
type: 'string',
|
|
90
|
+
description: 'Freeform text feedback for the agent message.'
|
|
91
|
+
},
|
|
92
|
+
note: {
|
|
93
|
+
type: 'string',
|
|
94
|
+
description: 'Optional note for the feedback, e.g., "This was helpful because..."'
|
|
95
|
+
},
|
|
96
|
+
updatedBy: {
|
|
97
|
+
type: 'string',
|
|
98
|
+
description: 'A string identifying the user who is adding the annotation, such as a name or email address.'
|
|
99
|
+
},
|
|
100
|
+
createdAt: {
|
|
101
|
+
type: 'number',
|
|
102
|
+
description: 'Timestamp when the feedback was created'
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
additionalProperties: false,
|
|
106
|
+
required: ['name']
|
|
52
107
|
}
|
|
53
108
|
},
|
|
54
109
|
required: ['messageId', 'sessionId', 'projectId', 'runMode'],
|
|
@@ -6,3 +6,4 @@ export declare const AI_AGENT_CHAT_RESPONSE_SHAPE_NAME = "TSChatResponse";
|
|
|
6
6
|
export declare const AI_AGENT_CHAT_PAYLOAD_SHAPE_NAME = "TSChatPayload";
|
|
7
7
|
export declare const AI_AGENT_ABORT_AGENT_MESSAGE_RESPONSE_SHAPE_NAME = "TSAbortAgentMessageResponse";
|
|
8
8
|
export declare const AI_AGENT_RUN_MODE_SHAPE_NAME = "TSAgentRunMode";
|
|
9
|
+
export declare const AI_AGENT_SEND_AGENT_FEEDBACK_SHAPE_NAME = "TSSendAgentFeedback";
|
|
@@ -6,3 +6,4 @@ export const AI_AGENT_CHAT_RESPONSE_SHAPE_NAME = 'TSChatResponse';
|
|
|
6
6
|
export const AI_AGENT_CHAT_PAYLOAD_SHAPE_NAME = 'TSChatPayload';
|
|
7
7
|
export const AI_AGENT_ABORT_AGENT_MESSAGE_RESPONSE_SHAPE_NAME = 'TSAbortAgentMessageResponse';
|
|
8
8
|
export const AI_AGENT_RUN_MODE_SHAPE_NAME = 'TSAgentRunMode';
|
|
9
|
+
export const AI_AGENT_SEND_AGENT_FEEDBACK_SHAPE_NAME = 'TSSendAgentFeedback';
|
|
@@ -115,6 +115,61 @@ export declare const schema: {
|
|
|
115
115
|
readonly type: "number";
|
|
116
116
|
readonly description: "Timestamp when the message finished processing";
|
|
117
117
|
};
|
|
118
|
+
readonly span: {
|
|
119
|
+
readonly type: "object";
|
|
120
|
+
readonly description: "The span for the agent run associated with this message";
|
|
121
|
+
readonly properties: {
|
|
122
|
+
readonly traceId: {
|
|
123
|
+
readonly type: "string";
|
|
124
|
+
};
|
|
125
|
+
readonly spanId: {
|
|
126
|
+
readonly type: "string";
|
|
127
|
+
};
|
|
128
|
+
readonly name: {
|
|
129
|
+
readonly type: "string";
|
|
130
|
+
};
|
|
131
|
+
readonly createdAt: {
|
|
132
|
+
readonly type: "number";
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
readonly required: ["traceId", "spanId", "name", "createdAt"];
|
|
136
|
+
readonly additionalProperties: false;
|
|
137
|
+
};
|
|
138
|
+
readonly feedback: {
|
|
139
|
+
readonly type: "object";
|
|
140
|
+
readonly properties: {
|
|
141
|
+
readonly name: {
|
|
142
|
+
readonly type: "string";
|
|
143
|
+
readonly description: "Name of the feedback, e.g., \"Quality\", \"Relevance\"";
|
|
144
|
+
};
|
|
145
|
+
readonly label: {
|
|
146
|
+
readonly type: "string";
|
|
147
|
+
readonly description: "String feedback for the agent message, e.g., \"helpful\", \"not helpful\". If a label is provided, a score must not be provided.";
|
|
148
|
+
};
|
|
149
|
+
readonly score: {
|
|
150
|
+
readonly type: "number";
|
|
151
|
+
readonly description: "Numeric feedback for the agent message, typically between 1 and 5. If a score is provided, a label must not be provided.";
|
|
152
|
+
};
|
|
153
|
+
readonly text: {
|
|
154
|
+
readonly type: "string";
|
|
155
|
+
readonly description: "Freeform text feedback for the agent message.";
|
|
156
|
+
};
|
|
157
|
+
readonly note: {
|
|
158
|
+
readonly type: "string";
|
|
159
|
+
readonly description: "Optional note for the feedback, e.g., \"This was helpful because...\"";
|
|
160
|
+
};
|
|
161
|
+
readonly updatedBy: {
|
|
162
|
+
readonly type: "string";
|
|
163
|
+
readonly description: "A string identifying the user who is adding the annotation, such as a name or email address.";
|
|
164
|
+
};
|
|
165
|
+
readonly createdAt: {
|
|
166
|
+
readonly type: "number";
|
|
167
|
+
readonly description: "Timestamp when the feedback was created";
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
readonly additionalProperties: false;
|
|
171
|
+
readonly required: ["name"];
|
|
172
|
+
};
|
|
118
173
|
};
|
|
119
174
|
readonly required: ["messageId", "status"];
|
|
120
175
|
readonly additionalProperties: true;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { FromSchema } from 'json-schema-to-ts';
|
|
2
|
+
export declare const shapeName = "TSSendAgentFeedback";
|
|
3
|
+
export declare const schema: {
|
|
4
|
+
readonly type: "object";
|
|
5
|
+
readonly properties: {
|
|
6
|
+
readonly name: {
|
|
7
|
+
readonly type: "string";
|
|
8
|
+
readonly description: "Name of the feedback, e.g., \"Quality\", \"Relevance\"";
|
|
9
|
+
};
|
|
10
|
+
readonly label: {
|
|
11
|
+
readonly type: "string";
|
|
12
|
+
readonly description: "String feedback for the agent message, e.g., \"helpful\", \"not helpful\". If a label is provided, a score must not be provided.";
|
|
13
|
+
};
|
|
14
|
+
readonly score: {
|
|
15
|
+
readonly type: "number";
|
|
16
|
+
readonly description: "Numeric feedback for the agent message, typically between 1 and 5. If a score is provided, a label must not be provided.";
|
|
17
|
+
};
|
|
18
|
+
readonly text: {
|
|
19
|
+
readonly type: "string";
|
|
20
|
+
readonly description: "Freeform text feedback for the agent message.";
|
|
21
|
+
};
|
|
22
|
+
readonly note: {
|
|
23
|
+
readonly type: "string";
|
|
24
|
+
readonly description: "Optional note for the feedback, e.g., \"This was helpful because...\"";
|
|
25
|
+
};
|
|
26
|
+
readonly updatedBy: {
|
|
27
|
+
readonly type: "string";
|
|
28
|
+
readonly description: "A string identifying the user who is adding the annotation, such as a name or email address.";
|
|
29
|
+
};
|
|
30
|
+
readonly createdAt: {
|
|
31
|
+
readonly type: "number";
|
|
32
|
+
readonly description: "Timestamp when the feedback was created";
|
|
33
|
+
};
|
|
34
|
+
readonly messageId: {
|
|
35
|
+
readonly type: "string";
|
|
36
|
+
readonly description: "Message ID for the message.";
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
readonly required: ["messageId", "name"];
|
|
40
|
+
readonly additionalProperties: false;
|
|
41
|
+
};
|
|
42
|
+
export type SendAgentFeedbackArgs = FromSchema<typeof schema>;
|
|
43
|
+
export declare const validate: import("ajv").ValidateFunction<{
|
|
44
|
+
createdAt?: number | undefined;
|
|
45
|
+
label?: string | undefined;
|
|
46
|
+
score?: number | undefined;
|
|
47
|
+
text?: string | undefined;
|
|
48
|
+
note?: string | undefined;
|
|
49
|
+
updatedBy?: string | undefined;
|
|
50
|
+
messageId: string;
|
|
51
|
+
name: string;
|
|
52
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createTypedValidator } from '@takeshape/json-schema';
|
|
2
|
+
import * as agentMessagePayload from "./agent-message-payload.js";
|
|
3
|
+
import { AI_AGENT_SEND_AGENT_FEEDBACK_SHAPE_NAME } from "./constants.js";
|
|
4
|
+
export const shapeName = AI_AGENT_SEND_AGENT_FEEDBACK_SHAPE_NAME;
|
|
5
|
+
export const schema = {
|
|
6
|
+
type: 'object',
|
|
7
|
+
properties: {
|
|
8
|
+
messageId: {
|
|
9
|
+
type: 'string',
|
|
10
|
+
description: 'Message ID for the message.'
|
|
11
|
+
},
|
|
12
|
+
...agentMessagePayload.schema.properties.feedback.properties
|
|
13
|
+
},
|
|
14
|
+
required: ['messageId', ...agentMessagePayload.schema.properties.feedback.required],
|
|
15
|
+
additionalProperties: false
|
|
16
|
+
};
|
|
17
|
+
export const validate = createTypedValidator(schema);
|
|
@@ -897,6 +897,28 @@
|
|
|
897
897
|
"required": ["name", "agentName"],
|
|
898
898
|
"additionalProperties": false
|
|
899
899
|
},
|
|
900
|
+
"aiSendAgentFeedbackResolver": {
|
|
901
|
+
"title": "AISendAgentFeedbackResolver",
|
|
902
|
+
"type": "object",
|
|
903
|
+
"properties": {
|
|
904
|
+
"id": {
|
|
905
|
+
"type": "string",
|
|
906
|
+
"pattern": "^(?=[a-zA-Z])[-_a-zA-Z0-9]+$"
|
|
907
|
+
},
|
|
908
|
+
"name": {
|
|
909
|
+
"title": "AI Resolver Name",
|
|
910
|
+
"type": "string",
|
|
911
|
+
"description": "Name of the resolver function.",
|
|
912
|
+
"enum": ["ai:sendAgentFeedback"]
|
|
913
|
+
},
|
|
914
|
+
"agentName": {
|
|
915
|
+
"type": "string",
|
|
916
|
+
"pattern": "^[0-9A-Za-z_]+$"
|
|
917
|
+
}
|
|
918
|
+
},
|
|
919
|
+
"required": ["name", "agentName"],
|
|
920
|
+
"additionalProperties": false
|
|
921
|
+
},
|
|
900
922
|
"guard": {
|
|
901
923
|
"title": "GuardJSON",
|
|
902
924
|
"description": "A Guard is a configuration for an AI guardrail that can check inputs and outputs and provide safety and compliance.",
|
|
@@ -952,6 +952,9 @@
|
|
|
952
952
|
},
|
|
953
953
|
{
|
|
954
954
|
"$ref": "https://schema.takeshape.io/project-schema/experimental#/definitions/aiAbortAgentMessageResolver"
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
"$ref": "https://schema.takeshape.io/project-schema/experimental#/definitions/aiSendAgentFeedbackResolver"
|
|
955
958
|
}
|
|
956
959
|
]
|
|
957
960
|
},
|
|
@@ -952,6 +952,9 @@
|
|
|
952
952
|
},
|
|
953
953
|
{
|
|
954
954
|
"$ref": "https://schema.takeshape.io/project-schema/experimental#/definitions/aiAbortAgentMessageResolver"
|
|
955
|
+
},
|
|
956
|
+
{
|
|
957
|
+
"$ref": "https://schema.takeshape.io/project-schema/experimental#/definitions/aiSendAgentFeedbackResolver"
|
|
955
958
|
}
|
|
956
959
|
]
|
|
957
960
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/schema",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.105.0",
|
|
4
4
|
"description": "TakeShape Schema",
|
|
5
5
|
"homepage": "https://www.takeshape.io",
|
|
6
6
|
"repository": {
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"p-reduce": "^2.1.0",
|
|
59
59
|
"semver": "^7.3.2",
|
|
60
60
|
"tiny-invariant": "^1.2.0",
|
|
61
|
-
"@takeshape/errors": "11.
|
|
62
|
-
"@takeshape/
|
|
63
|
-
"@takeshape/
|
|
61
|
+
"@takeshape/errors": "11.105.0",
|
|
62
|
+
"@takeshape/json-schema": "11.105.0",
|
|
63
|
+
"@takeshape/util": "11.105.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@takeshape/json-schema-to-typescript": "^11.0.0",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"glob": "^7.1.6",
|
|
78
78
|
"json-schema-to-ts": "^3.1.1",
|
|
79
79
|
"shortid": "2.2.16",
|
|
80
|
-
"@takeshape/infra": "11.
|
|
80
|
+
"@takeshape/infra": "11.105.0"
|
|
81
81
|
},
|
|
82
82
|
"engines": {
|
|
83
83
|
"node": ">=22"
|