Skip to content

Commit 88232cf

Browse files
committed
Update schema
Signed-off-by: Louis Mandel <[email protected]>
1 parent ff8bc52 commit 88232cf

File tree

2 files changed

+50
-6
lines changed

2 files changed

+50
-6
lines changed

pdl-live-react/src/pdl_ast.d.ts

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@ export type Description20 = string | null
158158
*
159159
*/
160160
export type Def = string | null
161+
/**
162+
* Values allowed in the `contribute` field.
163+
*/
161164
export type ContributeTarget = "result" | "context"
162165
export type Value = LocalizedExpression | unknown[] | string
163166
export type Path = string[]
@@ -3075,9 +3078,9 @@ export interface Defs1 {
30753078
*
30763079
* Example:
30773080
* ```PDL
3078-
* - model: ollama/granite-code:8b
3079-
* parameters:
3080-
* stop: ['!']
3081+
* model: ollama/granite-code:8b
3082+
* parameters:
3083+
* stop: ['!']
30813084
* ```
30823085
*/
30833086
export interface LitellmModelBlock {
@@ -4688,6 +4691,9 @@ export interface Defs20 {
46884691
| EmptyBlock
46894692
| null
46904693
}
4694+
/**
4695+
* Contribution of a specific value instead of the default one.
4696+
*/
46914697
export interface ContributeValue {
46924698
value: Value
46934699
}
@@ -4710,6 +4716,9 @@ export interface PdlLocationType {
47104716
export interface Table {
47114717
[k: string]: number
47124718
}
4719+
/**
4720+
* Use a PDL program as a parser specification (experimental).
4721+
*/
47134722
export interface PdlParser {
47144723
description?: Description21
47154724
spec?:
@@ -4734,7 +4743,7 @@ export interface PdlParser {
47344743
pdl: Pdl
47354744
}
47364745
/**
4737-
* A regular expression parser
4746+
* A regular expression parser.
47384747
*/
47394748
export interface RegexParser {
47404749
description?: Description22
@@ -4769,16 +4778,28 @@ export interface PdlTiming {
47694778
first_use_nanos?: FirstUseNanos
47704779
timezone?: Timezone
47714780
}
4781+
/**
4782+
* Join loop iterations as a string.
4783+
*/
47724784
export interface JoinText {
47734785
as?: As
47744786
with?: With
47754787
}
4788+
/**
4789+
* Join loop iterations as an array.
4790+
*/
47764791
export interface JoinArray {
47774792
as: As1
47784793
}
4794+
/**
4795+
* Join loop iterations as an object.
4796+
*/
47794797
export interface JoinObject {
47804798
as: As2
47814799
}
4800+
/**
4801+
* Join loop iterations as the value of the last iteration.
4802+
*/
47824803
export interface JoinLastOf {
47834804
as: As3
47844805
}
@@ -4793,14 +4814,23 @@ export interface MatchCase {
47934814
pdl__if_result?: PdlIfResult
47944815
pdl__matched?: PdlMatched
47954816
}
4817+
/**
4818+
* Match any of the patterns.
4819+
*/
47964820
export interface OrPattern {
47974821
def?: Def12
47984822
anyOf: Anyof
47994823
}
4824+
/**
4825+
* Match an array.
4826+
*/
48004827
export interface ArrayPattern {
48014828
def?: Def13
48024829
array: Array1
48034830
}
4831+
/**
4832+
* Match an object.
4833+
*/
48044834
export interface ObjectPattern {
48054835
def?: Def14
48064836
object: Object2
@@ -4816,6 +4846,9 @@ export interface Object2 {
48164846
| AnyPattern
48174847
| null
48184848
}
4849+
/**
4850+
* Match any value.
4851+
*/
48194852
export interface AnyPattern {
48204853
def?: Def15
48214854
any: Any

src/pdl/pdl-schema.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$defs": {
33
"AnyPattern": {
44
"additionalProperties": false,
5+
"description": "Match any value.",
56
"properties": {
67
"def": {
78
"anyOf": [
@@ -897,6 +898,7 @@
897898
},
898899
"ArrayPattern": {
899900
"additionalProperties": false,
901+
"description": "Match an array.",
900902
"properties": {
901903
"def": {
902904
"anyOf": [
@@ -1917,6 +1919,7 @@
19171919
"type": "object"
19181920
},
19191921
"ContributeTarget": {
1922+
"description": "Values allowed in the `contribute` field.",
19201923
"enum": [
19211924
"result",
19221925
"context"
@@ -1926,6 +1929,7 @@
19261929
},
19271930
"ContributeValue": {
19281931
"additionalProperties": false,
1932+
"description": "Contribution of a specific value instead of the default one.",
19291933
"properties": {
19301934
"value": {
19311935
"anyOf": [
@@ -6185,6 +6189,7 @@
61856189
},
61866190
"JoinArray": {
61876191
"additionalProperties": false,
6192+
"description": "Join loop iterations as an array.",
61886193
"properties": {
61896194
"as": {
61906195
"const": "array",
@@ -6201,6 +6206,7 @@
62016206
},
62026207
"JoinLastOf": {
62036208
"additionalProperties": false,
6209+
"description": "Join loop iterations as the value of the last iteration.",
62046210
"properties": {
62056211
"as": {
62066212
"const": "lastOf",
@@ -6217,6 +6223,7 @@
62176223
},
62186224
"JoinObject": {
62196225
"additionalProperties": false,
6226+
"description": "Join loop iterations as an object.",
62206227
"properties": {
62216228
"as": {
62226229
"const": "object",
@@ -6233,6 +6240,7 @@
62336240
},
62346241
"JoinText": {
62356242
"additionalProperties": false,
6243+
"description": "Join loop iterations as a string.",
62366244
"properties": {
62376245
"as": {
62386246
"const": "text",
@@ -6747,7 +6755,7 @@
67476755
},
67486756
"LitellmModelBlock": {
67496757
"additionalProperties": false,
6750-
"description": "Call an LLM through [the LiteLLM API](https://docs.litellm.ai/).\n\nExample:\n```PDL\n- model: ollama/granite-code:8b\n parameters:\n stop: ['!']\n```",
6758+
"description": "Call an LLM through [the LiteLLM API](https://docs.litellm.ai/).\n\nExample:\n```PDL\nmodel: ollama/granite-code:8b\nparameters:\n stop: ['!']\n```",
67516759
"properties": {
67526760
"description": {
67536761
"anyOf": [
@@ -9365,6 +9373,7 @@
93659373
},
93669374
"ObjectPattern": {
93679375
"additionalProperties": false,
9376+
"description": "Match an object.",
93689377
"properties": {
93699378
"def": {
93709379
"anyOf": [
@@ -9454,6 +9463,7 @@
94549463
},
94559464
"OrPattern": {
94569465
"additionalProperties": false,
9466+
"description": "Match any of the patterns.",
94579467
"properties": {
94589468
"def": {
94599469
"anyOf": [
@@ -9625,6 +9635,7 @@
96259635
},
96269636
"PdlParser": {
96279637
"additionalProperties": false,
9638+
"description": "Use a PDL program as a parser specification (experimental).",
96289639
"properties": {
96299640
"description": {
96309641
"anyOf": [
@@ -10360,7 +10371,7 @@
1036010371
},
1036110372
"RegexParser": {
1036210373
"additionalProperties": false,
10363-
"description": "A regular expression parser",
10374+
"description": "A regular expression parser.",
1036410375
"properties": {
1036510376
"description": {
1036610377
"anyOf": [

0 commit comments

Comments
 (0)