@takeshape/schema 11.17.3 → 11.17.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.
@@ -0,0 +1,601 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://schema.takeshape.io/project-schema/experimental#",
4
+ "definitions": {
5
+ "agent": {
6
+ "title": "Agent JSON",
7
+ "description": "An Agent is a configuration for an AI service such as a chat bot or a search engine.",
8
+ "type": "object",
9
+ "properties": {
10
+ "description": {
11
+ "type": "string"
12
+ },
13
+ "states": {
14
+ "$ref": "#/definitions/agentStateMap"
15
+ }
16
+ },
17
+ "required": ["states"],
18
+ "additionalProperties": false
19
+ },
20
+ "agentVariable": {
21
+ "title": "Agent Variable",
22
+ "type": "object",
23
+ "properties": {
24
+ "name": {
25
+ "type": "string"
26
+ },
27
+ "steps": {
28
+ "description": "These are evaluated in order until a value is found.",
29
+ "type": "array",
30
+ "items": {
31
+ "$ref": "#/definitions/agentVariableStep"
32
+ }
33
+ }
34
+ },
35
+ "required": ["name", "steps"],
36
+ "additionalProperties": false
37
+ },
38
+ "agentVariableStep": {
39
+ "title": "Agent Variable Step",
40
+ "discriminator": {
41
+ "propertyName": "type"
42
+ },
43
+ "oneOf": [
44
+ {
45
+ "$ref": "#/definitions/agentVariableStepGraphqlArg"
46
+ },
47
+ {
48
+ "$ref": "#/definitions/agentVariableStepStateOutput"
49
+ },
50
+ {
51
+ "$ref": "#/definitions/agentVariableStepPreviousStateOutput"
52
+ }
53
+ ]
54
+ },
55
+ "agentVariableStepGraphqlArg": {
56
+ "title": "Agent Variable Step GraphQL Arg",
57
+ "description": "An Agent Variable that defines a GraphQL argument and makes its value available to templates.",
58
+ "type": "object",
59
+ "properties": {
60
+ "type": {
61
+ "enum": ["graphqlArg"]
62
+ },
63
+ "argName": {
64
+ "type": "string"
65
+ }
66
+ },
67
+ "required": ["type", "argName"],
68
+ "additionalProperties": false
69
+ },
70
+ "agentVariableStepPreviousStateOutput": {
71
+ "title": "Agent Variable Step Previous State Output",
72
+ "description": "An Agent Variable that provides the output of the previous state's execution.",
73
+ "type": "object",
74
+ "properties": {
75
+ "type": {
76
+ "enum": ["previousStateOutput"]
77
+ },
78
+ "path": {
79
+ "type": "string"
80
+ }
81
+ },
82
+ "required": ["type"],
83
+ "additionalProperties": false
84
+ },
85
+ "agentVariableStepStateOutput": {
86
+ "title": "Agent Variable Step State Output",
87
+ "description": "An Agent Variable that provides the output of any previous state's execution.",
88
+ "type": "object",
89
+ "properties": {
90
+ "type": {
91
+ "enum": ["stateOutput"]
92
+ },
93
+ "stateId": {
94
+ "type": "string",
95
+ "pattern": "^[0-9A-Za-z_]+$"
96
+ },
97
+ "path": {
98
+ "type": "string"
99
+ }
100
+ },
101
+ "required": ["type", "stateId"],
102
+ "additionalProperties": false
103
+ },
104
+ "agentStateMap": {
105
+ "title": "Agent States",
106
+ "description": "States that are traversed during the execution of an agent.",
107
+ "type": "object",
108
+ "patternProperties": {
109
+ "^[0-9A-Za-z_]+$": {
110
+ "$ref": "#/definitions/agentState"
111
+ }
112
+ },
113
+ "additionalProperties": false
114
+ },
115
+ "agentState": {
116
+ "title": "Agent State",
117
+ "description": "One step of an agent's execution.",
118
+ "type": "object",
119
+ "properties": {
120
+ "name": {
121
+ "type": "string"
122
+ },
123
+ "variables": {
124
+ "title": "Variables",
125
+ "type": "array",
126
+ "items": {
127
+ "$ref": "#/definitions/agentVariable"
128
+ }
129
+ },
130
+ "execution": {
131
+ "$ref": "#/definitions/agentExecution"
132
+ },
133
+ "transition": {
134
+ "title": "Agent State Transition",
135
+ "description": "These are evaluated in order until a destination is found.",
136
+ "type": "array",
137
+ "items": {
138
+ "default": {
139
+ "valueCheck": {
140
+ "type": "none"
141
+ }
142
+ },
143
+ "$ref": "#/definitions/agentTransition"
144
+ }
145
+ }
146
+ },
147
+ "required": ["name", "execution"],
148
+ "additionalProperties": false
149
+ },
150
+ "agentExecution": {
151
+ "title": "Agent Execution",
152
+ "discriminator": {
153
+ "propertyName": "type"
154
+ },
155
+ "oneOf": [
156
+ {
157
+ "$ref": "#/definitions/agentExecutionNoop"
158
+ },
159
+ {
160
+ "$ref": "#/definitions/agentExecutionInput"
161
+ },
162
+ {
163
+ "$ref": "#/definitions/agentExecutionGraphql"
164
+ },
165
+ {
166
+ "$ref": "#/definitions/agentExecutionGenerateText"
167
+ },
168
+ {
169
+ "$ref": "#/definitions/agentExecutionChat"
170
+ }
171
+ ]
172
+ },
173
+ "agentExecutionNoop": {
174
+ "title": "Agent Execution No Operation",
175
+ "type": "object",
176
+ "properties": {
177
+ "type": {
178
+ "enum": ["noop"]
179
+ }
180
+ },
181
+ "required": ["type"],
182
+ "additionalProperties": false
183
+ },
184
+ "agentExecutionInputArgument": {
185
+ "title": "Agent Execution Input Argument",
186
+ "type": "object",
187
+ "properties": {
188
+ "argName": {
189
+ "type": "string",
190
+ "pattern": "^[0-9A-Za-z_]+$"
191
+ },
192
+ "argType": {
193
+ "enum": ["boolean", "integer", "number", "string"]
194
+ },
195
+ "required": {
196
+ "type": "boolean"
197
+ }
198
+ },
199
+ "required": ["argName", "argType"],
200
+ "additionalProperties": false
201
+ },
202
+ "agentExecutionInput": {
203
+ "title": "Agent Execution Input",
204
+ "type": "object",
205
+ "properties": {
206
+ "type": {
207
+ "enum": ["input"]
208
+ },
209
+ "name": {
210
+ "type": "string",
211
+ "pattern": "^[0-9A-Za-z_]+$"
212
+ },
213
+ "inputType": {
214
+ "enum": ["query", "mutation"]
215
+ },
216
+ "arguments": {
217
+ "type": "array",
218
+ "items": {
219
+ "$ref": "#/definitions/agentExecutionInputArgument"
220
+ }
221
+ }
222
+ },
223
+ "required": ["type", "name", "inputType"],
224
+ "additionalProperties": false
225
+ },
226
+ "agentExecutionGraphql": {
227
+ "title": "Agent Execution GraphQL",
228
+ "type": "object",
229
+ "properties": {
230
+ "type": {
231
+ "enum": ["graphql"]
232
+ },
233
+ "query": {
234
+ "type": "string"
235
+ },
236
+ "path": {
237
+ "type": "string"
238
+ }
239
+ },
240
+ "required": ["type", "query"],
241
+ "additionalProperties": false
242
+ },
243
+ "agentAiStateInputArg": {
244
+ "title": "Agent AI State Input Argument",
245
+ "type": "object",
246
+ "properties": {
247
+ "type": {
248
+ "enum": ["arg"]
249
+ },
250
+ "inputArgName": {
251
+ "type": "string"
252
+ }
253
+ },
254
+ "required": ["type", "inputArgName"]
255
+ },
256
+ "agentAiStateInputTemplate": {
257
+ "title": "Agent AI State Input Template",
258
+ "type": "object",
259
+ "properties": {
260
+ "type": {
261
+ "enum": ["template"]
262
+ },
263
+ "inputTemplate": {
264
+ "type": "string"
265
+ }
266
+ },
267
+ "required": ["type", "inputTemplate"]
268
+ },
269
+ "agentAiStateInput": {
270
+ "title": "Agent AI State Input",
271
+ "type": "object",
272
+ "discriminator": {
273
+ "propertyName": "type"
274
+ },
275
+ "oneOf": [
276
+ {
277
+ "$ref": "#/definitions/agentAiStateInputArg"
278
+ },
279
+ {
280
+ "$ref": "#/definitions/agentAiStateInputTemplate"
281
+ }
282
+ ]
283
+ },
284
+ "agentGenerateOptions": {
285
+ "title": "AgentGenerateOptions",
286
+ "type": "object",
287
+ "properties": {
288
+ "history": {
289
+ "title": "history",
290
+ "type": "boolean"
291
+ },
292
+ "maxTokens": {
293
+ "type": "integer",
294
+ "title": "Maximum Tokens",
295
+ "description": "Maximum number of tokens to generate."
296
+ },
297
+ "temperature": {
298
+ "type": "number",
299
+ "title": "Temperature",
300
+ "description": "This is a number between 0 (almost no randomness) and 1 (very random). It is recommended to set either `temperature` or `topP`, but not both. Defaults to 0",
301
+ "minimum": 0,
302
+ "maximum": 1
303
+ },
304
+ "topP": {
305
+ "type": "number",
306
+ "title": "Top P",
307
+ "description": "Nucleus sampling. This is a number between 0 and 1. E.g. 0.1 would mean that only tokens with the top 10% probability mass are considered. It is recommended to set either `temperature` or `topP`, but not both.",
308
+ "minimum": 0,
309
+ "maximum": 1
310
+ },
311
+ "topK": {
312
+ "type": "number",
313
+ "title": "Top K",
314
+ "description": "Only sample from the top K options for each subsequent token. Used to remove \"long tail\" low probability responses. Recommended for advanced use cases only. You usually only need to use temperature."
315
+ },
316
+ "presencePenalty": {
317
+ "type": "number",
318
+ "title": "Presence penalty setting",
319
+ "description": "It affects the likelihood of the model to repeat information that is already in the prompt. The presence penalty is a number between -1 (increase repetition) and 1 (maximum penalty, decrease repetition). 0 means no penalty.",
320
+ "minimum": -1,
321
+ "maximum": 1
322
+ },
323
+ "frequencyPenalty": {
324
+ "type": "number",
325
+ "title": "Frequency penalty setting",
326
+ "description": "It affects the likelihood of the model to repeatedly use the same words or phrases. The frequency penalty is a number between -1 (increase repetition) and 1 (maximum penalty, decrease repetition). 0 means no penalty.",
327
+ "minimum": -1,
328
+ "maximum": 1
329
+ },
330
+ "stopSequences": {
331
+ "title": "Stop sequences",
332
+ "description": "If set, the model will stop generating text when one of the stop sequences is generated.",
333
+ "type": "array",
334
+ "items": {
335
+ "type": "string"
336
+ }
337
+ },
338
+ "seed": {
339
+ "type": "integer",
340
+ "title": "Seed",
341
+ "description": " The seed (integer) to use for random sampling. If set and supported by the model, calls will generate deterministic results."
342
+ },
343
+ "maxRetries": {
344
+ "type": "integer",
345
+ "description": "Maximum number of retries. Set to 0 to disable retries. Defaults to 2"
346
+ },
347
+ "toolChoice": {
348
+ "type": "string",
349
+ "description": "The tool choice strategy. Default: 'auto'",
350
+ "anyOf": [
351
+ {
352
+ "enum": ["auto", "none", "required"]
353
+ },
354
+ {
355
+ "type": "string"
356
+ }
357
+ ]
358
+ },
359
+ "maxToolRoundtrips": {
360
+ "type": "integer",
361
+ "description": "Maximal number of automatic roundtrips for tool calls."
362
+ }
363
+ },
364
+ "additionalProperties": false
365
+ },
366
+ "agentSimilarityGuardrail": {
367
+ "title": "AgentSimilarityGuardrail",
368
+ "type": "object",
369
+ "properties": {
370
+ "name": {
371
+ "enum": ["similarity"]
372
+ },
373
+ "shape": {
374
+ "type": "string"
375
+ },
376
+ "defaultResponse": {
377
+ "type": "string"
378
+ },
379
+ "threshold": {
380
+ "type": "number"
381
+ }
382
+ },
383
+ "required": ["name", "shape", "defaultResponse"],
384
+ "additionalProperties": false
385
+ },
386
+ "agentGuardrail": {
387
+ "title": "AgentGuardrail",
388
+ "discriminator": {
389
+ "propertyName": "name"
390
+ },
391
+ "oneOf": [
392
+ {
393
+ "$ref": "#/definitions/agentSimilarityGuardrail"
394
+ }
395
+ ]
396
+ },
397
+ "agentToolConfig": {
398
+ "title": "AgentToolConfig",
399
+ "type": "object",
400
+ "properties": {
401
+ "ref": {
402
+ "type": "string"
403
+ },
404
+ "selectionSet": {
405
+ "type": "string"
406
+ }
407
+ },
408
+ "required": ["ref"],
409
+ "additionalProperties": false
410
+ },
411
+ "agentExecutionGenerateText": {
412
+ "title": "Agent Execution Generate Text",
413
+ "type": "object",
414
+ "properties": {
415
+ "type": {
416
+ "enum": ["generateText"]
417
+ },
418
+ "service": {
419
+ "type": "string"
420
+ },
421
+ "model": {
422
+ "type": "string"
423
+ },
424
+ "systemPrompt": {
425
+ "type": "string"
426
+ },
427
+ "input": {
428
+ "$ref": "#/definitions/agentAiStateInput"
429
+ },
430
+ "jsonSchema": {
431
+ "type": "string"
432
+ },
433
+ "tools": {
434
+ "type": "array",
435
+ "items": {
436
+ "$ref": "#/definitions/agentToolConfig"
437
+ }
438
+ },
439
+ "guardrails": {
440
+ "type": "array",
441
+ "items": {
442
+ "$ref": "#/definitions/agentGuardrail"
443
+ }
444
+ },
445
+ "options": {
446
+ "$ref": "#/definitions/agentGenerateOptions"
447
+ }
448
+ },
449
+ "required": ["type", "service", "model", "input"],
450
+ "additionalProperties": false
451
+ },
452
+ "agentExecutionChat": {
453
+ "title": "Agent Execution Chat",
454
+ "type": "object",
455
+ "properties": {
456
+ "type": {
457
+ "enum": ["chat"]
458
+ },
459
+ "service": {
460
+ "type": "string"
461
+ },
462
+ "model": {
463
+ "type": "string"
464
+ },
465
+ "systemPrompt": {
466
+ "type": "string"
467
+ },
468
+ "input": {
469
+ "$ref": "#/definitions/agentAiStateInput"
470
+ },
471
+ "tools": {
472
+ "type": "array",
473
+ "items": {
474
+ "$ref": "#/definitions/agentToolConfig"
475
+ }
476
+ },
477
+ "sessionArg": {
478
+ "type": "string"
479
+ },
480
+ "guardrails": {
481
+ "type": "array",
482
+ "items": {
483
+ "$ref": "#/definitions/agentGuardrail"
484
+ }
485
+ },
486
+ "options": {
487
+ "$ref": "#/definitions/agentGenerateOptions"
488
+ }
489
+ },
490
+ "required": ["type", "service", "model", "input", "sessionArg"],
491
+ "additionalProperties": false
492
+ },
493
+ "agentValueCheckNone": {
494
+ "title": "Agent Value Check None",
495
+ "type": "object",
496
+ "properties": {
497
+ "type": {
498
+ "enum": ["none"]
499
+ }
500
+ },
501
+ "required": ["type"]
502
+ },
503
+ "agentValueCheckBoolean": {
504
+ "title": "Agent Value Check Boolean",
505
+ "type": "object",
506
+ "properties": {
507
+ "type": {
508
+ "enum": ["boolean"]
509
+ },
510
+ "path": {
511
+ "type": "string"
512
+ },
513
+ "negated": {
514
+ "type": "boolean"
515
+ }
516
+ },
517
+ "required": ["type", "path"]
518
+ },
519
+ "agentTransition": {
520
+ "title": "Agent Transition",
521
+ "type": "object",
522
+ "properties": {
523
+ "valueCheck": {
524
+ "discriminator": {
525
+ "propertyName": "type"
526
+ },
527
+ "oneOf": [
528
+ {
529
+ "$ref": "#/definitions/agentValueCheckNone"
530
+ },
531
+ {
532
+ "$ref": "#/definitions/agentValueCheckBoolean"
533
+ }
534
+ ]
535
+ },
536
+ "limit": {
537
+ "type": "integer"
538
+ },
539
+ "destination": {
540
+ "type": "string",
541
+ "pattern": "^[0-9A-Za-z_]+$"
542
+ }
543
+ },
544
+ "additionalProperties": false,
545
+ "required": ["valueCheck", "destination"]
546
+ },
547
+ "agentMap": {
548
+ "title": "Agent Map",
549
+ "type": "object",
550
+ "patternProperties": {
551
+ "^[0-9A-Za-z_]+$": {
552
+ "$ref": "#/definitions/agent"
553
+ }
554
+ },
555
+ "additionalProperties": false
556
+ },
557
+ "aiExperimental": {
558
+ "title": "AI Experimental",
559
+ "type": "object",
560
+ "properties": {
561
+ "agents": {
562
+ "$ref": "#/definitions/agentMap",
563
+ "description": "An Agent is a configuration for an AI service such as a chat bot or a search engine."
564
+ }
565
+ },
566
+ "additionalProperties": false
567
+ },
568
+ "aiRunAgentResolver": {
569
+ "title": "AIRunAgentResolver",
570
+ "type": "object",
571
+ "properties": {
572
+ "id": {
573
+ "type": "string",
574
+ "pattern": "^(?=[a-zA-Z])[-_a-zA-Z0-9]+$"
575
+ },
576
+ "name": {
577
+ "title": "AI Resolver Name",
578
+ "type": "string",
579
+ "description": "Name of the resolver function.",
580
+ "enum": [
581
+ "ai:runAgent"
582
+ ]
583
+ },
584
+ "agentName": {
585
+ "type": "string",
586
+ "pattern": "^[0-9A-Za-z_]+$"
587
+ },
588
+ "inputStateId": {
589
+ "type": "string",
590
+ "pattern": "^[0-9A-Za-z_]+$"
591
+ }
592
+ },
593
+ "required": [
594
+ "name",
595
+ "agentName",
596
+ "inputStateId"
597
+ ],
598
+ "additionalProperties": false
599
+ }
600
+ }
601
+ }