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