@takeshape/schema 11.121.4 → 11.121.6
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/resolvers/ai/agent-chat-response.d.ts +5 -19
- package/dist/resolvers/ai/agent-message-payload.d.ts +6 -3
- package/dist/resolvers/ai/agent-session-payload.d.ts +1 -12
- package/dist/resolvers/ai/agent-session-payload.js +0 -9
- package/dist/resolvers/ai/create-agent-session-response.d.ts +8 -22
- package/dist/resolvers/ai/create-agent-session-response.js +1 -1
- package/dist/resolvers/ai/get-agent-message-response.d.ts +1 -9
- package/dist/resolvers/ai/inspect-agent-response.d.ts +7 -15
- package/dist/resolvers/ai/inspect-agent-response.js +0 -1
- package/dist/resolvers/ai/send-agent-message-response.d.ts +1 -9
- package/dist/util/expressions.d.ts +0 -2
- package/dist/util/expressions.js +0 -2
- package/examples/latest/chat-agent-schema.json +79 -0
- package/examples/latest/{agent-schema.json → generate-agent-schema.json} +88 -108
- package/examples/source/chat-agent-schema.json +59 -0
- package/examples/source/generate-agent-schema.json +292 -0
- package/package.json +6 -6
- package/examples/source/agent-schema.json +0 -365
|
@@ -1,20 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
-
"projectId": "
|
|
2
|
+
"projectId": "generate-agent-schema-project-id",
|
|
3
3
|
"defaultLocale": "en-us",
|
|
4
4
|
"locales": [
|
|
5
5
|
"en-us"
|
|
6
6
|
],
|
|
7
7
|
"queries": {
|
|
8
|
-
"dogDelegate": {
|
|
9
|
-
"resolver": {
|
|
10
|
-
"name": "delegate",
|
|
11
|
-
"to": "getDogList",
|
|
12
|
-
"options": {
|
|
13
|
-
"selectionSet": "{items {name}}"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"shape": "JSON"
|
|
17
|
-
},
|
|
18
8
|
"getDog": {
|
|
19
9
|
"shape": "Dog",
|
|
20
10
|
"resolver": {
|
|
@@ -32,7 +22,7 @@
|
|
|
32
22
|
"service": "shapedb",
|
|
33
23
|
"shapeName": "Dog"
|
|
34
24
|
},
|
|
35
|
-
"description": "Returns a list Dog in natural order
|
|
25
|
+
"description": "Returns a list Dog in natural order..",
|
|
36
26
|
"args": "TSListArgs<Dog>"
|
|
37
27
|
}
|
|
38
28
|
},
|
|
@@ -127,6 +117,26 @@
|
|
|
127
117
|
"message"
|
|
128
118
|
]
|
|
129
119
|
}
|
|
120
|
+
},
|
|
121
|
+
"FindDogColorSessionMemory": {
|
|
122
|
+
"id": "NhJxAX3PQ",
|
|
123
|
+
"name": "FindDogColorSessionMemory",
|
|
124
|
+
"title": "Find Dog Color Session Memory",
|
|
125
|
+
"schema": {
|
|
126
|
+
"type": "object",
|
|
127
|
+
"properties": {
|
|
128
|
+
"queryResult": {
|
|
129
|
+
"@mapping": "shapedb:FindDogColorSessionMemory.vwYz10HDl",
|
|
130
|
+
"title": "Query Result",
|
|
131
|
+
"@ref": "Dog"
|
|
132
|
+
},
|
|
133
|
+
"answerResult": {
|
|
134
|
+
"@mapping": "shapedb:FindDogColorSessionMemory._E6AKVHKy",
|
|
135
|
+
"type": "string",
|
|
136
|
+
"title": "Answer"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
130
140
|
}
|
|
131
141
|
},
|
|
132
142
|
"workflows": {},
|
|
@@ -146,39 +156,21 @@
|
|
|
146
156
|
"color"
|
|
147
157
|
]
|
|
148
158
|
}
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
"schemaVersion": "3.59.0",
|
|
152
|
-
"apiVersion": "2",
|
|
153
|
-
"services": {
|
|
154
|
-
"openai": {
|
|
155
|
-
"id": "openai",
|
|
156
|
-
"title": "OpenAI",
|
|
157
|
-
"namespace": "OpenAI",
|
|
158
|
-
"provider": "openai",
|
|
159
|
-
"serviceType": "openapi",
|
|
160
|
-
"authenticationType": "bearer",
|
|
161
|
-
"options": {
|
|
162
|
-
"endpoint": "https://api.openai.com/v1/",
|
|
163
|
-
"spec": "https://raw.githubusercontent.com/takeshape/openapi-specs/813784d8fcac5b3fd4e468ce6f715b89c9fcb73f/specs/openai/v2.yml",
|
|
164
|
-
"transformVersion": "2.0.0",
|
|
165
|
-
"introspectedAt": "2024-10-17T21:21:59.009Z"
|
|
166
|
-
},
|
|
167
|
-
"authentication": "secret"
|
|
168
159
|
},
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
160
|
+
"FindDogColorSessionMemory": {
|
|
161
|
+
"default": {
|
|
162
|
+
"properties": {
|
|
163
|
+
"queryResult": {
|
|
164
|
+
"widget": "shapeObject"
|
|
165
|
+
},
|
|
166
|
+
"answerResult": {
|
|
167
|
+
"widget": "singleLineText"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"order": [
|
|
171
|
+
"queryResult",
|
|
172
|
+
"answerResult"
|
|
173
|
+
]
|
|
182
174
|
}
|
|
183
175
|
}
|
|
184
176
|
},
|
|
@@ -188,24 +180,26 @@
|
|
|
188
180
|
"api": {
|
|
189
181
|
"inputs": [
|
|
190
182
|
{
|
|
191
|
-
"name": "findDogColor",
|
|
192
183
|
"type": "mutation",
|
|
184
|
+
"name": "findDogColor",
|
|
193
185
|
"args": "TSGenerateArgs"
|
|
194
186
|
}
|
|
195
187
|
]
|
|
196
188
|
},
|
|
189
|
+
"memory": {
|
|
190
|
+
"sessionMemory": {
|
|
191
|
+
"shape": "FindDogColorSessionMemory"
|
|
192
|
+
}
|
|
193
|
+
},
|
|
197
194
|
"start": {
|
|
198
195
|
"transitions": [
|
|
199
196
|
{
|
|
200
197
|
"type": "suspend",
|
|
201
|
-
"
|
|
202
|
-
"
|
|
198
|
+
"destination": "bbb",
|
|
199
|
+
"input": "findDogColor"
|
|
203
200
|
}
|
|
204
201
|
]
|
|
205
202
|
},
|
|
206
|
-
"memory": {
|
|
207
|
-
"sessionMemory": {}
|
|
208
|
-
},
|
|
209
203
|
"states": {
|
|
210
204
|
"bbb": {
|
|
211
205
|
"name": "query",
|
|
@@ -213,9 +207,6 @@
|
|
|
213
207
|
{
|
|
214
208
|
"name": "input",
|
|
215
209
|
"steps": [
|
|
216
|
-
{
|
|
217
|
-
"expression": "stateOutputs['ccc'].dogName"
|
|
218
|
-
},
|
|
219
210
|
{
|
|
220
211
|
"expression": "args.input"
|
|
221
212
|
}
|
|
@@ -230,7 +221,13 @@
|
|
|
230
221
|
"transitions": [
|
|
231
222
|
{
|
|
232
223
|
"type": "immediate",
|
|
233
|
-
"destination": "ccc"
|
|
224
|
+
"destination": "ccc",
|
|
225
|
+
"sessionMemory": [
|
|
226
|
+
{
|
|
227
|
+
"expression": "currentStateOutput",
|
|
228
|
+
"memoryPath": "queryResult"
|
|
229
|
+
}
|
|
230
|
+
]
|
|
234
231
|
}
|
|
235
232
|
]
|
|
236
233
|
},
|
|
@@ -249,7 +246,7 @@
|
|
|
249
246
|
"name": "results",
|
|
250
247
|
"steps": [
|
|
251
248
|
{
|
|
252
|
-
"expression": "
|
|
249
|
+
"expression": "sessionMemory.queryResult"
|
|
253
250
|
}
|
|
254
251
|
]
|
|
255
252
|
}
|
|
@@ -267,8 +264,14 @@
|
|
|
267
264
|
"transitions": [
|
|
268
265
|
{
|
|
269
266
|
"type": "immediate",
|
|
270
|
-
"condition": "
|
|
271
|
-
"destination": "ddd"
|
|
267
|
+
"condition": "currentStateOutput.answered",
|
|
268
|
+
"destination": "ddd",
|
|
269
|
+
"sessionMemory": [
|
|
270
|
+
{
|
|
271
|
+
"memoryPath": "answerResult",
|
|
272
|
+
"expression": "currentStateOutput.message"
|
|
273
|
+
}
|
|
274
|
+
]
|
|
272
275
|
},
|
|
273
276
|
{
|
|
274
277
|
"type": "immediate",
|
|
@@ -277,7 +280,13 @@
|
|
|
277
280
|
},
|
|
278
281
|
{
|
|
279
282
|
"type": "immediate",
|
|
280
|
-
"destination": "eee"
|
|
283
|
+
"destination": "eee",
|
|
284
|
+
"sessionMemory": [
|
|
285
|
+
{
|
|
286
|
+
"memoryPath": "answerResult",
|
|
287
|
+
"expression": "currentStateOutput.message"
|
|
288
|
+
}
|
|
289
|
+
]
|
|
281
290
|
}
|
|
282
291
|
]
|
|
283
292
|
},
|
|
@@ -288,7 +297,7 @@
|
|
|
288
297
|
"name": "results",
|
|
289
298
|
"steps": [
|
|
290
299
|
{
|
|
291
|
-
"expression": "
|
|
300
|
+
"expression": "sessionMemory.answerResult"
|
|
292
301
|
}
|
|
293
302
|
]
|
|
294
303
|
}
|
|
@@ -311,7 +320,7 @@
|
|
|
311
320
|
"name": "results",
|
|
312
321
|
"steps": [
|
|
313
322
|
{
|
|
314
|
-
"expression": "
|
|
323
|
+
"expression": "sessionMemory.answerResult"
|
|
315
324
|
}
|
|
316
325
|
]
|
|
317
326
|
}
|
|
@@ -329,53 +338,24 @@
|
|
|
329
338
|
}
|
|
330
339
|
},
|
|
331
340
|
"historyStrategies": {}
|
|
332
|
-
},
|
|
333
|
-
"chat": {
|
|
334
|
-
"api": {
|
|
335
|
-
"inputs": [
|
|
336
|
-
{
|
|
337
|
-
"name": "chat",
|
|
338
|
-
"type": "mutation",
|
|
339
|
-
"args": "TSChatArgs"
|
|
340
|
-
}
|
|
341
|
-
]
|
|
342
|
-
},
|
|
343
|
-
"start": {
|
|
344
|
-
"transitions": [
|
|
345
|
-
{
|
|
346
|
-
"type": "suspend",
|
|
347
|
-
"input": "chat",
|
|
348
|
-
"destination": "3pjuyB47X"
|
|
349
|
-
}
|
|
350
|
-
]
|
|
351
|
-
},
|
|
352
|
-
"states": {
|
|
353
|
-
"3pjuyB47X": {
|
|
354
|
-
"name": "chat",
|
|
355
|
-
"execution": {
|
|
356
|
-
"type": "chat",
|
|
357
|
-
"service": "openai",
|
|
358
|
-
"model": "gpt-4o",
|
|
359
|
-
"input": {
|
|
360
|
-
"type": "arg"
|
|
361
|
-
},
|
|
362
|
-
"systemPrompt": "You are a helpful assistant. If the user says they have no further questions, end your response with the string ALL_DONE."
|
|
363
|
-
},
|
|
364
|
-
"transitions": [
|
|
365
|
-
{
|
|
366
|
-
"type": "immediate",
|
|
367
|
-
"condition": "contains(currentStateOutput.content, 'ALL_DONE')",
|
|
368
|
-
"destination": "END"
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
"type": "suspend",
|
|
372
|
-
"destination": "3pjuyB47X",
|
|
373
|
-
"input": "chat"
|
|
374
|
-
}
|
|
375
|
-
]
|
|
376
|
-
}
|
|
377
|
-
},
|
|
378
|
-
"historyStrategies": {}
|
|
379
341
|
}
|
|
380
|
-
}
|
|
342
|
+
},
|
|
343
|
+
"services": {
|
|
344
|
+
"openai": {
|
|
345
|
+
"id": "openai",
|
|
346
|
+
"title": "OpenAI",
|
|
347
|
+
"namespace": "OpenAI",
|
|
348
|
+
"provider": "openai",
|
|
349
|
+
"serviceType": "openapi",
|
|
350
|
+
"authenticationType": "bearer",
|
|
351
|
+
"options": {
|
|
352
|
+
"endpoint": "https://api.openai.com/v1/",
|
|
353
|
+
"spec": "https://raw.githubusercontent.com/takeshape/openapi-specs/813784d8fcac5b3fd4e468ce6f715b89c9fcb73f/specs/openai/v2.yml",
|
|
354
|
+
"transformVersion": "2.0.0",
|
|
355
|
+
"introspectedAt": "2025-08-26T20:52:22.324Z"
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
},
|
|
359
|
+
"schemaVersion": "3.59.0",
|
|
360
|
+
"apiVersion": "2"
|
|
381
361
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projectId": "chat-agent-schema-project-id",
|
|
3
|
+
"defaultLocale": "en-us",
|
|
4
|
+
"locales": ["en-us"],
|
|
5
|
+
"queries": {},
|
|
6
|
+
"mutations": {},
|
|
7
|
+
"shapes": {},
|
|
8
|
+
"workflows": {},
|
|
9
|
+
"forms": {},
|
|
10
|
+
"agents": {
|
|
11
|
+
"chat": {
|
|
12
|
+
"api": {
|
|
13
|
+
"inputs": [{ "name": "chat", "type": "mutation", "args": "TSChatArgs" }]
|
|
14
|
+
},
|
|
15
|
+
"start": {
|
|
16
|
+
"transitions": [{ "type": "suspend", "input": "chat", "destination": "3pjuyB47X" }]
|
|
17
|
+
},
|
|
18
|
+
"states": {
|
|
19
|
+
"3pjuyB47X": {
|
|
20
|
+
"name": "chat",
|
|
21
|
+
"execution": {
|
|
22
|
+
"type": "chat",
|
|
23
|
+
"service": "openai",
|
|
24
|
+
"model": "gpt-4o",
|
|
25
|
+
"input": { "type": "arg" },
|
|
26
|
+
"systemPrompt": "You are a helpful assistant. If the user says they have no further questions, end your response with the string ALL_DONE."
|
|
27
|
+
},
|
|
28
|
+
"transitions": [
|
|
29
|
+
{
|
|
30
|
+
"type": "immediate",
|
|
31
|
+
"condition": "contains(currentStateOutput.content, 'ALL_DONE')",
|
|
32
|
+
"destination": "END"
|
|
33
|
+
},
|
|
34
|
+
{ "type": "suspend", "destination": "3pjuyB47X", "input": "chat" }
|
|
35
|
+
]
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"historyStrategies": {}
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"services": {
|
|
42
|
+
"openai": {
|
|
43
|
+
"id": "openai",
|
|
44
|
+
"title": "OpenAI",
|
|
45
|
+
"namespace": "OpenAI",
|
|
46
|
+
"provider": "openai",
|
|
47
|
+
"serviceType": "openapi",
|
|
48
|
+
"authenticationType": "bearer",
|
|
49
|
+
"options": {
|
|
50
|
+
"endpoint": "https://api.openai.com/v1/",
|
|
51
|
+
"spec": "https://raw.githubusercontent.com/takeshape/openapi-specs/813784d8fcac5b3fd4e468ce6f715b89c9fcb73f/specs/openai/v2.yml",
|
|
52
|
+
"transformVersion": "2.0.0",
|
|
53
|
+
"introspectedAt": "2025-08-26T20:52:22.324Z"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"schemaVersion": "3.59.0",
|
|
58
|
+
"apiVersion": "2"
|
|
59
|
+
}
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
{
|
|
2
|
+
"projectId": "generate-agent-schema-project-id",
|
|
3
|
+
"defaultLocale": "en-us",
|
|
4
|
+
"locales": ["en-us"],
|
|
5
|
+
"queries": {
|
|
6
|
+
"getDog": {
|
|
7
|
+
"shape": "Dog",
|
|
8
|
+
"resolver": {
|
|
9
|
+
"name": "shapedb:get",
|
|
10
|
+
"service": "shapedb",
|
|
11
|
+
"shapeName": "Dog"
|
|
12
|
+
},
|
|
13
|
+
"description": "Get a Dog by ID",
|
|
14
|
+
"args": "TSGetArgs<Dog>"
|
|
15
|
+
},
|
|
16
|
+
"getDogList": {
|
|
17
|
+
"shape": "PaginatedList<Dog>",
|
|
18
|
+
"resolver": {
|
|
19
|
+
"name": "shapedb:list",
|
|
20
|
+
"service": "shapedb",
|
|
21
|
+
"shapeName": "Dog"
|
|
22
|
+
},
|
|
23
|
+
"description": "Returns a list Dog in natural order..",
|
|
24
|
+
"args": "TSListArgs<Dog>"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"mutations": {
|
|
28
|
+
"updateDog": {
|
|
29
|
+
"shape": "UpdateResult<Dog>",
|
|
30
|
+
"resolver": {
|
|
31
|
+
"name": "shapedb:update",
|
|
32
|
+
"service": "shapedb",
|
|
33
|
+
"shapeName": "Dog"
|
|
34
|
+
},
|
|
35
|
+
"description": "Update Dog",
|
|
36
|
+
"args": "UpdateArgs<Dog>"
|
|
37
|
+
},
|
|
38
|
+
"createDog": {
|
|
39
|
+
"shape": "CreateResult<Dog>",
|
|
40
|
+
"resolver": {
|
|
41
|
+
"name": "shapedb:create",
|
|
42
|
+
"service": "shapedb",
|
|
43
|
+
"shapeName": "Dog"
|
|
44
|
+
},
|
|
45
|
+
"description": "Create Dog",
|
|
46
|
+
"args": "CreateArgs<Dog>"
|
|
47
|
+
},
|
|
48
|
+
"duplicateDog": {
|
|
49
|
+
"shape": "DuplicateResult<Dog>",
|
|
50
|
+
"resolver": {
|
|
51
|
+
"name": "shapedb:duplicate",
|
|
52
|
+
"service": "shapedb",
|
|
53
|
+
"shapeName": "Dog"
|
|
54
|
+
},
|
|
55
|
+
"description": "Duplicate Dog",
|
|
56
|
+
"args": "DuplicateArgs<Dog>"
|
|
57
|
+
},
|
|
58
|
+
"deleteDog": {
|
|
59
|
+
"shape": "DeleteResult<Dog>",
|
|
60
|
+
"resolver": {
|
|
61
|
+
"name": "shapedb:delete",
|
|
62
|
+
"service": "shapedb",
|
|
63
|
+
"shapeName": "Dog"
|
|
64
|
+
},
|
|
65
|
+
"description": "Delete Dog",
|
|
66
|
+
"args": "DeleteArgs<Dog>"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"shapes": {
|
|
70
|
+
"Dog": {
|
|
71
|
+
"id": "JXJvoPKf-",
|
|
72
|
+
"name": "Dog",
|
|
73
|
+
"title": "Dog",
|
|
74
|
+
"model": { "type": "multiple" },
|
|
75
|
+
"schema": {
|
|
76
|
+
"type": "object",
|
|
77
|
+
"properties": {
|
|
78
|
+
"name": {
|
|
79
|
+
"@mapping": "shapedb:Dog.tY4pFndjf",
|
|
80
|
+
"type": "string",
|
|
81
|
+
"title": "Name"
|
|
82
|
+
},
|
|
83
|
+
"color": {
|
|
84
|
+
"@mapping": "shapedb:Dog.yC42Im8Mq",
|
|
85
|
+
"type": "string",
|
|
86
|
+
"title": "Color"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"AnswerResponse": {
|
|
92
|
+
"id": "AnswerResponse",
|
|
93
|
+
"name": "AnswerResponse",
|
|
94
|
+
"title": "AnswerResponse",
|
|
95
|
+
"schema": {
|
|
96
|
+
"type": "object",
|
|
97
|
+
"properties": {
|
|
98
|
+
"answered": {
|
|
99
|
+
"description": "Set to true if you were able to answer the question",
|
|
100
|
+
"type": "boolean"
|
|
101
|
+
},
|
|
102
|
+
"message": {
|
|
103
|
+
"description": "Put your response here",
|
|
104
|
+
"type": "string"
|
|
105
|
+
},
|
|
106
|
+
"dogName": {
|
|
107
|
+
"description": "If the question is not answered, set the value of `dogName` to a similar dog name, eg change Franky to Frank.",
|
|
108
|
+
"type": "string"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"required": ["answered", "message"]
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"FindDogColorSessionMemory": {
|
|
115
|
+
"id": "NhJxAX3PQ",
|
|
116
|
+
"name": "FindDogColorSessionMemory",
|
|
117
|
+
"title": "Find Dog Color Session Memory",
|
|
118
|
+
"schema": {
|
|
119
|
+
"type": "object",
|
|
120
|
+
"properties": {
|
|
121
|
+
"queryResult": {
|
|
122
|
+
"@mapping": "shapedb:FindDogColorSessionMemory.vwYz10HDl",
|
|
123
|
+
"title": "Query Result",
|
|
124
|
+
"@ref": "Dog"
|
|
125
|
+
},
|
|
126
|
+
"answerResult": {
|
|
127
|
+
"@mapping": "shapedb:FindDogColorSessionMemory._E6AKVHKy",
|
|
128
|
+
"type": "string",
|
|
129
|
+
"title": "Answer"
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"workflows": {},
|
|
136
|
+
"forms": {
|
|
137
|
+
"Dog": {
|
|
138
|
+
"default": {
|
|
139
|
+
"properties": {
|
|
140
|
+
"name": { "widget": "singleLineText" },
|
|
141
|
+
"color": { "widget": "singleLineText" }
|
|
142
|
+
},
|
|
143
|
+
"order": ["name", "color"]
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"FindDogColorSessionMemory": {
|
|
147
|
+
"default": {
|
|
148
|
+
"properties": {
|
|
149
|
+
"queryResult": { "widget": "shapeObject" },
|
|
150
|
+
"answerResult": { "widget": "singleLineText" }
|
|
151
|
+
},
|
|
152
|
+
"order": ["queryResult", "answerResult"]
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"agents": {
|
|
157
|
+
"findDogColor": {
|
|
158
|
+
"description": "AI Agent finds a dog's color based on its name",
|
|
159
|
+
"api": {
|
|
160
|
+
"inputs": [{ "type": "mutation", "name": "findDogColor", "args": "TSGenerateArgs" }]
|
|
161
|
+
},
|
|
162
|
+
"memory": { "sessionMemory": { "shape": "FindDogColorSessionMemory" } },
|
|
163
|
+
"start": {
|
|
164
|
+
"transitions": [{ "type": "suspend", "destination": "bbb", "input": "findDogColor" }]
|
|
165
|
+
},
|
|
166
|
+
"states": {
|
|
167
|
+
"bbb": {
|
|
168
|
+
"name": "query",
|
|
169
|
+
"variables": [{ "name": "input", "steps": [{ "expression": "args.input" }] }],
|
|
170
|
+
"execution": {
|
|
171
|
+
"type": "graphql",
|
|
172
|
+
"query": "query ($input: String!) {\n getDogList(terms: $input) {\n items {\n name\n color\n }\n }\n}\n",
|
|
173
|
+
"path": "getDogList.items[0]"
|
|
174
|
+
},
|
|
175
|
+
"transitions": [
|
|
176
|
+
{
|
|
177
|
+
"type": "immediate",
|
|
178
|
+
"destination": "ccc",
|
|
179
|
+
"sessionMemory": [
|
|
180
|
+
{
|
|
181
|
+
"expression": "currentStateOutput",
|
|
182
|
+
"memoryPath": "queryResult"
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
},
|
|
188
|
+
"ccc": {
|
|
189
|
+
"name": "answer",
|
|
190
|
+
"variables": [
|
|
191
|
+
{ "name": "input", "steps": [{ "expression": "args.input" }] },
|
|
192
|
+
{
|
|
193
|
+
"name": "results",
|
|
194
|
+
"steps": [{ "expression": "sessionMemory.queryResult" }]
|
|
195
|
+
}
|
|
196
|
+
],
|
|
197
|
+
"execution": {
|
|
198
|
+
"type": "generate",
|
|
199
|
+
"service": "openai",
|
|
200
|
+
"model": "gpt-4o",
|
|
201
|
+
"input": {
|
|
202
|
+
"type": "template",
|
|
203
|
+
"inputTemplate": "Please respond with the color of this dog\n\n{{input}}\n\nif the answer is in this data:\n\n{{{json results}}}"
|
|
204
|
+
},
|
|
205
|
+
"outputShape": "AnswerResponse"
|
|
206
|
+
},
|
|
207
|
+
"transitions": [
|
|
208
|
+
{
|
|
209
|
+
"type": "immediate",
|
|
210
|
+
"condition": "currentStateOutput.answered",
|
|
211
|
+
"destination": "ddd",
|
|
212
|
+
"sessionMemory": [
|
|
213
|
+
{
|
|
214
|
+
"memoryPath": "answerResult",
|
|
215
|
+
"expression": "currentStateOutput.message"
|
|
216
|
+
}
|
|
217
|
+
]
|
|
218
|
+
},
|
|
219
|
+
{ "type": "immediate", "limit": 3, "destination": "bbb" },
|
|
220
|
+
{
|
|
221
|
+
"type": "immediate",
|
|
222
|
+
"destination": "eee",
|
|
223
|
+
"sessionMemory": [
|
|
224
|
+
{
|
|
225
|
+
"memoryPath": "answerResult",
|
|
226
|
+
"expression": "currentStateOutput.message"
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
]
|
|
231
|
+
},
|
|
232
|
+
"ddd": {
|
|
233
|
+
"name": "summarize",
|
|
234
|
+
"variables": [
|
|
235
|
+
{
|
|
236
|
+
"name": "results",
|
|
237
|
+
"steps": [{ "expression": "sessionMemory.answerResult" }]
|
|
238
|
+
}
|
|
239
|
+
],
|
|
240
|
+
"execution": {
|
|
241
|
+
"type": "generate",
|
|
242
|
+
"service": "openai",
|
|
243
|
+
"model": "gpt-4o",
|
|
244
|
+
"input": {
|
|
245
|
+
"type": "template",
|
|
246
|
+
"inputTemplate": "Please summarize this information:\n\n{{results}}"
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"transitions": []
|
|
250
|
+
},
|
|
251
|
+
"eee": {
|
|
252
|
+
"name": "apologize",
|
|
253
|
+
"variables": [
|
|
254
|
+
{
|
|
255
|
+
"name": "results",
|
|
256
|
+
"steps": [{ "expression": "sessionMemory.answerResult" }]
|
|
257
|
+
}
|
|
258
|
+
],
|
|
259
|
+
"execution": {
|
|
260
|
+
"type": "generate",
|
|
261
|
+
"service": "openai",
|
|
262
|
+
"model": "gpt-4o",
|
|
263
|
+
"input": {
|
|
264
|
+
"type": "template",
|
|
265
|
+
"inputTemplate": "Please provide a generic polite apology that there were no search results."
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"transitions": []
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"historyStrategies": {}
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
"services": {
|
|
275
|
+
"openai": {
|
|
276
|
+
"id": "openai",
|
|
277
|
+
"title": "OpenAI",
|
|
278
|
+
"namespace": "OpenAI",
|
|
279
|
+
"provider": "openai",
|
|
280
|
+
"serviceType": "openapi",
|
|
281
|
+
"authenticationType": "bearer",
|
|
282
|
+
"options": {
|
|
283
|
+
"endpoint": "https://api.openai.com/v1/",
|
|
284
|
+
"spec": "https://raw.githubusercontent.com/takeshape/openapi-specs/813784d8fcac5b3fd4e468ce6f715b89c9fcb73f/specs/openai/v2.yml",
|
|
285
|
+
"transformVersion": "2.0.0",
|
|
286
|
+
"introspectedAt": "2025-08-26T20:52:22.324Z"
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
},
|
|
290
|
+
"schemaVersion": "3.59.0",
|
|
291
|
+
"apiVersion": "2"
|
|
292
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takeshape/schema",
|
|
3
|
-
"version": "11.121.
|
|
3
|
+
"version": "11.121.6",
|
|
4
4
|
"description": "TakeShape Schema",
|
|
5
5
|
"homepage": "https://www.takeshape.io",
|
|
6
6
|
"repository": {
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"p-reduce": "2.1.0",
|
|
57
57
|
"semver": "7.7.2",
|
|
58
58
|
"tiny-invariant": "1.3.3",
|
|
59
|
-
"@takeshape/json-schema": "11.121.
|
|
60
|
-
"@takeshape/errors": "11.121.
|
|
61
|
-
"@takeshape/util": "11.121.
|
|
59
|
+
"@takeshape/json-schema": "11.121.6",
|
|
60
|
+
"@takeshape/errors": "11.121.6",
|
|
61
|
+
"@takeshape/util": "11.121.6"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@takeshape/json-schema-to-typescript": "11.0.0",
|
|
@@ -75,8 +75,8 @@
|
|
|
75
75
|
"glob": "7.2.3",
|
|
76
76
|
"json-schema-to-ts": "3.1.1",
|
|
77
77
|
"shortid": "2.2.16",
|
|
78
|
-
"@takeshape/logger": "11.121.
|
|
79
|
-
"@takeshape/infra": "11.121.
|
|
78
|
+
"@takeshape/logger": "11.121.6",
|
|
79
|
+
"@takeshape/infra": "11.121.6"
|
|
80
80
|
},
|
|
81
81
|
"engines": {
|
|
82
82
|
"node": ">=22"
|