From 634a94dda0ad785fe8fe92944b822436892973b4 Mon Sep 17 00:00:00 2001 From: Louis Mandel Date: Tue, 29 Jul 2025 15:44:48 -0400 Subject: [PATCH 01/10] refactor: refactor AST to generate simpler JSON Schema Signed-off-by: Louis Mandel --- pdl-live-react/src/pdl_ast.d.ts | 3808 ++++++------------- src/pdl/pdl-schema.json | 6290 +++---------------------------- src/pdl/pdl_ast.py | 6 +- 3 files changed, 1577 insertions(+), 8527 deletions(-) diff --git a/pdl-live-react/src/pdl_ast.d.ts b/pdl-live-react/src/pdl_ast.d.ts index 4fb0710ee..dcda39044 100644 --- a/pdl-live-react/src/pdl_ast.d.ts +++ b/pdl-live-react/src/pdl_ast.d.ts @@ -68,111 +68,38 @@ export type PdlTypeType = } | null export type Type = string | string[] +export type BlockType = + | boolean + | number + | string + | FunctionBlock + | CallBlock + | LitellmModelBlock + | GraniteioModelBlock + | CodeBlock + | ArgsBlock + | GetBlock + | DataBlock + | IfBlock + | MatchBlock + | RepeatBlock + | MapBlock + | TextBlock + | LastOfBlock + | ArrayBlock + | ObjectBlock + | MessageBlock + | ReadBlock + | IncludeBlock + | ImportBlock + | ErrorBlock + | EmptyBlock + | null /** * Documentation associated to the block. * */ export type Description1 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description2 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description3 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description4 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description5 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description6 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description7 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description8 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description9 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description10 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description11 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description12 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description13 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description14 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description15 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description16 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description17 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description18 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description19 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description20 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description21 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -203,68 +130,10 @@ export type Parser = | PdlParser | RegexParser | null -export type Description22 = string | null -export type Pdl = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null -export type Description23 = string | null +export type Description2 = string | null +export type Description3 = string | null export type Regex = string export type Mode = "search" | "match" | "fullmatch" | "split" | "findall" -/** - * Block to execute in case of error. - * - */ -export type Fallback = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -300,7 +169,17 @@ export type EndNanos = number | null export type FirstUseNanos = number | null export type Timezone = string | null export type PdlIsLeaf = true -export type Kind = "empty" +export type Kind = "call" +/** + * Function to call. + * + */ +export type Call = LocalizedExpression | FunctionBlock | string +/** + * Documentation associated to the block. + * + */ +export type Description4 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -324,37 +203,6 @@ export type Parser1 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback1 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -386,48 +234,17 @@ export type PdlContext1 = */ export type PdlId1 = string | null export type PdlIsLeaf1 = true -export type Kind1 = "error" +export type Kind1 = "model" /** - * Error message. + * Documentation associated to the block. * */ -export type Msg = string +export type Description5 = string | null /** - * Block that raised the error. + * Name of the variable used to store the result of the execution of the block. * */ -export type Program1 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def2 = string | null +export type Def2 = string | null /** * Indicate if the block contributes to the result and background context. * @@ -446,37 +263,6 @@ export type Parser2 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback2 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -508,39 +294,12 @@ export type PdlContext2 = */ export type PdlId2 = string | null export type PdlIsLeaf2 = true -export type Kind2 = "import" +export type Kind2 = "model" /** - * Name of the file to import. + * Documentation associated to the block. * */ -export type Import = string -export type PdlTrace = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null +export type Description6 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -564,37 +323,6 @@ export type Parser3 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback3 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -625,41 +353,18 @@ export type PdlContext3 = * */ export type PdlId3 = string | null -export type PdlIsLeaf3 = false -export type IndependentEnum = "independent" | "dependent" -export type Kind3 = "include" +export type PdlIsLeaf3 = true +export type Kind3 = "code" /** - * Name of the file to include. + * Programming language of the code. * */ -export type Include = string -export type PdlTrace1 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null +export type Lang = "python" | "command" | "jinja" | "pdl" | "ipython" +/** + * Documentation associated to the block. + * + */ +export type Description7 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -683,37 +388,6 @@ export type Parser4 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback4 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -745,22 +419,18 @@ export type PdlContext4 = */ export type PdlId4 = string | null export type PdlIsLeaf4 = true -export type Kind4 = "read" -/** - * Name of the file to read. If `None`, read the standard input. - * - */ -export type Read = LocalizedExpression | string | null +export type Kind4 = "code" +export type Lang1 = "command" /** - * Message to prompt the user to enter a value. + * The argument vector to spawn. * */ -export type Message = string | null +export type Args1 = (LocalizedExpression | string)[] /** - * Indicate if one or multiple lines should be read. + * Documentation associated to the block. * */ -export type Multiline = boolean +export type Description8 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -784,37 +454,6 @@ export type Parser5 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback5 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -846,45 +485,16 @@ export type PdlContext5 = */ export type PdlId5 = string | null export type PdlIsLeaf5 = true -export type Kind5 = "message" -/** - * Content of the message. - */ -export type Content = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null +export type Kind5 = "get" /** - * For example, the name of the tool that was invoked, for which this message is the tool response. + * Name of the variable to access. */ -export type Name = LocalizedExpression | string | null +export type Get = string /** - * The id of the tool invocation for which this message is the tool response. + * Documentation associated to the block. + * */ -export type ToolCallId = LocalizedExpression | string | null +export type Description9 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -909,38 +519,7 @@ export type Parser6 = | RegexParser | null /** - * Block to execute in case of error. - * - */ -export type Fallback6 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null -/** - * The maximum number of times to retry when an error occurs within a block. + * The maximum number of times to retry when an error occurs within a block. * */ export type Retry6 = number | null @@ -969,67 +548,17 @@ export type PdlContext6 = * */ export type PdlId6 = string | null -export type PdlIsLeaf6 = false -export type IndependentEnum1 = "independent" | "dependent" -export type Kind6 = "object" -export type Object1 = - | { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null - } - | ( - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null - )[] +export type PdlIsLeaf6 = true +export type Kind6 = "data" +/** + * Do not evaluate expressions inside strings. + */ +export type Raw = boolean +/** + * Documentation associated to the block. + * + */ +export type Description10 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -1053,37 +582,6 @@ export type Parser7 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback7 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1115,39 +613,18 @@ export type PdlContext7 = */ export type PdlId7 = string | null export type PdlIsLeaf7 = false -export type IndependentEnum2 = "independent" | "dependent" -export type Kind7 = "array" +export type IndependentEnum = "independent" | "dependent" +export type Kind7 = "if" /** - * Elements of the array. + * Condition. + * */ -export type Array = ( - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null -)[] +export type If = LocalizedExpression | boolean | string +/** + * Documentation associated to the block. + * + */ +export type Description11 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -1171,37 +648,6 @@ export type Parser8 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback8 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1233,44 +679,61 @@ export type PdlContext8 = */ export type PdlId8 = string | null export type PdlIsLeaf8 = false -export type IndependentEnum3 = "independent" | "dependent" -export type Kind8 = "lastOf" -/** - * Sequence of blocks to execute. - */ -export type Lastof = ( +export type IndependentEnum1 = "independent" | "dependent" +export type Kind8 = "match" +export type Case = | boolean | number | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock + | OrPattern + | ArrayPattern + | ObjectPattern + | AnyPattern + | null +export type Def9 = string | null +export type Def10 = string | null +export type Def11 = string | null +export type Def12 = string | null +export type Any = null +export type Array = ( + | boolean + | number + | string + | OrPattern + | ArrayPattern + | ObjectPattern + | AnyPattern + | null +)[] +export type Anyof = ( + | boolean + | number + | string + | OrPattern + | ArrayPattern + | ObjectPattern + | AnyPattern | null )[] +export type If1 = LocalizedExpression | boolean | string | null +export type PdlCaseResult = boolean | null +export type PdlIfResult = boolean | null +export type PdlMatched = boolean | null +/** + * List of cases to match. + * + */ +export type With = MatchCase[] +/** + * Documentation associated to the block. + * + */ +export type Description12 = string | null /** * Name of the variable used to store the result of the execution of the block. * */ -export type Def9 = string | null +export type Def13 = string | null /** * Indicate if the block contributes to the result and background context. * @@ -1289,37 +752,6 @@ export type Parser9 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback9 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1351,72 +783,35 @@ export type PdlContext9 = */ export type PdlId9 = string | null export type PdlIsLeaf9 = false -export type IndependentEnum4 = "independent" | "dependent" -export type Kind9 = "text" +export type IndependentEnum2 = "independent" | "dependent" +export type Kind9 = "repeat" /** - * Body of the text. + * Arrays to iterate over. * */ -export type Text = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | ( - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null - )[] - | null +export type For = { + [k: string]: LocalizedExpression | unknown[] | string +} | null /** - * Name of the variable used to store the result of the execution of the block. + * Name of the variable containing the loop iteration. * */ -export type Def10 = string | null +export type Index = string | null +/** + * Condition to stay at the beginning of the loop. + * + */ +export type While = LocalizedExpression | boolean | string +/** + * Documentation associated to the block. + * + */ +export type Description13 = string | null +/** + * Name of the variable used to store the result of the execution of the block. + * + */ +export type Def14 = string | null /** * Indicate if the block contributes to the result and background context. * @@ -1435,37 +830,6 @@ export type Parser10 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback10 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1497,126 +861,30 @@ export type PdlContext10 = */ export type PdlId10 = string | null export type PdlIsLeaf10 = false -export type IndependentEnum5 = "independent" | "dependent" +export type IndependentEnum3 = "independent" | "dependent" export type Kind10 = "map" /** * Arrays to iterate over. * */ -export type For = { +export type For1 = { [k: string]: LocalizedExpression | unknown[] | string } | null /** * Name of the variable containing the loop iteration. * */ -export type Index = string | null -/** - * Body of the iterator. - * - */ -export type Map = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null -/** - * Maximal number of iterations to perform. - * - */ -export type Maxiterations = LocalizedExpression | number | string | null -/** - * Define how to combine the result of each iteration. - * - */ -export type Join = JoinText | JoinArray | JoinObject | JoinLastOf | JoinReduce -/** - * String concatenation of the result of each iteration. - * - */ -export type As = "text" -/** - * String used to concatenate each iteration of the loop. - * - */ -export type With = string -/** - * Return the result of each iteration as an array. - * - */ -export type As1 = "array" -/** - * Return the union of the objects created at each iteration. - * - */ -export type As2 = "object" +export type Index1 = string | null /** - * Return the result of the last iteration. + * Documentation associated to the block. * */ -export type As3 = "lastOf" -export type As4 = "reduce" -/** - * Function used to combine the results. - */ -export type Reduce = LocalizedExpression | string -export type PdlTrace2 = - | ( - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null - )[] - | null +export type Description14 = string | null /** * Name of the variable used to store the result of the execution of the block. * */ -export type Def11 = string | null +export type Def15 = string | null /** * Indicate if the block contributes to the result and background context. * @@ -1635,37 +903,6 @@ export type Parser11 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback11 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1697,106 +934,23 @@ export type PdlContext11 = */ export type PdlId11 = string | null export type PdlIsLeaf11 = false -export type IndependentEnum6 = "independent" | "dependent" -export type Kind11 = "repeat" -/** - * Arrays to iterate over. - * - */ -export type For1 = { - [k: string]: LocalizedExpression | unknown[] | string -} | null -/** - * Name of the variable containing the loop iteration. - * - */ -export type Index1 = string | null -/** - * Condition to stay at the beginning of the loop. - * - */ -export type While = LocalizedExpression | boolean | string -/** - * Body of the loop. - * - */ -export type Repeat = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null -/** - * Condition to exit at the end of the loop. - * - */ -export type Until = LocalizedExpression | boolean | string +export type IndependentEnum4 = "independent" | "dependent" +export type Kind11 = "text" /** - * Maximal number of iterations to perform. + * Body of the text. * */ -export type Maxiterations1 = LocalizedExpression | number | string | null +export type Text = BlockType | BlockType[] /** - * Define how to combine the result of each iteration. + * Documentation associated to the block. * */ -export type Join1 = JoinText | JoinArray | JoinObject | JoinLastOf | JoinReduce -export type PdlTrace3 = - | ( - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null - )[] - | null +export type Description15 = string | null /** * Name of the variable used to store the result of the execution of the block. * */ -export type Def12 = string | null +export type Def16 = string | null /** * Indicate if the block contributes to the result and background context. * @@ -1815,37 +969,6 @@ export type Parser12 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback12 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1877,78 +1000,17 @@ export type PdlContext12 = */ export type PdlId12 = string | null export type PdlIsLeaf12 = false -export type IndependentEnum7 = "independent" | "dependent" -export type Kind12 = "match" -export type Case = - | boolean - | number - | string - | OrPattern - | ArrayPattern - | ObjectPattern - | AnyPattern - | null -export type Def13 = string | null -export type Def14 = string | null -export type Def15 = string | null -export type Def16 = string | null -export type Any = null -export type Array1 = ( - | boolean - | number - | string - | OrPattern - | ArrayPattern - | ObjectPattern - | AnyPattern - | null -)[] -export type Anyof = ( - | boolean - | number - | string - | OrPattern - | ArrayPattern - | ObjectPattern - | AnyPattern - | null -)[] -export type If = LocalizedExpression | boolean | string | null -export type Then = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null -export type PdlCaseResult = boolean | null -export type PdlIfResult = boolean | null -export type PdlMatched = boolean | null +export type IndependentEnum5 = "independent" | "dependent" +export type Kind12 = "lastOf" /** - * List of cases to match. + * Sequence of blocks to execute. + */ +export type Lastof = BlockType[] +/** + * Documentation associated to the block. * */ -export type With1 = MatchCase[] +export type Description16 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -1972,37 +1034,6 @@ export type Parser13 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback13 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -2034,75 +1065,17 @@ export type PdlContext13 = */ export type PdlId13 = string | null export type PdlIsLeaf13 = false -export type IndependentEnum8 = "independent" | "dependent" -export type Kind13 = "if" -/** - * Condition. - * - */ -export type If1 = LocalizedExpression | boolean | string +export type IndependentEnum6 = "independent" | "dependent" +export type Kind13 = "array" /** - * Branch to execute if the condition is true. - * + * Elements of the array. */ -export type Then1 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null +export type Array1 = BlockType[] /** - * Branch to execute if the condition is false. + * Documentation associated to the block. * */ -export type Else = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null +export type Description17 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -2126,37 +1099,6 @@ export type Parser14 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback14 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -2187,12 +1129,19 @@ export type PdlContext14 = * */ export type PdlId14 = string | null -export type PdlIsLeaf14 = true -export type Kind14 = "data" +export type PdlIsLeaf14 = false +export type IndependentEnum7 = "independent" | "dependent" +export type Kind14 = "object" +export type Object2 = + | { + [k: string]: BlockType + } + | BlockType[] /** - * Do not evaluate expressions inside strings. + * Documentation associated to the block. + * */ -export type Raw = boolean +export type Description18 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -2216,37 +1165,6 @@ export type Parser15 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback15 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -2278,11 +1196,12 @@ export type PdlContext15 = */ export type PdlId15 = string | null export type PdlIsLeaf15 = true -export type Kind15 = "get" +export type Kind15 = "message" /** - * Name of the variable to access. + * Documentation associated to the block. + * */ -export type Get = string +export type Description19 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -2306,37 +1225,6 @@ export type Parser16 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback16 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -2368,20 +1256,34 @@ export type PdlContext16 = */ export type PdlId16 = string | null export type PdlIsLeaf16 = true -export type Kind16 = "code" -export type Lang = "command" +export type Kind16 = "read" /** - * The argument vector to spawn. + * Name of the file to read. If `None`, read the standard input. * */ -export type Args = (LocalizedExpression | string)[] +export type Read = LocalizedExpression | string | null /** - * Name of the variable used to store the result of the execution of the block. + * Message to prompt the user to enter a value. * */ -export type Def21 = string | null +export type Message = string | null /** - * Indicate if the block contributes to the result and background context. + * Indicate if one or multiple lines should be read. + * + */ +export type Multiline = boolean +/** + * Documentation associated to the block. + * + */ +export type Description20 = string | null +/** + * Name of the variable used to store the result of the execution of the block. + * + */ +export type Def21 = string | null +/** + * Indicate if the block contributes to the result and background context. * */ export type Contribute17 = ( @@ -2398,37 +1300,6 @@ export type Parser17 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback17 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -2459,44 +1330,19 @@ export type PdlContext17 = * */ export type PdlId17 = string | null -export type PdlIsLeaf17 = true -export type Kind17 = "code" +export type PdlIsLeaf17 = false +export type IndependentEnum8 = "independent" | "dependent" +export type Kind17 = "include" /** - * Programming language of the code. + * Name of the file to include. * */ -export type Lang1 = "python" | "command" | "jinja" | "pdl" | "ipython" +export type Include = string /** - * Code to execute. + * Documentation associated to the block. * */ -export type Code = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null +export type Description21 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -2520,37 +1366,6 @@ export type Parser18 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback18 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -2582,66 +1397,17 @@ export type PdlContext18 = */ export type PdlId18 = string | null export type PdlIsLeaf18 = true -export type Kind18 = "model" -/** - * Messages to send to the model. - * - */ -export type Input = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null -/** - * Variable where to store the raw response of the model. - * - */ -export type Modelresponse = string | null -export type CompletionTokens = number | null -export type PromptTokens = number | null -export type PdlModelInput = - | { - [k: string]: unknown - }[] - | null +export type Kind18 = "import" /** - * Optional field to ensure that the block is using granite-io. + * Name of the file to import. * */ -export type Platform = "granite-io" +export type Import = string /** - * Parameters sent to the model. + * Documentation associated to the block. * */ -export type Parameters = - | LocalizedExpression - | { - [k: string]: unknown - } - | string - | null +export type Description22 = string | null /** * Name of the variable used to store the result of the execution of the block. * @@ -2665,37 +1431,6 @@ export type Parser19 = | PdlParser | RegexParser | null -/** - * Block to execute in case of error. - * - */ -export type Fallback19 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -2727,170 +1462,39 @@ export type PdlContext19 = */ export type PdlId19 = string | null export type PdlIsLeaf19 = true -export type Kind19 = "model" -/** - * Messages to send to the model. - * - */ -export type Input1 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null +export type Kind19 = "error" /** - * Variable where to store the raw response of the model. + * Error message. * */ -export type Modelresponse1 = string | null -export type PdlModelInput1 = - | { - [k: string]: unknown - }[] - | null +export type Msg = string /** - * Optional field to ensure that the block is using LiteLLM. + * Documentation associated to the block. * */ -export type Platform1 = "litellm" +export type Description23 = string | null /** - * Name of the model following the LiteLLM convention. + * Name of the variable used to store the result of the execution of the block. * */ -export type Model1 = LocalizedExpression | string +export type Def24 = string | null /** - * Parameters to send to the model. + * Indicate if the block contributes to the result and background context. * */ -export type Parameters1 = - | LitellmParameters - | LocalizedExpression +export type Contribute20 = ( + | ContributeTarget | { - [k: string]: unknown + [k: string]: ContributeValue } - | string - | null -export type Timeout = number | string | null -export type Temperature = number | string | null -export type TopP = number | string | null -export type N = number | string | null -export type Stop = string | string[] | null -export type MaxTokens = number | string | null -export type PresencePenalty = number | string | null -export type FrequencyPenalty = number | string | null -export type LogitBias = - | { - [k: string]: unknown - } - | string - | null -export type User = string | null -export type ResponseFormat = - | { - [k: string]: unknown - } - | string - | null -export type Seed = number | string | null -export type Tools = unknown[] | string | null -export type ToolChoice = - | string - | { - [k: string]: unknown - } - | null -export type Logprobs = boolean | string | null -export type TopLogprobs = number | string | null -export type ParallelToolCalls = boolean | string | null -export type ExtraHeaders = - | { - [k: string]: unknown - } - | string - | null -export type Functions = unknown[] | string | null -export type FunctionCall = string | null -export type BaseUrl = string | null -export type ApiVersion = string | null -export type ApiKey = string | null -export type ModelList = unknown[] | string | null -export type MockResponse = string | null -export type CustomLlmProvider = string | null -export type MaxRetries = number | string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def24 = string | null -/** - * Indicate if the block contributes to the result and background context. - * - */ -export type Contribute20 = ( - | ContributeTarget - | { - [k: string]: ContributeValue - } -)[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser20 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null -/** - * Block to execute in case of error. - * - */ -export type Fallback20 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock +)[] +/** + * Parser to use to construct a value out of a string result. + */ +export type Parser20 = + | ("json" | "jsonl" | "yaml") + | PdlParser + | RegexParser | null /** * The maximum number of times to retry when an error occurs within a block. @@ -2923,92 +1527,201 @@ export type PdlContext20 = */ export type PdlId20 = string | null export type PdlIsLeaf20 = true -export type Kind20 = "call" +export type Kind20 = "empty" /** - * Function to call. + * For example, the name of the tool that was invoked, for which this message is the tool response. + */ +export type Name = LocalizedExpression | string | null +/** + * The id of the tool invocation for which this message is the tool response. + */ +export type ToolCallId = LocalizedExpression | string | null +/** + * Maximal number of iterations to perform. * */ -export type Call = LocalizedExpression | FunctionBlock | string -export type PdlTrace4 = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock +export type Maxiterations = LocalizedExpression | number | string | null +/** + * Define how to combine the result of each iteration. + * + */ +export type Join = JoinText | JoinArray | JoinObject | JoinLastOf | JoinReduce +/** + * String concatenation of the result of each iteration. + * + */ +export type As = "text" +/** + * String used to concatenate each iteration of the loop. + * + */ +export type With1 = string +/** + * Return the result of each iteration as an array. + * + */ +export type As1 = "array" +/** + * Return the union of the objects created at each iteration. + * + */ +export type As2 = "object" +/** + * Return the result of the last iteration. + * + */ +export type As3 = "lastOf" +export type As4 = "reduce" +/** + * Function used to combine the results. + */ +export type Reduce = LocalizedExpression | string +export type PdlTrace = BlockType[] | null +/** + * Condition to exit at the end of the loop. + * + */ +export type Until = LocalizedExpression | boolean | string +/** + * Maximal number of iterations to perform. + * + */ +export type Maxiterations1 = LocalizedExpression | number | string | null +/** + * Define how to combine the result of each iteration. + * + */ +export type Join1 = JoinText | JoinArray | JoinObject | JoinLastOf | JoinReduce +export type PdlTrace1 = BlockType[] | null +/** + * Variable where to store the raw response of the model. + * + */ +export type Modelresponse = string | null +export type CompletionTokens = number | null +export type PromptTokens = number | null +export type PdlModelInput = + | { + [k: string]: unknown + }[] | null /** - * Name of the variable used to store the result of the execution of the block. + * Optional field to ensure that the block is using granite-io. * */ -export type Def25 = string | null +export type Platform = "granite-io" /** - * Indicate if the block contributes to the result and background context. + * Parameters sent to the model. * */ -export type Contribute21 = ( - | ContributeTarget +export type Parameters = + | LocalizedExpression | { - [k: string]: ContributeValue + [k: string]: unknown } -)[] + | string + | null /** - * Parser to use to construct a value out of a string result. + * Variable where to store the raw response of the model. + * */ -export type Parser21 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser +export type Modelresponse1 = string | null +export type PdlModelInput1 = + | { + [k: string]: unknown + }[] | null /** - * Block to execute in case of error. + * Optional field to ensure that the block is using LiteLLM. * */ -export type Fallback21 = - | boolean - | number +export type Platform1 = "litellm" +/** + * Name of the model following the LiteLLM convention. + * + */ +export type Model1 = LocalizedExpression | string +/** + * Parameters to send to the model. + * + */ +export type Parameters1 = + | LitellmParameters + | LocalizedExpression + | { + [k: string]: unknown + } | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock + | null +export type Timeout = number | string | null +export type Temperature = number | string | null +export type TopP = number | string | null +export type N = number | string | null +export type Stop = string | string[] | null +export type MaxTokens = number | string | null +export type PresencePenalty = number | string | null +export type FrequencyPenalty = number | string | null +export type LogitBias = + | { + [k: string]: unknown + } + | string + | null +export type User = string | null +export type ResponseFormat = + | { + [k: string]: unknown + } + | string + | null +export type Seed = number | string | null +export type Tools = unknown[] | string | null +export type ToolChoice = + | string + | { + [k: string]: unknown + } + | null +export type Logprobs = boolean | string | null +export type TopLogprobs = number | string | null +export type ParallelToolCalls = boolean | string | null +export type ExtraHeaders = + | { + [k: string]: unknown + } + | string + | null +export type Functions = unknown[] | string | null +export type FunctionCall = string | null +export type BaseUrl = string | null +export type ApiVersion = string | null +export type ApiKey = string | null +export type ModelList = unknown[] | string | null +export type MockResponse = string | null +export type CustomLlmProvider = string | null +export type MaxRetries = number | string | null +/** + * Name of the variable used to store the result of the execution of the block. + * + */ +export type Def25 = string | null +/** + * Indicate if the block contributes to the result and background context. + * + */ +export type Contribute21 = ( + | ContributeTarget + | { + [k: string]: ContributeValue + } +)[] +/** + * Parser to use to construct a value out of a string result. + */ +export type Parser21 = + | ("json" | "jsonl" | "yaml") + | PdlParser + | RegexParser | null /** * The maximum number of times to retry when an error occurs within a block. @@ -3049,37 +1762,6 @@ export type Kind21 = "function" export type Function = { [k: string]: PdlTypeType } | null -/** - * Body of the function. - * - */ -export type Return = - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null /** * Function signature computed from the function definition. * @@ -3151,7 +1833,11 @@ export interface FunctionBlock { def?: Def25 contribute?: Contribute21 parser?: Parser21 - fallback?: Fallback21 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null retry?: Retry21 trace_error_on_retry?: TraceErrorOnRetry21 role?: Role21 @@ -3163,7 +1849,38 @@ export interface FunctionBlock { pdl__is_leaf?: PdlIsLeaf21 kind?: Kind21 function: Function - return: Return + /** + * Body of the function. + * + */ + return: + | boolean + | number + | number + | string + | FunctionBlock + | CallBlock + | LitellmModelBlock + | GraniteioModelBlock + | CodeBlock + | ArgsBlock + | GetBlock + | DataBlock + | IfBlock + | MatchBlock + | RepeatBlock + | MapBlock + | TextBlock + | LastOfBlock + | ArrayBlock + | ObjectBlock + | MessageBlock + | ReadBlock + | IncludeBlock + | ImportBlock + | ErrorBlock + | EmptyBlock + | null signature?: Signature } /** @@ -3200,33 +1917,7 @@ export interface Object { * */ export interface Defs { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null + [k: string]: BlockType } /** * Calling a function. @@ -3263,56 +1954,133 @@ export interface CallBlock { } | null defs?: Defs1 - def?: Def24 - contribute?: Contribute20 - parser?: Parser20 - fallback?: Fallback20 - retry?: Retry20 - trace_error_on_retry?: TraceErrorOnRetry20 - role?: Role20 - pdl__context?: PdlContext20 - pdl__id?: PdlId20 + def?: Def + contribute?: Contribute + parser?: Parser + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry + trace_error_on_retry?: TraceErrorOnRetry + role?: Role + pdl__context?: PdlContext + pdl__id?: PdlId pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf20 - kind?: Kind20 + pdl__is_leaf?: PdlIsLeaf + kind?: Kind call: Call args?: unknown - pdl__trace?: PdlTrace4 + pdl__trace?: BlockType | null } /** * Set of definitions executed before the execution of the block. * */ export interface Defs1 { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock + [k: string]: BlockType +} +/** + * Contribution of a specific value instead of the default one. + */ +export interface ContributeValue { + value: Value +} +export interface LocalizedExpression { + pdl__expr: PdlExpr + pdl__result?: unknown + pdl__location?: PdlLocationType | null +} +export interface PdlExpr { + [k: string]: unknown +} +/** + * Internal data structure to keep track of the source location information. + */ +export interface PdlLocationType { + path: Path + file: File + table: Table +} +export interface Table { + [k: string]: number +} +/** + * Use a PDL program as a parser specification (experimental). + */ +export interface PdlParser { + description?: Description2 + spec?: + | ( + | "null" + | "boolean" + | "string" + | "number" + | "integer" + | "array" + | "object" + | "bool" + | "str" + | "float" + | "int" + | "list" + | "obj" + ) + | EnumPdlType + | PdlTypeType[] + | OptionalPdlType + | JsonSchemaTypePdlType + | ObjectPdlType + | { + [k: string]: PdlTypeType + } + | null + pdl: BlockType +} +/** + * A regular expression parser. + */ +export interface RegexParser { + description?: Description3 + spec?: + | ( + | "null" + | "boolean" + | "string" + | "number" + | "integer" + | "array" + | "object" + | "bool" + | "str" + | "float" + | "int" + | "list" + | "obj" + ) + | EnumPdlType + | PdlTypeType[] + | OptionalPdlType + | JsonSchemaTypePdlType + | ObjectPdlType + | { + [k: string]: PdlTypeType + } | null + regex: Regex + mode?: Mode +} +/** + * Internal data structure to record timing information in the trace. + */ +export interface PdlTiming { + start_nanos?: StartNanos + end_nanos?: EndNanos + first_use_nanos?: FirstUseNanos + timezone?: Timezone } /** * Call an LLM through [the LiteLLM API](https://docs.litellm.ai/). @@ -3325,7 +2093,7 @@ export interface Defs1 { * ``` */ export interface LitellmModelBlock { - description?: Description2 + description?: Description4 /** * Type specification of the result of the block. * @@ -3356,38 +2124,29 @@ export interface LitellmModelBlock { } | null defs?: Defs2 - def?: Def23 - contribute?: Contribute19 - parser?: Parser19 - fallback?: Fallback19 - retry?: Retry19 - trace_error_on_retry?: TraceErrorOnRetry19 - role?: Role19 - pdl__context?: PdlContext19 - pdl__id?: PdlId19 + def?: Def1 + contribute?: Contribute1 + parser?: Parser1 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry1 + trace_error_on_retry?: TraceErrorOnRetry1 + role?: Role1 + pdl__context?: PdlContext1 + pdl__id?: PdlId1 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf19 - kind?: Kind19 - input?: Input1 - modelResponse?: Modelresponse1 + pdl__is_leaf?: PdlIsLeaf1 + kind?: Kind1 /** - * Tokens consumed during model call + * Messages to send to the model. * */ - pdl__usage?: PdlUsage | null - pdl__model_input?: PdlModelInput1 - platform?: Platform1 - model: Model1 - parameters?: Parameters1 -} -/** - * Set of definitions executed before the execution of the block. - * - */ -export interface Defs2 { - [k: string]: + input?: | boolean | number | string @@ -3414,12 +2173,29 @@ export interface Defs2 { | ErrorBlock | EmptyBlock | null + modelResponse?: Modelresponse1 + /** + * Tokens consumed during model call + * + */ + pdl__usage?: PdlUsage | null + pdl__model_input?: PdlModelInput1 + platform?: Platform1 + model: Model1 + parameters?: Parameters1 +} +/** + * Set of definitions executed before the execution of the block. + * + */ +export interface Defs2 { + [k: string]: BlockType } /** * Call an LLM through the granite-io API. */ export interface GraniteioModelBlock { - description?: Description3 + description?: Description5 /** * Type specification of the result of the block. * @@ -3450,38 +2226,29 @@ export interface GraniteioModelBlock { } | null defs?: Defs3 - def?: Def22 - contribute?: Contribute18 - parser?: Parser18 - fallback?: Fallback18 - retry?: Retry18 - trace_error_on_retry?: TraceErrorOnRetry18 - role?: Role18 - pdl__context?: PdlContext18 - pdl__id?: PdlId18 + def?: Def2 + contribute?: Contribute2 + parser?: Parser2 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry2 + trace_error_on_retry?: TraceErrorOnRetry2 + role?: Role2 + pdl__context?: PdlContext2 + pdl__id?: PdlId2 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf18 - kind?: Kind18 - input?: Input - modelResponse?: Modelresponse + pdl__is_leaf?: PdlIsLeaf2 + kind?: Kind2 /** - * Tokens consumed during model call + * Messages to send to the model. * */ - pdl__usage?: PdlUsage | null - pdl__model_input?: PdlModelInput - platform?: Platform - processor: unknown - parameters?: Parameters -} -/** - * Set of definitions executed before the execution of the block. - * - */ -export interface Defs3 { - [k: string]: + input?: | boolean | number | string @@ -3508,6 +2275,23 @@ export interface Defs3 { | ErrorBlock | EmptyBlock | null + modelResponse?: Modelresponse + /** + * Tokens consumed during model call + * + */ + pdl__usage?: PdlUsage | null + pdl__model_input?: PdlModelInput + platform?: Platform + processor: unknown + parameters?: Parameters +} +/** + * Set of definitions executed before the execution of the block. + * + */ +export interface Defs3 { + [k: string]: BlockType } /** * Execute a piece of code. @@ -3522,7 +2306,7 @@ export interface Defs3 { * ``` */ export interface CodeBlock { - description?: Description4 + description?: Description6 /** * Type specification of the result of the block. * @@ -3553,29 +2337,30 @@ export interface CodeBlock { } | null defs?: Defs4 - def?: Def21 - contribute?: Contribute17 - parser?: Parser17 - fallback?: Fallback17 - retry?: Retry17 - trace_error_on_retry?: TraceErrorOnRetry17 - role?: Role17 - pdl__context?: PdlContext17 - pdl__id?: PdlId17 + def?: Def3 + contribute?: Contribute3 + parser?: Parser3 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry3 + trace_error_on_retry?: TraceErrorOnRetry3 + role?: Role3 + pdl__context?: PdlContext3 + pdl__id?: PdlId3 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf17 - kind?: Kind17 - lang: Lang1 - code: Code -} -/** - * Set of definitions executed before the execution of the block. - * - */ -export interface Defs4 { - [k: string]: + pdl__is_leaf?: PdlIsLeaf3 + kind?: Kind3 + lang: Lang + /** + * Code to execute. + * + */ + code: | boolean | number | string @@ -3603,6 +2388,13 @@ export interface Defs4 { | EmptyBlock | null } +/** + * Set of definitions executed before the execution of the block. + * + */ +export interface Defs4 { + [k: string]: BlockType +} /** * Execute a command line, which will spawn a subprocess with the given argument vector. Note: if you need a shell script execution, you must wrap your command line in /bin/sh or some shell of your choosing. * @@ -3615,7 +2407,7 @@ export interface Defs4 { * ``` */ export interface ArgsBlock { - description?: Description5 + description?: Description7 /** * Type specification of the result of the block. * @@ -3646,55 +2438,33 @@ export interface ArgsBlock { } | null defs?: Defs5 - def?: Def20 - contribute?: Contribute16 - parser?: Parser16 - fallback?: Fallback16 - retry?: Retry16 - trace_error_on_retry?: TraceErrorOnRetry16 - role?: Role16 - pdl__context?: PdlContext16 - pdl__id?: PdlId16 + def?: Def4 + contribute?: Contribute4 + parser?: Parser4 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry4 + trace_error_on_retry?: TraceErrorOnRetry4 + role?: Role4 + pdl__context?: PdlContext4 + pdl__id?: PdlId4 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf16 - kind?: Kind16 - lang?: Lang - args: Args + pdl__is_leaf?: PdlIsLeaf4 + kind?: Kind4 + lang?: Lang1 + args: Args1 } /** * Set of definitions executed before the execution of the block. * */ export interface Defs5 { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null + [k: string]: BlockType } /** * Get the value of a variable. @@ -3702,7 +2472,7 @@ export interface Defs5 { * The GetBlock is deprecated. Use DataBlock instead. */ export interface GetBlock { - description?: Description6 + description?: Description8 /** * Type specification of the result of the block. * @@ -3733,54 +2503,32 @@ export interface GetBlock { } | null defs?: Defs6 - def?: Def19 - contribute?: Contribute15 - parser?: Parser15 - fallback?: Fallback15 - retry?: Retry15 - trace_error_on_retry?: TraceErrorOnRetry15 - role?: Role15 - pdl__context?: PdlContext15 - pdl__id?: PdlId15 - pdl__result?: unknown - pdl__location?: PdlLocationType | null - pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf15 - kind?: Kind15 - get: Get -} -/** - * Set of definitions executed before the execution of the block. - * - */ -export interface Defs6 { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null + def?: Def5 + contribute?: Contribute5 + parser?: Parser5 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry5 + trace_error_on_retry?: TraceErrorOnRetry5 + role?: Role5 + pdl__context?: PdlContext5 + pdl__id?: PdlId5 + pdl__result?: unknown + pdl__location?: PdlLocationType | null + pdl__timing?: PdlTiming | null + pdl__is_leaf?: PdlIsLeaf5 + kind?: Kind5 + get: Get +} +/** + * Set of definitions executed before the execution of the block. + * + */ +export interface Defs6 { + [k: string]: BlockType } /** * Arbitrary value, equivalent to JSON. @@ -3807,7 +2555,7 @@ export interface Defs6 { * ``` */ export interface DataBlock { - description?: Description7 + description?: Description9 /** * Type specification of the result of the block. * @@ -3838,20 +2586,24 @@ export interface DataBlock { } | null defs?: Defs7 - def?: Def18 - contribute?: Contribute14 - parser?: Parser14 - fallback?: Fallback14 - retry?: Retry14 - trace_error_on_retry?: TraceErrorOnRetry14 - role?: Role14 - pdl__context?: PdlContext14 - pdl__id?: PdlId14 + def?: Def6 + contribute?: Contribute6 + parser?: Parser6 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry6 + trace_error_on_retry?: TraceErrorOnRetry6 + role?: Role6 + pdl__context?: PdlContext6 + pdl__id?: PdlId6 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf14 - kind?: Kind14 + pdl__is_leaf?: PdlIsLeaf6 + kind?: Kind6 data: unknown raw?: Raw } @@ -3860,33 +2612,7 @@ export interface DataBlock { * */ export interface Defs7 { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null + [k: string]: BlockType } /** * Conditional control structure. @@ -3902,7 +2628,7 @@ export interface Defs7 { * ``` */ export interface IfBlock { - description?: Description8 + description?: Description10 /** * Type specification of the result of the block. * @@ -3933,31 +2659,31 @@ export interface IfBlock { } | null defs?: Defs8 - def?: Def17 - contribute?: Contribute13 - parser?: Parser13 - fallback?: Fallback13 - retry?: Retry13 - trace_error_on_retry?: TraceErrorOnRetry13 - role?: Role13 - pdl__context?: PdlContext13 - pdl__id?: PdlId13 + def?: Def7 + contribute?: Contribute7 + parser?: Parser7 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry7 + trace_error_on_retry?: TraceErrorOnRetry7 + role?: Role7 + pdl__context?: PdlContext7 + pdl__id?: PdlId7 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf13 - context?: IndependentEnum8 - kind?: Kind13 - if: If1 - then: Then1 - else?: Else -} -/** - * Set of definitions executed before the execution of the block. - * - */ -export interface Defs8 { - [k: string]: + pdl__is_leaf?: PdlIsLeaf7 + context?: IndependentEnum + kind?: Kind7 + if: If + /** + * Branch to execute if the condition is true. + * + */ + then: | boolean | number | string @@ -3984,6 +2710,18 @@ export interface Defs8 { | ErrorBlock | EmptyBlock | null + /** + * Branch to execute if the condition is false. + * + */ + else?: BlockType | null +} +/** + * Set of definitions executed before the execution of the block. + * + */ +export interface Defs8 { + [k: string]: BlockType } /** * Match control structure. @@ -4006,7 +2744,7 @@ export interface Defs8 { * - then: Too low */ export interface MatchBlock { - description?: Description9 + description?: Description11 /** * Type specification of the result of the block. * @@ -4037,57 +2775,85 @@ export interface MatchBlock { } | null defs?: Defs9 - def?: Def12 - contribute?: Contribute12 - parser?: Parser12 - fallback?: Fallback12 - retry?: Retry12 - trace_error_on_retry?: TraceErrorOnRetry12 - role?: Role12 - pdl__context?: PdlContext12 - pdl__id?: PdlId12 + def?: Def8 + contribute?: Contribute8 + parser?: Parser8 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry8 + trace_error_on_retry?: TraceErrorOnRetry8 + role?: Role8 + pdl__context?: PdlContext8 + pdl__id?: PdlId8 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf12 - context?: IndependentEnum7 - kind?: Kind12 + pdl__is_leaf?: PdlIsLeaf8 + context?: IndependentEnum1 + kind?: Kind8 match: unknown - with: With1 + with: With } /** * Set of definitions executed before the execution of the block. * */ export interface Defs9 { + [k: string]: BlockType +} +/** + * Case of a match. + */ +export interface MatchCase { + case?: Case + if?: If1 + then: BlockType + pdl__case_result?: PdlCaseResult + pdl__if_result?: PdlIfResult + pdl__matched?: PdlMatched +} +/** + * Match any of the patterns. + */ +export interface OrPattern { + def?: Def9 + anyOf: Anyof +} +/** + * Match an array. + */ +export interface ArrayPattern { + def?: Def10 + array: Array +} +/** + * Match an object. + */ +export interface ObjectPattern { + def?: Def11 + object: Object1 +} +export interface Object1 { [k: string]: | boolean | number | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock + | OrPattern + | ArrayPattern + | ObjectPattern + | AnyPattern | null } +/** + * Match any value. + */ +export interface AnyPattern { + def?: Def12 + any: Any +} /** * Repeat the execution of a block sequentially. * The scope and `pdl_context` are accumulated in between iterations. @@ -4115,7 +2881,7 @@ export interface Defs9 { * ``` */ export interface RepeatBlock { - description?: Description10 + description?: Description12 /** * Type specification of the result of the block. * @@ -4146,36 +2912,33 @@ export interface RepeatBlock { } | null defs?: Defs10 - def?: Def11 - contribute?: Contribute11 - parser?: Parser11 - fallback?: Fallback11 - retry?: Retry11 - trace_error_on_retry?: TraceErrorOnRetry11 - role?: Role11 - pdl__context?: PdlContext11 - pdl__id?: PdlId11 + def?: Def13 + contribute?: Contribute9 + parser?: Parser9 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry9 + trace_error_on_retry?: TraceErrorOnRetry9 + role?: Role9 + pdl__context?: PdlContext9 + pdl__id?: PdlId9 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf11 - context?: IndependentEnum6 - kind?: Kind11 - for?: For1 - index?: Index1 + pdl__is_leaf?: PdlIsLeaf9 + context?: IndependentEnum2 + kind?: Kind9 + for?: For + index?: Index while?: While - repeat: Repeat - until?: Until - maxIterations?: Maxiterations1 - join?: Join1 - pdl__trace?: PdlTrace3 -} -/** - * Set of definitions executed before the execution of the block. - * - */ -export interface Defs10 { - [k: string]: + /** + * Body of the loop. + * + */ + repeat: | boolean | number | string @@ -4202,6 +2965,17 @@ export interface Defs10 { | ErrorBlock | EmptyBlock | null + until?: Until + maxIterations?: Maxiterations1 + join?: Join1 + pdl__trace?: PdlTrace1 +} +/** + * Set of definitions executed before the execution of the block. + * + */ +export interface Defs10 { + [k: string]: BlockType } /** * Independent executions of a block. @@ -4228,7 +3002,7 @@ export interface Defs10 { * ``` */ export interface MapBlock { - description?: Description11 + description?: Description13 /** * Type specification of the result of the block. * @@ -4259,10 +3033,14 @@ export interface MapBlock { } | null defs?: Defs11 - def?: Def10 + def?: Def14 contribute?: Contribute10 parser?: Parser10 - fallback?: Fallback10 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null retry?: Retry10 trace_error_on_retry?: TraceErrorOnRetry10 role?: Role10 @@ -4272,21 +3050,15 @@ export interface MapBlock { pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf10 - context?: IndependentEnum5 + context?: IndependentEnum3 kind?: Kind10 - for?: For - index?: Index - map: Map - maxIterations?: Maxiterations - join?: Join - pdl__trace?: PdlTrace2 -} -/** - * Set of definitions executed before the execution of the block. - * - */ -export interface Defs11 { - [k: string]: + for?: For1 + index?: Index1 + /** + * Body of the iterator. + * + */ + map: | boolean | number | string @@ -4313,12 +3085,22 @@ export interface Defs11 { | ErrorBlock | EmptyBlock | null + maxIterations?: Maxiterations + join?: Join + pdl__trace?: PdlTrace +} +/** + * Set of definitions executed before the execution of the block. + * + */ +export interface Defs11 { + [k: string]: BlockType } /** * Create the concatenation of the stringify version of the result of each block of the list of blocks. */ export interface TextBlock { - description?: Description12 + description?: Description14 /** * Type specification of the result of the block. * @@ -4349,21 +3131,25 @@ export interface TextBlock { } | null defs?: Defs12 - def?: Def9 - contribute?: Contribute9 - parser?: Parser9 - fallback?: Fallback9 - retry?: Retry9 - trace_error_on_retry?: TraceErrorOnRetry9 - role?: Role9 - pdl__context?: PdlContext9 - pdl__id?: PdlId9 + def?: Def15 + contribute?: Contribute11 + parser?: Parser11 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry11 + trace_error_on_retry?: TraceErrorOnRetry11 + role?: Role11 + pdl__context?: PdlContext11 + pdl__id?: PdlId11 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf9 + pdl__is_leaf?: PdlIsLeaf11 context?: IndependentEnum4 - kind?: Kind9 + kind?: Kind11 text: Text } /** @@ -4371,39 +3157,13 @@ export interface TextBlock { * */ export interface Defs12 { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null + [k: string]: BlockType } /** * Return the value of the last block if the list of blocks. */ export interface LastOfBlock { - description?: Description13 + description?: Description15 /** * Type specification of the result of the block. * @@ -4434,21 +3194,25 @@ export interface LastOfBlock { } | null defs?: Defs13 - def?: Def8 - contribute?: Contribute8 - parser?: Parser8 - fallback?: Fallback8 - retry?: Retry8 - trace_error_on_retry?: TraceErrorOnRetry8 - role?: Role8 - pdl__context?: PdlContext8 - pdl__id?: PdlId8 + def?: Def16 + contribute?: Contribute12 + parser?: Parser12 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry12 + trace_error_on_retry?: TraceErrorOnRetry12 + role?: Role12 + pdl__context?: PdlContext12 + pdl__id?: PdlId12 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf8 - context?: IndependentEnum3 - kind?: Kind8 + pdl__is_leaf?: PdlIsLeaf12 + context?: IndependentEnum5 + kind?: Kind12 lastOf: Lastof } /** @@ -4456,39 +3220,13 @@ export interface LastOfBlock { * */ export interface Defs13 { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null + [k: string]: BlockType } /** * Return the array of values computed by each block of the list of blocks. */ export interface ArrayBlock { - description?: Description14 + description?: Description16 /** * Type specification of the result of the block. * @@ -4519,61 +3257,39 @@ export interface ArrayBlock { } | null defs?: Defs14 - def?: Def7 - contribute?: Contribute7 - parser?: Parser7 - fallback?: Fallback7 - retry?: Retry7 - trace_error_on_retry?: TraceErrorOnRetry7 - role?: Role7 - pdl__context?: PdlContext7 - pdl__id?: PdlId7 + def?: Def17 + contribute?: Contribute13 + parser?: Parser13 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry13 + trace_error_on_retry?: TraceErrorOnRetry13 + role?: Role13 + pdl__context?: PdlContext13 + pdl__id?: PdlId13 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf7 - context?: IndependentEnum2 - kind?: Kind7 - array: Array + pdl__is_leaf?: PdlIsLeaf13 + context?: IndependentEnum6 + kind?: Kind13 + array: Array1 } /** * Set of definitions executed before the execution of the block. * */ export interface Defs14 { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null + [k: string]: BlockType } /** * Return the object where the value of each field is defined by a block. If the body of the object is an array, the resulting object is the union of the objects computed by each element of the array. */ export interface ObjectBlock { - description?: Description15 + description?: Description17 /** * Type specification of the result of the block. * @@ -4604,61 +3320,39 @@ export interface ObjectBlock { } | null defs?: Defs15 - def?: Def6 - contribute?: Contribute6 - parser?: Parser6 - fallback?: Fallback6 - retry?: Retry6 - trace_error_on_retry?: TraceErrorOnRetry6 - role?: Role6 - pdl__context?: PdlContext6 - pdl__id?: PdlId6 - pdl__result?: unknown - pdl__location?: PdlLocationType | null - pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf6 - context?: IndependentEnum1 - kind?: Kind6 - object: Object1 -} -/** - * Set of definitions executed before the execution of the block. - * - */ -export interface Defs15 { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null + def?: Def18 + contribute?: Contribute14 + parser?: Parser14 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry14 + trace_error_on_retry?: TraceErrorOnRetry14 + role?: Role14 + pdl__context?: PdlContext14 + pdl__id?: PdlId14 + pdl__result?: unknown + pdl__location?: PdlLocationType | null + pdl__timing?: PdlTiming | null + pdl__is_leaf?: PdlIsLeaf14 + context?: IndependentEnum7 + kind?: Kind14 + object: Object2 +} +/** + * Set of definitions executed before the execution of the block. + * + */ +export interface Defs15 { + [k: string]: BlockType } /** * Create a message. */ export interface MessageBlock { - description?: Description16 + description?: Description18 /** * Type specification of the result of the block. * @@ -4689,30 +3383,28 @@ export interface MessageBlock { } | null defs?: Defs16 - def?: Def5 - contribute?: Contribute5 - parser?: Parser5 - fallback?: Fallback5 - retry?: Retry5 - trace_error_on_retry?: TraceErrorOnRetry5 - role?: Role5 - pdl__context?: PdlContext5 - pdl__id?: PdlId5 + def?: Def19 + contribute?: Contribute15 + parser?: Parser15 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry15 + trace_error_on_retry?: TraceErrorOnRetry15 + role?: Role15 + pdl__context?: PdlContext15 + pdl__id?: PdlId15 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf5 - kind?: Kind5 - content: Content - name?: Name - tool_call_id?: ToolCallId -} -/** - * Set of definitions executed before the execution of the block. - * - */ -export interface Defs16 { - [k: string]: + pdl__is_leaf?: PdlIsLeaf15 + kind?: Kind15 + /** + * Content of the message. + */ + content: | boolean | number | string @@ -4739,6 +3431,15 @@ export interface Defs16 { | ErrorBlock | EmptyBlock | null + name?: Name + tool_call_id?: ToolCallId +} +/** + * Set of definitions executed before the execution of the block. + * + */ +export interface Defs16 { + [k: string]: BlockType } /** * Read from a file or standard input. @@ -4756,7 +3457,7 @@ export interface Defs16 { * ``` */ export interface ReadBlock { - description?: Description17 + description?: Description19 /** * Type specification of the result of the block. * @@ -4787,20 +3488,24 @@ export interface ReadBlock { } | null defs?: Defs17 - def?: Def4 - contribute?: Contribute4 - parser?: Parser4 - fallback?: Fallback4 - retry?: Retry4 - trace_error_on_retry?: TraceErrorOnRetry4 - role?: Role4 - pdl__context?: PdlContext4 - pdl__id?: PdlId4 + def?: Def20 + contribute?: Contribute16 + parser?: Parser16 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry16 + trace_error_on_retry?: TraceErrorOnRetry16 + role?: Role16 + pdl__context?: PdlContext16 + pdl__id?: PdlId16 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf4 - kind?: Kind4 + pdl__is_leaf?: PdlIsLeaf16 + kind?: Kind16 read: Read message?: Message multiline?: Multiline @@ -4810,39 +3515,13 @@ export interface ReadBlock { * */ export interface Defs17 { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null + [k: string]: BlockType } /** * Include a PDL file. */ export interface IncludeBlock { - description?: Description18 + description?: Description20 /** * Type specification of the result of the block. * @@ -4873,147 +3552,40 @@ export interface IncludeBlock { } | null defs?: Defs18 - def?: Def3 - contribute?: Contribute3 - parser?: Parser3 - fallback?: Fallback3 - retry?: Retry3 - trace_error_on_retry?: TraceErrorOnRetry3 - role?: Role3 - pdl__context?: PdlContext3 - pdl__id?: PdlId3 - pdl__result?: unknown - pdl__location?: PdlLocationType | null - pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf3 - context?: IndependentEnum - kind?: Kind3 - include: Include - pdl__trace?: PdlTrace1 -} -/** - * Set of definitions executed before the execution of the block. - * - */ -export interface Defs18 { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null -} -/** - * Import a PDL file. - */ -export interface ImportBlock { - description?: Description19 + def?: Def21 + contribute?: Contribute17 + parser?: Parser17 /** - * Type specification of the result of the block. + * Block to execute in case of error. * */ - spec?: - | ( - | "null" - | "boolean" - | "string" - | "number" - | "integer" - | "array" - | "object" - | "bool" - | "str" - | "float" - | "int" - | "list" - | "obj" - ) - | EnumPdlType - | PdlTypeType[] - | OptionalPdlType - | JsonSchemaTypePdlType - | ObjectPdlType - | { - [k: string]: PdlTypeType - } - | null - defs?: Defs19 - def?: Def2 - contribute?: Contribute2 - parser?: Parser2 - fallback?: Fallback2 - retry?: Retry2 - trace_error_on_retry?: TraceErrorOnRetry2 - role?: Role2 - pdl__context?: PdlContext2 - pdl__id?: PdlId2 - pdl__result?: unknown - pdl__location?: PdlLocationType | null - pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf2 - kind?: Kind2 - import: Import - pdl__trace?: PdlTrace -} -/** - * Set of definitions executed before the execution of the block. - * - */ -export interface Defs19 { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null + fallback?: BlockType | null + retry?: Retry17 + trace_error_on_retry?: TraceErrorOnRetry17 + role?: Role17 + pdl__context?: PdlContext17 + pdl__id?: PdlId17 + pdl__result?: unknown + pdl__location?: PdlLocationType | null + pdl__timing?: PdlTiming | null + pdl__is_leaf?: PdlIsLeaf17 + context?: IndependentEnum8 + kind?: Kind17 + include: Include + pdl__trace?: BlockType | null } /** - * Block representing an error generated at runtime. + * Set of definitions executed before the execution of the block. + * */ -export interface ErrorBlock { - description?: Description20 +export interface Defs18 { + [k: string]: BlockType +} +/** + * Import a PDL file. + */ +export interface ImportBlock { + description?: Description21 /** * Type specification of the result of the block. * @@ -5043,62 +3615,40 @@ export interface ErrorBlock { [k: string]: PdlTypeType } | null - defs?: Defs20 - def?: Def1 - contribute?: Contribute1 - parser?: Parser1 - fallback?: Fallback1 - retry?: Retry1 - trace_error_on_retry?: TraceErrorOnRetry1 - role?: Role1 - pdl__context?: PdlContext1 - pdl__id?: PdlId1 + defs?: Defs19 + def?: Def22 + contribute?: Contribute18 + parser?: Parser18 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry18 + trace_error_on_retry?: TraceErrorOnRetry18 + role?: Role18 + pdl__context?: PdlContext18 + pdl__id?: PdlId18 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf1 - kind?: Kind1 - msg: Msg - program: Program1 + pdl__is_leaf?: PdlIsLeaf18 + kind?: Kind18 + import: Import + pdl__trace?: BlockType | null } /** * Set of definitions executed before the execution of the block. * */ -export interface Defs20 { - [k: string]: - | boolean - | number - | string - | FunctionBlock - | CallBlock - | LitellmModelBlock - | GraniteioModelBlock - | CodeBlock - | ArgsBlock - | GetBlock - | DataBlock - | IfBlock - | MatchBlock - | RepeatBlock - | MapBlock - | TextBlock - | LastOfBlock - | ArrayBlock - | ObjectBlock - | MessageBlock - | ReadBlock - | IncludeBlock - | ImportBlock - | ErrorBlock - | EmptyBlock - | null +export interface Defs19 { + [k: string]: BlockType } /** - * Block without an action. It can contain definitions. + * Block representing an error generated at runtime. */ -export interface EmptyBlock { - description?: Description21 +export interface ErrorBlock { + description?: Description22 /** * Type specification of the result of the block. * @@ -5128,28 +3678,31 @@ export interface EmptyBlock { [k: string]: PdlTypeType } | null - defs?: Defs21 - def?: Def - contribute?: Contribute - parser?: Parser - fallback?: Fallback - retry?: Retry - trace_error_on_retry?: TraceErrorOnRetry - role?: Role - pdl__context?: PdlContext - pdl__id?: PdlId + defs?: Defs20 + def?: Def23 + contribute?: Contribute19 + parser?: Parser19 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry19 + trace_error_on_retry?: TraceErrorOnRetry19 + role?: Role19 + pdl__context?: PdlContext19 + pdl__id?: PdlId19 pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null - pdl__is_leaf?: PdlIsLeaf - kind?: Kind -} -/** - * Set of definitions executed before the execution of the block. - * - */ -export interface Defs21 { - [k: string]: + pdl__is_leaf?: PdlIsLeaf19 + kind?: Kind19 + msg: Msg + /** + * Block that raised the error. + * + */ + program: | boolean | number | string @@ -5178,67 +3731,21 @@ export interface Defs21 { | null } /** - * Contribution of a specific value instead of the default one. - */ -export interface ContributeValue { - value: Value -} -export interface LocalizedExpression { - pdl__expr: PdlExpr - pdl__result?: unknown - pdl__location?: PdlLocationType | null -} -export interface PdlExpr { - [k: string]: unknown -} -/** - * Internal data structure to keep track of the source location information. - */ -export interface PdlLocationType { - path: Path - file: File - table: Table -} -export interface Table { - [k: string]: number -} -/** - * Use a PDL program as a parser specification (experimental). + * Set of definitions executed before the execution of the block. + * */ -export interface PdlParser { - description?: Description22 - spec?: - | ( - | "null" - | "boolean" - | "string" - | "number" - | "integer" - | "array" - | "object" - | "bool" - | "str" - | "float" - | "int" - | "list" - | "obj" - ) - | EnumPdlType - | PdlTypeType[] - | OptionalPdlType - | JsonSchemaTypePdlType - | ObjectPdlType - | { - [k: string]: PdlTypeType - } - | null - pdl: Pdl +export interface Defs20 { + [k: string]: BlockType } /** - * A regular expression parser. + * Block without an action. It can contain definitions. */ -export interface RegexParser { +export interface EmptyBlock { description?: Description23 + /** + * Type specification of the result of the block. + * + */ spec?: | ( | "null" @@ -5264,24 +3771,39 @@ export interface RegexParser { [k: string]: PdlTypeType } | null - regex: Regex - mode?: Mode + defs?: Defs21 + def?: Def24 + contribute?: Contribute20 + parser?: Parser20 + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + retry?: Retry20 + trace_error_on_retry?: TraceErrorOnRetry20 + role?: Role20 + pdl__context?: PdlContext20 + pdl__id?: PdlId20 + pdl__result?: unknown + pdl__location?: PdlLocationType | null + pdl__timing?: PdlTiming | null + pdl__is_leaf?: PdlIsLeaf20 + kind?: Kind20 } /** - * Internal data structure to record timing information in the trace. + * Set of definitions executed before the execution of the block. + * */ -export interface PdlTiming { - start_nanos?: StartNanos - end_nanos?: EndNanos - first_use_nanos?: FirstUseNanos - timezone?: Timezone +export interface Defs21 { + [k: string]: BlockType } /** * Join loop iterations as a string. */ export interface JoinText { as?: As - with?: With + with?: With1 } /** * Join loop iterations as an array. @@ -5308,56 +3830,6 @@ export interface JoinReduce { as?: As4 reduce: Reduce } -/** - * Case of a match. - */ -export interface MatchCase { - case?: Case - if?: If - then: Then - pdl__case_result?: PdlCaseResult - pdl__if_result?: PdlIfResult - pdl__matched?: PdlMatched -} -/** - * Match any of the patterns. - */ -export interface OrPattern { - def?: Def13 - anyOf: Anyof -} -/** - * Match an array. - */ -export interface ArrayPattern { - def?: Def14 - array: Array1 -} -/** - * Match an object. - */ -export interface ObjectPattern { - def?: Def15 - object: Object2 -} -export interface Object2 { - [k: string]: - | boolean - | number - | string - | OrPattern - | ArrayPattern - | ObjectPattern - | AnyPattern - | null -} -/** - * Match any value. - */ -export interface AnyPattern { - def?: Def16 - any: Any -} /** * Internal data structure to record token consumption usage information. */ diff --git a/src/pdl/pdl-schema.json b/src/pdl/pdl-schema.json index 3d9575364..d7f83d87f 100644 --- a/src/pdl/pdl-schema.json +++ b/src/pdl/pdl-schema.json @@ -52,89 +52,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -203,90 +121,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -457,89 +299,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -608,90 +368,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -817,89 +501,7 @@ "array": { "description": "Elements of the array.", "items": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "title": "Array", "type": "array" @@ -969,6 +571,91 @@ "title": "ArrayPattern", "type": "object" }, + "BlockType": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "$ref": "#/$defs/FunctionBlock" + }, + { + "$ref": "#/$defs/CallBlock" + }, + { + "$ref": "#/$defs/LitellmModelBlock" + }, + { + "$ref": "#/$defs/GraniteioModelBlock" + }, + { + "$ref": "#/$defs/CodeBlock" + }, + { + "$ref": "#/$defs/ArgsBlock" + }, + { + "$ref": "#/$defs/GetBlock" + }, + { + "$ref": "#/$defs/DataBlock" + }, + { + "$ref": "#/$defs/IfBlock" + }, + { + "$ref": "#/$defs/MatchBlock" + }, + { + "$ref": "#/$defs/RepeatBlock" + }, + { + "$ref": "#/$defs/MapBlock" + }, + { + "$ref": "#/$defs/TextBlock" + }, + { + "$ref": "#/$defs/LastOfBlock" + }, + { + "$ref": "#/$defs/ArrayBlock" + }, + { + "$ref": "#/$defs/ObjectBlock" + }, + { + "$ref": "#/$defs/MessageBlock" + }, + { + "$ref": "#/$defs/ReadBlock" + }, + { + "$ref": "#/$defs/IncludeBlock" + }, + { + "$ref": "#/$defs/ImportBlock" + }, + { + "$ref": "#/$defs/ErrorBlock" + }, + { + "$ref": "#/$defs/EmptyBlock" + }, + { + "type": "null" + } + ] + }, "CallBlock": { "additionalProperties": false, "description": "Calling a function.", @@ -993,89 +680,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -1144,90 +749,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -1378,89 +907,13 @@ "pdl__trace": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], - "default": null, - "title": "Pdl Trace" + "default": null } }, "required": [ @@ -1493,89 +946,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -1644,90 +1015,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -1859,91 +1154,8 @@ "type": "string" }, "code": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], - "description": "Code to execute.\n ", - "title": "Code" + "$ref": "#/$defs/BlockType", + "description": "Code to execute.\n " } }, "required": [ @@ -2012,118 +1224,36 @@ }, "defs": { "additionalProperties": { + "$ref": "#/$defs/BlockType" + }, + "default": {}, + "description": "Set of definitions executed before the execution of the block.\n ", + "title": "Defs", + "type": "object" + }, + "def": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Name of the variable used to store the result of the execution of the block.\n ", + "title": "Def" + }, + "contribute": { + "default": [ + "result", + "context" + ], + "description": "Indicate if the block contributes to the result and background context.\n ", + "items": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] - }, - "default": {}, - "description": "Set of definitions executed before the execution of the block.\n ", - "title": "Defs", - "type": "object" - }, - "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" - }, - "contribute": { - "default": [ - "result", - "context" - ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" + "$ref": "#/$defs/ContributeTarget" }, { "additionalProperties": { @@ -2163,90 +1293,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -2415,89 +1469,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -2566,90 +1538,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -2812,89 +1708,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -2963,90 +1777,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -3171,91 +1909,8 @@ "type": "string" }, "program": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], - "description": "Block that raised the error.\n ", - "title": "Program" + "$ref": "#/$defs/BlockType", + "description": "Block that raised the error.\n " } }, "required": [ @@ -3289,89 +1944,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -3440,111 +2013,35 @@ "fallback": { "anyOf": [ { - "type": "boolean" + "$ref": "#/$defs/BlockType" }, { - "type": "integer" - }, + "type": "null" + } + ], + "default": null, + "description": "Block to execute in case of error.\n " + }, + "retry": { + "anyOf": [ { - "type": "number" + "type": "integer" }, { - "type": "string" - }, + "type": "null" + } + ], + "default": null, + "description": "The maximum number of times to retry when an error occurs within a block.\n ", + "title": "Retry" + }, + "trace_error_on_retry": { + "anyOf": [ { - "$ref": "#/$defs/FunctionBlock" + "type": "boolean" }, { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" - }, - "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" - }, - "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" + "type": "string" }, { "type": "null" @@ -3658,91 +2155,8 @@ "title": "Function" }, "return": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], - "description": "Body of the function.\n ", - "title": "Return" + "$ref": "#/$defs/BlockType", + "description": "Body of the function.\n " }, "signature": { "anyOf": [ @@ -3791,89 +2205,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -3942,90 +2274,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -4180,89 +2436,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -4331,90 +2505,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -4534,92 +2632,9 @@ "type": "string" }, "input": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/BlockType", "default": "${ pdl_context }", - "description": "Messages to send to the model.\n ", - "title": "Input" + "description": "Messages to send to the model.\n " }, "modelResponse": { "anyOf": [ @@ -4791,89 +2806,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -4942,111 +2875,35 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" + "$ref": "#/$defs/BlockType" }, { - "type": "number" - }, + "type": "null" + } + ], + "default": null, + "description": "Block to execute in case of error.\n " + }, + "retry": { + "anyOf": [ { - "type": "string" + "type": "integer" }, { - "$ref": "#/$defs/FunctionBlock" - }, + "type": "null" + } + ], + "default": null, + "description": "The maximum number of times to retry when an error occurs within a block.\n ", + "title": "Retry" + }, + "trace_error_on_retry": { + "anyOf": [ { - "$ref": "#/$defs/CallBlock" + "type": "boolean" }, { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" - }, - "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" - }, - "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" + "type": "string" }, { "type": "null" @@ -5164,179 +3021,20 @@ "title": "If" }, "then": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], - "description": "Branch to execute if the condition is true.\n ", - "title": "Then" + "$ref": "#/$defs/BlockType", + "description": "Branch to execute if the condition is true.\n " }, "else": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Branch to execute if the condition is false.\n ", - "title": "Else" + "description": "Branch to execute if the condition is false.\n " } }, "required": [ @@ -5370,89 +3068,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -5497,114 +3113,38 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" - }, - "fallback": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" + "enum": [ + "json", + "jsonl", + "yaml" + ], + "type": "string" }, { - "$ref": "#/$defs/IncludeBlock" + "$ref": "#/$defs/PdlParser" }, { - "$ref": "#/$defs/ImportBlock" + "$ref": "#/$defs/RegexParser" }, { - "$ref": "#/$defs/ErrorBlock" - }, + "type": "null" + } + ], + "default": null, + "description": "Parser to use to construct a value out of a string result.", + "title": "Parser" + }, + "fallback": { + "anyOf": [ { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -5731,89 +3271,13 @@ "pdl__trace": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], - "default": null, - "title": "Pdl Trace" + "default": null } }, "required": [ @@ -5846,89 +3310,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -5997,90 +3379,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -6201,99 +3507,23 @@ "const": "include", "default": "include", "title": "Kind", - "type": "string" - }, - "include": { - "description": "Name of the file to include.\n ", - "title": "Include", - "type": "string" - }, - "pdl__trace": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, + "type": "string" + }, + "include": { + "description": "Name of the file to include.\n ", + "title": "Include", + "type": "string" + }, + "pdl__trace": { + "anyOf": [ { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], - "default": null, - "title": "Pdl Trace" + "default": null } }, "required": [ @@ -6460,89 +3690,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -6611,90 +3759,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -6820,89 +3892,7 @@ "lastOf": { "description": "Sequence of blocks to execute.", "items": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "title": "Lastof", "type": "array" @@ -6932,95 +3922,13 @@ "title": "Description" }, "spec": { - "$ref": "#/$defs/PdlTypeType", - "default": null, - "description": "Type specification of the result of the block.\n " - }, - "defs": { - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/PdlTypeType", + "default": null, + "description": "Type specification of the result of the block.\n " + }, + "defs": { + "additionalProperties": { + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -7089,90 +3997,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -7292,92 +4124,9 @@ "type": "string" }, "input": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/BlockType", "default": "${ pdl_context }", - "description": "Messages to send to the model.\n ", - "title": "Input" + "description": "Messages to send to the model.\n " }, "modelResponse": { "anyOf": [ @@ -7929,89 +4678,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -8054,116 +4721,40 @@ "type": "array" }, "parser": { - "anyOf": [ - { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" - }, - "fallback": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, + "anyOf": [ { - "$ref": "#/$defs/ReadBlock" + "enum": [ + "json", + "jsonl", + "yaml" + ], + "type": "string" }, { - "$ref": "#/$defs/IncludeBlock" + "$ref": "#/$defs/PdlParser" }, { - "$ref": "#/$defs/ImportBlock" + "$ref": "#/$defs/RegexParser" }, { - "$ref": "#/$defs/ErrorBlock" - }, + "type": "null" + } + ], + "default": null, + "description": "Parser to use to construct a value out of a string result.", + "title": "Parser" + }, + "fallback": { + "anyOf": [ { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -8327,91 +4918,8 @@ "title": "Index" }, "map": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], - "description": "Body of the iterator.\n ", - "title": "Map" + "$ref": "#/$defs/BlockType", + "description": "Body of the iterator.\n " }, "maxIterations": { "anyOf": [ @@ -8461,89 +4969,7 @@ "anyOf": [ { "items": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "type": "array" }, @@ -8585,89 +5011,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -8733,93 +5077,17 @@ "description": "Parser to use to construct a value out of a string result.", "title": "Parser" }, - "fallback": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, + "fallback": { + "anyOf": [ { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -9027,90 +5295,7 @@ "title": "If" }, "then": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], - "title": "Then" + "$ref": "#/$defs/BlockType" }, "pdl__case_result": { "anyOf": [ @@ -9179,89 +5364,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -9330,90 +5433,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -9520,105 +5547,22 @@ ], "default": null }, - "pdl__is_leaf": { - "const": true, - "default": true, - "title": "Pdl Is Leaf", - "type": "boolean" - }, - "kind": { - "const": "message", - "default": "message", - "title": "Kind", - "type": "string" - }, - "content": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], - "description": "Content of the message.", - "title": "Content" - }, + "pdl__is_leaf": { + "const": true, + "default": true, + "title": "Pdl Is Leaf", + "type": "boolean" + }, + "kind": { + "const": "message", + "default": "message", + "title": "Kind", + "type": "string" + }, + "content": { + "$ref": "#/$defs/BlockType", + "description": "Content of the message." + }, "name": { "anyOf": [ { @@ -9682,89 +5626,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -9833,90 +5695,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -10036,184 +5822,20 @@ "kind": { "const": "object", "default": "object", - "title": "Kind", - "type": "string" - }, - "object": { - "anyOf": [ - { - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] - }, - "type": "object" - }, - { - "items": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "title": "Kind", + "type": "string" + }, + "object": { + "anyOf": [ + { + "additionalProperties": { + "$ref": "#/$defs/BlockType" + }, + "type": "object" + }, + { + "items": { + "$ref": "#/$defs/BlockType" }, "type": "array" } @@ -10376,89 +5998,7 @@ "type": "object" }, "PdlBlock": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/BlockType", "title": "PdlBlock" }, "PdlLocationType": { @@ -10513,90 +6053,7 @@ "default": null }, "pdl": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], - "title": "Pdl" + "$ref": "#/$defs/BlockType" } }, "required": [ @@ -10721,110 +6178,28 @@ { "type": "null" } - ], - "default": 0, - "title": "Completion Tokens" - }, - "prompt_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": 0, - "title": "Prompt Tokens" - } - }, - "title": "PdlUsage", - "type": "object" - }, - "Program": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + ], + "default": 0, + "title": "Completion Tokens" }, - { - "type": "null" + "prompt_tokens": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ], + "default": 0, + "title": "Prompt Tokens" } - ], + }, + "title": "PdlUsage", + "type": "object" + }, + "Program": { + "$ref": "#/$defs/BlockType", "description": "Prompt Declaration Language program (PDL)", "title": "Program" }, @@ -10852,89 +6227,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -11003,90 +6296,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -11256,146 +6473,64 @@ "type": "string" }, { - "type": "null" - } - ], - "default": null, - "title": "Description" - }, - "spec": { - "$ref": "#/$defs/PdlTypeType", - "default": null - }, - "regex": { - "title": "Regex", - "type": "string" - }, - "mode": { - "default": "fullmatch", - "enum": [ - "search", - "match", - "fullmatch", - "split", - "findall" - ], - "title": "Mode", - "type": "string" - } - }, - "required": [ - "regex" - ], - "title": "RegexParser", - "type": "object" - }, - "RepeatBlock": { - "additionalProperties": false, - "description": "Repeat the execution of a block sequentially.\nThe scope and `pdl_context` are accumulated in between iterations.\n\nFor loop example:\n```PDL\nfor:\n number: [1, 2, 3, 4]\n name: [\"Bob\", \"Carol\", \"David\", \"Ernest\"]\nrepeat:\n \"${ name }'s number is ${ number }\\n\"\n```\n\nWhile loop:\n```PDL\ndefs:\n i: 0\nwhile: ${i < 5}\nrepeat:\n defs:\n i: ${ i + 1}\n data: ${ i }\njoin:\n as: array\n```", - "properties": { - "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" - }, - "spec": { - "$ref": "#/$defs/PdlTypeType", - "default": null, - "description": "Type specification of the result of the block.\n " - }, - "defs": { - "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "type": "null" + } + ], + "default": null, + "title": "Description" + }, + "spec": { + "$ref": "#/$defs/PdlTypeType", + "default": null + }, + "regex": { + "title": "Regex", + "type": "string" + }, + "mode": { + "default": "fullmatch", + "enum": [ + "search", + "match", + "fullmatch", + "split", + "findall" + ], + "title": "Mode", + "type": "string" + } + }, + "required": [ + "regex" + ], + "title": "RegexParser", + "type": "object" + }, + "RepeatBlock": { + "additionalProperties": false, + "description": "Repeat the execution of a block sequentially.\nThe scope and `pdl_context` are accumulated in between iterations.\n\nFor loop example:\n```PDL\nfor:\n number: [1, 2, 3, 4]\n name: [\"Bob\", \"Carol\", \"David\", \"Ernest\"]\nrepeat:\n \"${ name }'s number is ${ number }\\n\"\n```\n\nWhile loop:\n```PDL\ndefs:\n i: 0\nwhile: ${i < 5}\nrepeat:\n defs:\n i: ${ i + 1}\n data: ${ i }\njoin:\n as: array\n```", + "properties": { + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "default": null, + "description": "Documentation associated to the block.\n ", + "title": "Description" + }, + "spec": { + "$ref": "#/$defs/PdlTypeType", + "default": null, + "description": "Type specification of the result of the block.\n " + }, + "defs": { + "additionalProperties": { + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -11464,90 +6599,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -11727,91 +6786,8 @@ "title": "While" }, "repeat": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ], - "description": "Body of the loop.\n ", - "title": "Repeat" + "$ref": "#/$defs/BlockType", + "description": "Body of the loop.\n " }, "until": { "anyOf": [ @@ -11852,114 +6828,32 @@ "anyOf": [ { "$ref": "#/$defs/JoinText" - }, - { - "$ref": "#/$defs/JoinArray" - }, - { - "$ref": "#/$defs/JoinObject" - }, - { - "$ref": "#/$defs/JoinLastOf" - }, - { - "$ref": "#/$defs/JoinReduce" - } - ], - "default": { - "as": "text", - "with": "" - }, - "description": "Define how to combine the result of each iteration.\n ", - "title": "Join" - }, - "pdl__trace": { - "anyOf": [ - { - "items": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + }, + { + "$ref": "#/$defs/JoinArray" + }, + { + "$ref": "#/$defs/JoinObject" + }, + { + "$ref": "#/$defs/JoinLastOf" + }, + { + "$ref": "#/$defs/JoinReduce" + } + ], + "default": { + "as": "text", + "with": "" + }, + "description": "Define how to combine the result of each iteration.\n ", + "title": "Join" + }, + "pdl__trace": { + "anyOf": [ + { + "items": { + "$ref": "#/$defs/BlockType" }, "type": "array" }, @@ -12001,89 +6895,7 @@ }, "defs": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "default": {}, "description": "Set of definitions executed before the execution of the block.\n ", @@ -12152,90 +6964,14 @@ "fallback": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], "default": null, - "description": "Block to execute in case of error.\n ", - "title": "Fallback" + "description": "Block to execute in case of error.\n " }, "retry": { "anyOf": [ @@ -12361,173 +7097,13 @@ "text": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" + "$ref": "#/$defs/BlockType" }, { "items": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/FunctionBlock" - }, - { - "$ref": "#/$defs/CallBlock" - }, - { - "$ref": "#/$defs/LitellmModelBlock" - }, - { - "$ref": "#/$defs/GraniteioModelBlock" - }, - { - "$ref": "#/$defs/CodeBlock" - }, - { - "$ref": "#/$defs/ArgsBlock" - }, - { - "$ref": "#/$defs/GetBlock" - }, - { - "$ref": "#/$defs/DataBlock" - }, - { - "$ref": "#/$defs/IfBlock" - }, - { - "$ref": "#/$defs/MatchBlock" - }, - { - "$ref": "#/$defs/RepeatBlock" - }, - { - "$ref": "#/$defs/MapBlock" - }, - { - "$ref": "#/$defs/TextBlock" - }, - { - "$ref": "#/$defs/LastOfBlock" - }, - { - "$ref": "#/$defs/ArrayBlock" - }, - { - "$ref": "#/$defs/ObjectBlock" - }, - { - "$ref": "#/$defs/MessageBlock" - }, - { - "$ref": "#/$defs/ReadBlock" - }, - { - "$ref": "#/$defs/IncludeBlock" - }, - { - "$ref": "#/$defs/ImportBlock" - }, - { - "$ref": "#/$defs/ErrorBlock" - }, - { - "$ref": "#/$defs/EmptyBlock" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/BlockType" }, "type": "array" - }, - { - "type": "null" } ], "description": "Body of the text.\n ", diff --git a/src/pdl/pdl_ast.py b/src/pdl/pdl_ast.py index 6f0224ca6..8a75d3a4d 100644 --- a/src/pdl/pdl_ast.py +++ b/src/pdl/pdl_ast.py @@ -178,7 +178,6 @@ class PdlType(BaseModel): model_config = ConfigDict(extra="forbid") - class OptionalPdlType(PdlType): """Optional type.""" @@ -1041,7 +1040,10 @@ class EmptyBlock(LeafBlock): ) """Different types of structured blocks. """ -BlockType: TypeAlias = None | bool | int | float | str | AdvancedBlockType +# BlockType: TypeAlias = None | bool | int | float | str | AdvancedBlockType +BlockType = TypeAliasType( + "BlockType", Union[None, bool, int, float, str, AdvancedBlockType] +) """All kinds of blocks. """ BlockOrBlocksType: TypeAlias = BlockType | list[BlockType] # pyright: ignore From 4d89be65cadfd2a8572436e313d5042dfe12b78e Mon Sep 17 00:00:00 2001 From: Louis Mandel Date: Tue, 29 Jul 2025 15:59:12 -0400 Subject: [PATCH 02/10] Formatting Signed-off-by: Louis Mandel --- src/pdl/pdl_ast.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pdl/pdl_ast.py b/src/pdl/pdl_ast.py index 8a75d3a4d..d69e5cab0 100644 --- a/src/pdl/pdl_ast.py +++ b/src/pdl/pdl_ast.py @@ -178,6 +178,7 @@ class PdlType(BaseModel): model_config = ConfigDict(extra="forbid") + class OptionalPdlType(PdlType): """Optional type.""" From 35a66236b93f9b508fee2d9ab7957dda7f400a36 Mon Sep 17 00:00:00 2001 From: Louis Mandel Date: Tue, 29 Jul 2025 16:06:14 -0400 Subject: [PATCH 03/10] Refactor more types Signed-off-by: Louis Mandel --- pdl-live-react/src/pdl_ast.d.ts | 345 ++++++------------- src/pdl/pdl-schema.json | 578 +++++++------------------------- src/pdl/pdl_ast.py | 25 +- 3 files changed, 236 insertions(+), 712 deletions(-) diff --git a/pdl-live-react/src/pdl_ast.d.ts b/pdl-live-react/src/pdl_ast.d.ts index dcda39044..e8dd80d40 100644 --- a/pdl-live-react/src/pdl_ast.d.ts +++ b/pdl-live-react/src/pdl_ast.d.ts @@ -122,14 +122,7 @@ export type Contribute = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null +export type ParserType = ("json" | "jsonl" | "yaml") | PdlParser | RegexParser export type Description2 = string | null export type Description3 = string | null export type Regex = string @@ -195,14 +188,6 @@ export type Contribute1 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser1 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -255,14 +240,6 @@ export type Contribute2 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser2 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -315,14 +292,6 @@ export type Contribute3 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser3 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -380,14 +349,6 @@ export type Contribute4 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser4 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -446,14 +407,6 @@ export type Contribute5 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser5 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -510,14 +463,6 @@ export type Contribute6 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser6 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -574,14 +519,6 @@ export type Contribute7 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser7 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -640,14 +577,6 @@ export type Contribute8 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser8 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -681,7 +610,7 @@ export type PdlId8 = string | null export type PdlIsLeaf8 = false export type IndependentEnum1 = "independent" | "dependent" export type Kind8 = "match" -export type Case = +export type PatternType = | boolean | number | string @@ -691,30 +620,12 @@ export type Case = | AnyPattern | null export type Def9 = string | null +export type Anyof = PatternType[] export type Def10 = string | null +export type Array = PatternType[] export type Def11 = string | null export type Def12 = string | null export type Any = null -export type Array = ( - | boolean - | number - | string - | OrPattern - | ArrayPattern - | ObjectPattern - | AnyPattern - | null -)[] -export type Anyof = ( - | boolean - | number - | string - | OrPattern - | ArrayPattern - | ObjectPattern - | AnyPattern - | null -)[] export type If1 = LocalizedExpression | boolean | string | null export type PdlCaseResult = boolean | null export type PdlIfResult = boolean | null @@ -744,14 +655,6 @@ export type Contribute9 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser9 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -822,14 +725,6 @@ export type Contribute10 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser10 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -895,14 +790,6 @@ export type Contribute11 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser11 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -961,14 +848,6 @@ export type Contribute12 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser12 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1026,14 +905,6 @@ export type Contribute13 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser13 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1091,14 +962,6 @@ export type Contribute14 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser14 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1157,14 +1020,6 @@ export type Contribute15 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser15 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1217,14 +1072,6 @@ export type Contribute16 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser16 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1292,14 +1139,6 @@ export type Contribute17 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser17 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1358,14 +1197,6 @@ export type Contribute18 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser18 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1423,14 +1254,6 @@ export type Contribute19 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser19 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1488,14 +1311,6 @@ export type Contribute20 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser20 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1541,11 +1356,6 @@ export type ToolCallId = LocalizedExpression | string | null * */ export type Maxiterations = LocalizedExpression | number | string | null -/** - * Define how to combine the result of each iteration. - * - */ -export type Join = JoinText | JoinArray | JoinObject | JoinLastOf | JoinReduce /** * String concatenation of the result of each iteration. * @@ -1587,11 +1397,6 @@ export type Until = LocalizedExpression | boolean | string * */ export type Maxiterations1 = LocalizedExpression | number | string | null -/** - * Define how to combine the result of each iteration. - * - */ -export type Join1 = JoinText | JoinArray | JoinObject | JoinLastOf | JoinReduce export type PdlTrace1 = BlockType[] | null /** * Variable where to store the raw response of the model. @@ -1715,14 +1520,6 @@ export type Contribute21 = ( [k: string]: ContributeValue } )[] -/** - * Parser to use to construct a value out of a string result. - */ -export type Parser21 = - | ("json" | "jsonl" | "yaml") - | PdlParser - | RegexParser - | null /** * The maximum number of times to retry when an error occurs within a block. * @@ -1832,7 +1629,10 @@ export interface FunctionBlock { defs?: Defs def?: Def25 contribute?: Contribute21 - parser?: Parser21 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -1956,7 +1756,10 @@ export interface CallBlock { defs?: Defs1 def?: Def contribute?: Contribute - parser?: Parser + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -2126,7 +1929,10 @@ export interface LitellmModelBlock { defs?: Defs2 def?: Def1 contribute?: Contribute1 - parser?: Parser1 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -2228,7 +2034,10 @@ export interface GraniteioModelBlock { defs?: Defs3 def?: Def2 contribute?: Contribute2 - parser?: Parser2 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -2339,7 +2148,10 @@ export interface CodeBlock { defs?: Defs4 def?: Def3 contribute?: Contribute3 - parser?: Parser3 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -2440,7 +2252,10 @@ export interface ArgsBlock { defs?: Defs5 def?: Def4 contribute?: Contribute4 - parser?: Parser4 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -2505,7 +2320,10 @@ export interface GetBlock { defs?: Defs6 def?: Def5 contribute?: Contribute5 - parser?: Parser5 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -2588,7 +2406,10 @@ export interface DataBlock { defs?: Defs7 def?: Def6 contribute?: Contribute6 - parser?: Parser6 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -2661,7 +2482,10 @@ export interface IfBlock { defs?: Defs8 def?: Def7 contribute?: Contribute7 - parser?: Parser7 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -2777,7 +2601,10 @@ export interface MatchBlock { defs?: Defs9 def?: Def8 contribute?: Contribute8 - parser?: Parser8 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -2808,7 +2635,7 @@ export interface Defs9 { * Case of a match. */ export interface MatchCase { - case?: Case + case?: PatternType | null if?: If1 then: BlockType pdl__case_result?: PdlCaseResult @@ -2837,15 +2664,7 @@ export interface ObjectPattern { object: Object1 } export interface Object1 { - [k: string]: - | boolean - | number - | string - | OrPattern - | ArrayPattern - | ObjectPattern - | AnyPattern - | null + [k: string]: PatternType } /** * Match any value. @@ -2914,7 +2733,10 @@ export interface RepeatBlock { defs?: Defs10 def?: Def13 contribute?: Contribute9 - parser?: Parser9 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -2967,7 +2789,11 @@ export interface RepeatBlock { | null until?: Until maxIterations?: Maxiterations1 - join?: Join1 + /** + * Define how to combine the result of each iteration. + * + */ + join?: JoinText | JoinArray | JoinObject | JoinLastOf | JoinReduce pdl__trace?: PdlTrace1 } /** @@ -3035,7 +2861,10 @@ export interface MapBlock { defs?: Defs11 def?: Def14 contribute?: Contribute10 - parser?: Parser10 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -3086,7 +2915,11 @@ export interface MapBlock { | EmptyBlock | null maxIterations?: Maxiterations - join?: Join + /** + * Define how to combine the result of each iteration. + * + */ + join?: JoinText | JoinArray | JoinObject | JoinLastOf | JoinReduce pdl__trace?: PdlTrace } /** @@ -3133,7 +2966,10 @@ export interface TextBlock { defs?: Defs12 def?: Def15 contribute?: Contribute11 - parser?: Parser11 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -3196,7 +3032,10 @@ export interface LastOfBlock { defs?: Defs13 def?: Def16 contribute?: Contribute12 - parser?: Parser12 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -3259,7 +3098,10 @@ export interface ArrayBlock { defs?: Defs14 def?: Def17 contribute?: Contribute13 - parser?: Parser13 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -3322,7 +3164,10 @@ export interface ObjectBlock { defs?: Defs15 def?: Def18 contribute?: Contribute14 - parser?: Parser14 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -3385,7 +3230,10 @@ export interface MessageBlock { defs?: Defs16 def?: Def19 contribute?: Contribute15 - parser?: Parser15 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -3490,7 +3338,10 @@ export interface ReadBlock { defs?: Defs17 def?: Def20 contribute?: Contribute16 - parser?: Parser16 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -3554,7 +3405,10 @@ export interface IncludeBlock { defs?: Defs18 def?: Def21 contribute?: Contribute17 - parser?: Parser17 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -3618,7 +3472,10 @@ export interface ImportBlock { defs?: Defs19 def?: Def22 contribute?: Contribute18 - parser?: Parser18 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -3681,7 +3538,10 @@ export interface ErrorBlock { defs?: Defs20 def?: Def23 contribute?: Contribute19 - parser?: Parser19 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * @@ -3774,7 +3634,10 @@ export interface EmptyBlock { defs?: Defs21 def?: Def24 contribute?: Contribute20 - parser?: Parser20 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null /** * Block to execute in case of error. * diff --git a/src/pdl/pdl-schema.json b/src/pdl/pdl-schema.json index d7f83d87f..5ea9fd1ab 100644 --- a/src/pdl/pdl-schema.json +++ b/src/pdl/pdl-schema.json @@ -97,26 +97,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -344,26 +332,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -531,35 +507,7 @@ }, "array": { "items": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/OrPattern" - }, - { - "$ref": "#/$defs/ArrayPattern" - }, - { - "$ref": "#/$defs/ObjectPattern" - }, - { - "$ref": "#/$defs/AnyPattern" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/PatternType" }, "title": "Array", "type": "array" @@ -725,26 +673,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -991,26 +927,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -1269,26 +1193,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -1514,26 +1426,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -1753,26 +1653,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -1989,26 +1877,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -2250,26 +2126,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -2481,26 +2345,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -2851,26 +2703,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -3113,26 +2953,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -3355,26 +3183,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -3641,6 +3457,25 @@ "title": "JoinText", "type": "object" }, + "JoinType": { + "anyOf": [ + { + "$ref": "#/$defs/JoinText" + }, + { + "$ref": "#/$defs/JoinArray" + }, + { + "$ref": "#/$defs/JoinObject" + }, + { + "$ref": "#/$defs/JoinLastOf" + }, + { + "$ref": "#/$defs/JoinReduce" + } + ] + }, "JsonSchemaTypePdlType": { "additionalProperties": true, "description": "Json Schema with a type field.", @@ -3735,26 +3570,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -3973,26 +3796,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -4723,26 +4534,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -4941,29 +4740,12 @@ "title": "Maxiterations" }, "join": { - "anyOf": [ - { - "$ref": "#/$defs/JoinText" - }, - { - "$ref": "#/$defs/JoinArray" - }, - { - "$ref": "#/$defs/JoinObject" - }, - { - "$ref": "#/$defs/JoinLastOf" - }, - { - "$ref": "#/$defs/JoinReduce" - } - ], + "$ref": "#/$defs/JoinType", "default": { "as": "text", "with": "" }, - "description": "Define how to combine the result of each iteration.\n ", - "title": "Join" + "description": "Define how to combine the result of each iteration.\n " }, "pdl__trace": { "anyOf": [ @@ -5056,26 +4838,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -5246,35 +5016,13 @@ "case": { "anyOf": [ { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/OrPattern" - }, - { - "$ref": "#/$defs/ArrayPattern" - }, - { - "$ref": "#/$defs/ObjectPattern" - }, - { - "$ref": "#/$defs/AnyPattern" + "$ref": "#/$defs/PatternType" }, { "type": "null" } ], - "default": null, - "title": "Case" + "default": null }, "if": { "anyOf": [ @@ -5409,26 +5157,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -5671,26 +5407,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -5867,35 +5591,7 @@ }, "object": { "additionalProperties": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/OrPattern" - }, - { - "$ref": "#/$defs/ArrayPattern" - }, - { - "$ref": "#/$defs/ObjectPattern" - }, - { - "$ref": "#/$defs/AnyPattern" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/PatternType" }, "title": "Object", "type": "object" @@ -5957,35 +5653,7 @@ }, "anyOf": { "items": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "integer" - }, - { - "type": "number" - }, - { - "type": "string" - }, - { - "$ref": "#/$defs/OrPattern" - }, - { - "$ref": "#/$defs/ArrayPattern" - }, - { - "$ref": "#/$defs/ObjectPattern" - }, - { - "$ref": "#/$defs/AnyPattern" - }, - { - "type": "null" - } - ] + "$ref": "#/$defs/PatternType" }, "title": "Anyof", "type": "array" @@ -5997,6 +5665,55 @@ "title": "OrPattern", "type": "object" }, + "ParserType": { + "anyOf": [ + { + "enum": [ + "json", + "jsonl", + "yaml" + ], + "type": "string" + }, + { + "$ref": "#/$defs/PdlParser" + }, + { + "$ref": "#/$defs/RegexParser" + } + ] + }, + "PatternType": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "integer" + }, + { + "type": "number" + }, + { + "type": "string" + }, + { + "$ref": "#/$defs/OrPattern" + }, + { + "$ref": "#/$defs/ArrayPattern" + }, + { + "$ref": "#/$defs/ObjectPattern" + }, + { + "$ref": "#/$defs/AnyPattern" + }, + { + "type": "null" + } + ] + }, "PdlBlock": { "$ref": "#/$defs/BlockType", "title": "PdlBlock" @@ -6272,26 +5989,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -6575,26 +6280,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ @@ -6825,29 +6518,12 @@ "title": "Maxiterations" }, "join": { - "anyOf": [ - { - "$ref": "#/$defs/JoinText" - }, - { - "$ref": "#/$defs/JoinArray" - }, - { - "$ref": "#/$defs/JoinObject" - }, - { - "$ref": "#/$defs/JoinLastOf" - }, - { - "$ref": "#/$defs/JoinReduce" - } - ], + "$ref": "#/$defs/JoinType", "default": { "as": "text", "with": "" }, - "description": "Define how to combine the result of each iteration.\n ", - "title": "Join" + "description": "Define how to combine the result of each iteration.\n " }, "pdl__trace": { "anyOf": [ @@ -6940,26 +6616,14 @@ "parser": { "anyOf": [ { - "enum": [ - "json", - "jsonl", - "yaml" - ], - "type": "string" - }, - { - "$ref": "#/$defs/PdlParser" - }, - { - "$ref": "#/$defs/RegexParser" + "$ref": "#/$defs/ParserType" }, { "type": "null" } ], "default": null, - "description": "Parser to use to construct a value out of a string result.", - "title": "Parser" + "description": "Parser to use to construct a value out of a string result." }, "fallback": { "anyOf": [ diff --git a/src/pdl/pdl_ast.py b/src/pdl/pdl_ast.py index d69e5cab0..8a69be90d 100644 --- a/src/pdl/pdl_ast.py +++ b/src/pdl/pdl_ast.py @@ -140,16 +140,11 @@ class AnyPattern(Pattern): any: Literal[None] -PatternType: TypeAlias = ( - None - | bool - | int - | float - | str - | OrPattern - | ArrayPattern - | ObjectPattern - | AnyPattern +PatternType = TypeAliasType( + "PatternType", + Union[ + None, bool, int, float, str, OrPattern, ArrayPattern, ObjectPattern, AnyPattern + ], ) """Patterns allowed to match values in a `case` clause.""" @@ -261,8 +256,9 @@ class RegexParser(Parser): """Function used to parse to value (https://docs.python.org/3/library/re.html).""" -ParserType: TypeAlias = Literal["json", "jsonl", "yaml"] | PdlParser | RegexParser - +ParserType = TypeAliasType( + "ParserType", Union[Literal["json", "jsonl", "yaml"], PdlParser, RegexParser] +) RoleType: TypeAlias = Optional[str] """Role name.""" @@ -843,7 +839,9 @@ class JoinReduce(JoinConfig): """Function used to combine the results.""" -JoinType: TypeAlias = JoinText | JoinArray | JoinObject | JoinLastOf | JoinReduce +JoinType = TypeAliasType( + "JoinType", Union[JoinText, JoinArray, JoinObject, JoinLastOf, JoinReduce] +) """Different ways to join loop iterations.""" @@ -1041,7 +1039,6 @@ class EmptyBlock(LeafBlock): ) """Different types of structured blocks. """ -# BlockType: TypeAlias = None | bool | int | float | str | AdvancedBlockType BlockType = TypeAliasType( "BlockType", Union[None, bool, int, float, str, AdvancedBlockType] ) From 47d6d1363eabc3c55b19061c6601f231cc3cdc1c Mon Sep 17 00:00:00 2001 From: Louis Mandel Date: Tue, 29 Jul 2025 16:41:01 -0400 Subject: [PATCH 04/10] Fix error analyzer Signed-off-by: Louis Mandel --- src/pdl/pdl_schema_error_analyzer.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/pdl/pdl_schema_error_analyzer.py b/src/pdl/pdl_schema_error_analyzer.py index 93f207b24..9b9076159 100644 --- a/src/pdl/pdl_schema_error_analyzer.py +++ b/src/pdl/pdl_schema_error_analyzer.py @@ -156,6 +156,13 @@ def analyze_errors(defs, schema, data, loc: PdlLocationType) -> list[str]: # no the_type_exists = True if "enum" in item and data in item["enum"]: the_type_exists = True + if "$ref" in item: + ref_string = item["$ref"].split("/")[2] + ref_type = defs[ref_string] + errs = analyze_errors(defs, ref_type, data, loc) + the_type_exists = len(errs) == 0 + if the_type_exists: + break if not the_type_exists: ret.append( get_loc_string(loc) From 0d41532297526aa694d5939ba4bbcb0994fecaa3 Mon Sep 17 00:00:00 2001 From: Louis Mandel Date: Tue, 29 Jul 2025 16:58:29 -0400 Subject: [PATCH 05/10] More type aliases Signed-off-by: Louis Mandel --- pdl-live-react/src/pdl_ast.d.ts | 2030 +++++++++---------- src/pdl/pdl-schema.json | 3219 ++++++------------------------- src/pdl/pdl_ast.py | 74 +- 3 files changed, 1504 insertions(+), 3819 deletions(-) diff --git a/pdl-live-react/src/pdl_ast.d.ts b/pdl-live-react/src/pdl_ast.d.ts index e8dd80d40..aba9b14b4 100644 --- a/pdl-live-react/src/pdl_ast.d.ts +++ b/pdl-live-react/src/pdl_ast.d.ts @@ -36,11 +36,6 @@ export type Program = | ErrorBlock | EmptyBlock | null -/** - * Documentation associated to the block. - * - */ -export type Description = string | null export type Enum = unknown[] export type PdlTypeType = | ( @@ -95,16 +90,6 @@ export type BlockType = | ErrorBlock | EmptyBlock | null -/** - * Documentation associated to the block. - * - */ -export type Description1 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def = string | null /** * Values allowed in the `contribute` field. */ @@ -116,51 +101,18 @@ export type File = string * Indicate if the block contributes to the result and background context. * */ -export type Contribute = ( +export type ContributeType = ( | ContributeTarget | { [k: string]: ContributeValue } )[] export type ParserType = ("json" | "jsonl" | "yaml") | PdlParser | RegexParser -export type Description2 = string | null -export type Description3 = string | null export type Regex = string export type Mode = "search" | "match" | "fullmatch" | "split" | "findall" -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role = string | null -/** - * Current context - * - */ -export type PdlContext = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId = string | null -export type StartNanos = number | null -export type EndNanos = number | null -export type FirstUseNanos = number | null -export type Timezone = string | null +export type ModelInput = { + [k: string]: unknown +}[] export type PdlIsLeaf = true export type Kind = "call" /** @@ -168,160 +120,40 @@ export type Kind = "call" * */ export type Call = LocalizedExpression | FunctionBlock | string -/** - * Documentation associated to the block. - * - */ -export type Description4 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def1 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute1 = ( +export type ContributeType1 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry1 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry1 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role1 = string | null -/** - * Current context - * - */ -export type PdlContext1 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId1 = string | null export type PdlIsLeaf1 = true export type Kind1 = "model" -/** - * Documentation associated to the block. - * - */ -export type Description5 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def2 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute2 = ( +export type ContributeType2 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry2 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry2 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role2 = string | null -/** - * Current context - * - */ -export type PdlContext2 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId2 = string | null export type PdlIsLeaf2 = true export type Kind2 = "model" -/** - * Documentation associated to the block. - * - */ -export type Description6 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def3 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute3 = ( +export type ContributeType3 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry3 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry3 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role3 = string | null -/** - * Current context - * - */ -export type PdlContext3 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId3 = string | null export type PdlIsLeaf3 = true export type Kind3 = "code" /** @@ -329,56 +161,16 @@ export type Kind3 = "code" * */ export type Lang = "python" | "command" | "jinja" | "pdl" | "ipython" -/** - * Documentation associated to the block. - * - */ -export type Description7 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def4 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute4 = ( +export type ContributeType4 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry4 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry4 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role4 = string | null -/** - * Current context - * - */ -export type PdlContext4 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId4 = string | null export type PdlIsLeaf4 = true export type Kind4 = "code" export type Lang1 = "command" @@ -387,168 +179,48 @@ export type Lang1 = "command" * */ export type Args1 = (LocalizedExpression | string)[] -/** - * Documentation associated to the block. - * - */ -export type Description8 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def5 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute5 = ( +export type ContributeType5 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry5 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry5 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role5 = string | null -/** - * Current context - * - */ -export type PdlContext5 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId5 = string | null export type PdlIsLeaf5 = true export type Kind5 = "get" /** * Name of the variable to access. */ export type Get = string -/** - * Documentation associated to the block. - * - */ -export type Description9 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def6 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute6 = ( +export type ContributeType6 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry6 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry6 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role6 = string | null -/** - * Current context - * - */ -export type PdlContext6 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId6 = string | null export type PdlIsLeaf6 = true export type Kind6 = "data" /** * Do not evaluate expressions inside strings. */ export type Raw = boolean -/** - * Documentation associated to the block. - * - */ -export type Description10 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def7 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute7 = ( +export type ContributeType7 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry7 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry7 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role7 = string | null -/** - * Current context - * - */ -export type PdlContext7 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId7 = string | null export type PdlIsLeaf7 = false export type IndependentEnum = "independent" | "dependent" export type Kind7 = "if" @@ -557,56 +229,16 @@ export type Kind7 = "if" * */ export type If = LocalizedExpression | boolean | string -/** - * Documentation associated to the block. - * - */ -export type Description11 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def8 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute8 = ( +export type ContributeType8 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry8 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry8 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role8 = string | null -/** - * Current context - * - */ -export type PdlContext8 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId8 = string | null export type PdlIsLeaf8 = false export type IndependentEnum1 = "independent" | "dependent" export type Kind8 = "match" @@ -619,12 +251,8 @@ export type PatternType = | ObjectPattern | AnyPattern | null -export type Def9 = string | null export type Anyof = PatternType[] -export type Def10 = string | null export type Array = PatternType[] -export type Def11 = string | null -export type Def12 = string | null export type Any = null export type If1 = LocalizedExpression | boolean | string | null export type PdlCaseResult = boolean | null @@ -635,56 +263,16 @@ export type PdlMatched = boolean | null * */ export type With = MatchCase[] -/** - * Documentation associated to the block. - * - */ -export type Description12 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def13 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute9 = ( +export type ContributeType9 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry9 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry9 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role9 = string | null -/** - * Current context - * - */ -export type PdlContext9 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId9 = string | null export type PdlIsLeaf9 = false export type IndependentEnum2 = "independent" | "dependent" export type Kind9 = "repeat" @@ -695,66 +283,21 @@ export type Kind9 = "repeat" export type For = { [k: string]: LocalizedExpression | unknown[] | string } | null -/** - * Name of the variable containing the loop iteration. - * - */ -export type Index = string | null /** * Condition to stay at the beginning of the loop. * */ export type While = LocalizedExpression | boolean | string -/** - * Documentation associated to the block. - * - */ -export type Description13 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def14 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute10 = ( +export type ContributeType10 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry10 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry10 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role10 = string | null -/** - * Current context - * - */ -export type PdlContext10 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId10 = string | null export type PdlIsLeaf10 = false export type IndependentEnum3 = "independent" | "dependent" export type Kind10 = "map" @@ -765,61 +308,16 @@ export type Kind10 = "map" export type For1 = { [k: string]: LocalizedExpression | unknown[] | string } | null -/** - * Name of the variable containing the loop iteration. - * - */ -export type Index1 = string | null -/** - * Documentation associated to the block. - * - */ -export type Description14 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def15 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute11 = ( +export type ContributeType11 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry11 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry11 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role11 = string | null -/** - * Current context - * - */ -export type PdlContext11 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId11 = string | null export type PdlIsLeaf11 = false export type IndependentEnum4 = "independent" | "dependent" export type Kind11 = "text" @@ -828,56 +326,16 @@ export type Kind11 = "text" * */ export type Text = BlockType | BlockType[] -/** - * Documentation associated to the block. - * - */ -export type Description15 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def16 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute12 = ( +export type ContributeType12 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry12 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry12 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role12 = string | null -/** - * Current context - * - */ -export type PdlContext12 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId12 = string | null export type PdlIsLeaf12 = false export type IndependentEnum5 = "independent" | "dependent" export type Kind12 = "lastOf" @@ -885,56 +343,16 @@ export type Kind12 = "lastOf" * Sequence of blocks to execute. */ export type Lastof = BlockType[] -/** - * Documentation associated to the block. - * - */ -export type Description16 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def17 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute13 = ( +export type ContributeType13 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry13 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry13 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role13 = string | null -/** - * Current context - * - */ -export type PdlContext13 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId13 = string | null export type PdlIsLeaf13 = false export type IndependentEnum6 = "independent" | "dependent" export type Kind13 = "array" @@ -942,56 +360,16 @@ export type Kind13 = "array" * Elements of the array. */ export type Array1 = BlockType[] -/** - * Documentation associated to the block. - * - */ -export type Description17 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def18 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute14 = ( +export type ContributeType14 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry14 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry14 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role14 = string | null -/** - * Current context - * - */ -export type PdlContext14 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId14 = string | null export type PdlIsLeaf14 = false export type IndependentEnum7 = "independent" | "dependent" export type Kind14 = "object" @@ -1000,108 +378,28 @@ export type Object2 = [k: string]: BlockType } | BlockType[] -/** - * Documentation associated to the block. - * - */ -export type Description18 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def19 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute15 = ( +export type ContributeType15 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry15 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry15 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role15 = string | null -/** - * Current context - * - */ -export type PdlContext15 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId15 = string | null export type PdlIsLeaf15 = true export type Kind15 = "message" -/** - * Documentation associated to the block. - * - */ -export type Description19 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def20 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute16 = ( +export type ContributeType16 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry16 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry16 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role16 = string | null -/** - * Current context - * - */ -export type PdlContext16 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId16 = string | null export type PdlIsLeaf16 = true export type Kind16 = "read" /** @@ -1109,66 +407,21 @@ export type Kind16 = "read" * */ export type Read = LocalizedExpression | string | null -/** - * Message to prompt the user to enter a value. - * - */ -export type Message = string | null /** * Indicate if one or multiple lines should be read. * */ export type Multiline = boolean -/** - * Documentation associated to the block. - * - */ -export type Description20 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def21 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute17 = ( +export type ContributeType17 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry17 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry17 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role17 = string | null -/** - * Current context - * - */ -export type PdlContext17 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId17 = string | null export type PdlIsLeaf17 = false export type IndependentEnum8 = "independent" | "dependent" export type Kind17 = "include" @@ -1177,56 +430,16 @@ export type Kind17 = "include" * */ export type Include = string -/** - * Documentation associated to the block. - * - */ -export type Description21 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def22 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute18 = ( +export type ContributeType18 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry18 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry18 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role18 = string | null -/** - * Current context - * - */ -export type PdlContext18 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId18 = string | null export type PdlIsLeaf18 = true export type Kind18 = "import" /** @@ -1234,56 +447,16 @@ export type Kind18 = "import" * */ export type Import = string -/** - * Documentation associated to the block. - * - */ -export type Description22 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def23 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute19 = ( +export type ContributeType19 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry19 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry19 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role19 = string | null -/** - * Current context - * - */ -export type PdlContext19 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId19 = string | null export type PdlIsLeaf19 = true export type Kind19 = "error" /** @@ -1291,56 +464,16 @@ export type Kind19 = "error" * */ export type Msg = string -/** - * Documentation associated to the block. - * - */ -export type Description23 = string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def24 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute20 = ( +export type ContributeType20 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry20 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry20 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role20 = string | null -/** - * Current context - * - */ -export type PdlContext20 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId20 = string | null export type PdlIsLeaf20 = true export type Kind20 = "empty" /** @@ -1398,18 +531,6 @@ export type Until = LocalizedExpression | boolean | string */ export type Maxiterations1 = LocalizedExpression | number | string | null export type PdlTrace1 = BlockType[] | null -/** - * Variable where to store the raw response of the model. - * - */ -export type Modelresponse = string | null -export type CompletionTokens = number | null -export type PromptTokens = number | null -export type PdlModelInput = - | { - [k: string]: unknown - }[] - | null /** * Optional field to ensure that the block is using granite-io. * @@ -1426,16 +547,6 @@ export type Parameters = } | string | null -/** - * Variable where to store the raw response of the model. - * - */ -export type Modelresponse1 = string | null -export type PdlModelInput1 = - | { - [k: string]: unknown - }[] - | null /** * Optional field to ensure that the block is using LiteLLM. * @@ -1505,51 +616,16 @@ export type ModelList = unknown[] | string | null export type MockResponse = string | null export type CustomLlmProvider = string | null export type MaxRetries = number | string | null -/** - * Name of the variable used to store the result of the execution of the block. - * - */ -export type Def25 = string | null /** * Indicate if the block contributes to the result and background context. * */ -export type Contribute21 = ( +export type ContributeType21 = ( | ContributeTarget | { [k: string]: ContributeValue } )[] -/** - * The maximum number of times to retry when an error occurs within a block. - * - */ -export type Retry21 = number | null -/** - * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. - * - */ -export type TraceErrorOnRetry21 = boolean | string | null -/** - * Role associated to the block and sub-blocks. - * Typical roles are `system`, `user`, and `assistant`, - * but there may be other roles such as `available_tools`. - */ -export type Role21 = string | null -/** - * Current context - * - */ -export type PdlContext21 = - | { - [k: string]: unknown - }[] - | null -/** - * Unique identifier for this block - * - */ -export type PdlId21 = string | null export type PdlIsLeaf21 = true export type Kind21 = "function" /** @@ -1596,7 +672,11 @@ export type PdlBlock = * Function declaration. */ export interface FunctionBlock { - description?: Description + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -1627,8 +707,12 @@ export interface FunctionBlock { } | null defs?: Defs - def?: Def25 - contribute?: Contribute21 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType21 /** * Parser to use to construct a value out of a string result. */ @@ -1638,11 +722,32 @@ export interface FunctionBlock { * */ fallback?: BlockType | null - retry?: Retry21 - trace_error_on_retry?: TraceErrorOnRetry21 - role?: Role21 - pdl__context?: PdlContext21 - pdl__id?: PdlId21 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -1723,7 +828,11 @@ export interface Defs { * Calling a function. */ export interface CallBlock { - description?: Description1 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -1754,8 +863,12 @@ export interface CallBlock { } | null defs?: Defs1 - def?: Def - contribute?: Contribute + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType /** * Parser to use to construct a value out of a string result. */ @@ -1765,11 +878,32 @@ export interface CallBlock { * */ fallback?: BlockType | null - retry?: Retry - trace_error_on_retry?: TraceErrorOnRetry - role?: Role - pdl__context?: PdlContext - pdl__id?: PdlId + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -1815,7 +949,7 @@ export interface Table { * Use a PDL program as a parser specification (experimental). */ export interface PdlParser { - description?: Description2 + description?: string | null spec?: | ( | "null" @@ -1847,7 +981,7 @@ export interface PdlParser { * A regular expression parser. */ export interface RegexParser { - description?: Description3 + description?: string | null spec?: | ( | "null" @@ -1880,10 +1014,10 @@ export interface RegexParser { * Internal data structure to record timing information in the trace. */ export interface PdlTiming { - start_nanos?: StartNanos - end_nanos?: EndNanos - first_use_nanos?: FirstUseNanos - timezone?: Timezone + start_nanos?: number | null + end_nanos?: number | null + first_use_nanos?: number | null + timezone?: string | null } /** * Call an LLM through [the LiteLLM API](https://docs.litellm.ai/). @@ -1896,7 +1030,11 @@ export interface PdlTiming { * ``` */ export interface LitellmModelBlock { - description?: Description4 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -1927,8 +1065,12 @@ export interface LitellmModelBlock { } | null defs?: Defs2 - def?: Def1 - contribute?: Contribute1 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType1 /** * Parser to use to construct a value out of a string result. */ @@ -1938,11 +1080,32 @@ export interface LitellmModelBlock { * */ fallback?: BlockType | null - retry?: Retry1 - trace_error_on_retry?: TraceErrorOnRetry1 - role?: Role1 - pdl__context?: PdlContext1 - pdl__id?: PdlId1 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -1979,13 +1142,17 @@ export interface LitellmModelBlock { | ErrorBlock | EmptyBlock | null - modelResponse?: Modelresponse1 + /** + * Variable where to store the raw response of the model. + * + */ + modelResponse?: string | null /** * Tokens consumed during model call * */ pdl__usage?: PdlUsage | null - pdl__model_input?: PdlModelInput1 + pdl__model_input?: ModelInput | null platform?: Platform1 model: Model1 parameters?: Parameters1 @@ -2001,7 +1168,11 @@ export interface Defs2 { * Call an LLM through the granite-io API. */ export interface GraniteioModelBlock { - description?: Description5 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -2032,8 +1203,12 @@ export interface GraniteioModelBlock { } | null defs?: Defs3 - def?: Def2 - contribute?: Contribute2 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType2 /** * Parser to use to construct a value out of a string result. */ @@ -2043,11 +1218,32 @@ export interface GraniteioModelBlock { * */ fallback?: BlockType | null - retry?: Retry2 - trace_error_on_retry?: TraceErrorOnRetry2 - role?: Role2 - pdl__context?: PdlContext2 - pdl__id?: PdlId2 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -2084,13 +1280,17 @@ export interface GraniteioModelBlock { | ErrorBlock | EmptyBlock | null - modelResponse?: Modelresponse + /** + * Variable where to store the raw response of the model. + * + */ + modelResponse?: string | null /** * Tokens consumed during model call * */ pdl__usage?: PdlUsage | null - pdl__model_input?: PdlModelInput + pdl__model_input?: ModelInput | null platform?: Platform processor: unknown parameters?: Parameters @@ -2115,7 +1315,11 @@ export interface Defs3 { * ``` */ export interface CodeBlock { - description?: Description6 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -2146,8 +1350,12 @@ export interface CodeBlock { } | null defs?: Defs4 - def?: Def3 - contribute?: Contribute3 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType3 /** * Parser to use to construct a value out of a string result. */ @@ -2157,11 +1365,32 @@ export interface CodeBlock { * */ fallback?: BlockType | null - retry?: Retry3 - trace_error_on_retry?: TraceErrorOnRetry3 - role?: Role3 - pdl__context?: PdlContext3 - pdl__id?: PdlId3 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -2219,7 +1448,11 @@ export interface Defs4 { * ``` */ export interface ArgsBlock { - description?: Description7 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -2250,8 +1483,12 @@ export interface ArgsBlock { } | null defs?: Defs5 - def?: Def4 - contribute?: Contribute4 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType4 /** * Parser to use to construct a value out of a string result. */ @@ -2261,11 +1498,32 @@ export interface ArgsBlock { * */ fallback?: BlockType | null - retry?: Retry4 - trace_error_on_retry?: TraceErrorOnRetry4 - role?: Role4 - pdl__context?: PdlContext4 - pdl__id?: PdlId4 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -2287,7 +1545,11 @@ export interface Defs5 { * The GetBlock is deprecated. Use DataBlock instead. */ export interface GetBlock { - description?: Description8 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -2318,8 +1580,12 @@ export interface GetBlock { } | null defs?: Defs6 - def?: Def5 - contribute?: Contribute5 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType5 /** * Parser to use to construct a value out of a string result. */ @@ -2329,11 +1595,32 @@ export interface GetBlock { * */ fallback?: BlockType | null - retry?: Retry5 - trace_error_on_retry?: TraceErrorOnRetry5 - role?: Role5 - pdl__context?: PdlContext5 - pdl__id?: PdlId5 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -2373,7 +1660,11 @@ export interface Defs6 { * ``` */ export interface DataBlock { - description?: Description9 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -2404,8 +1695,12 @@ export interface DataBlock { } | null defs?: Defs7 - def?: Def6 - contribute?: Contribute6 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType6 /** * Parser to use to construct a value out of a string result. */ @@ -2415,11 +1710,32 @@ export interface DataBlock { * */ fallback?: BlockType | null - retry?: Retry6 - trace_error_on_retry?: TraceErrorOnRetry6 - role?: Role6 - pdl__context?: PdlContext6 - pdl__id?: PdlId6 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -2449,7 +1765,11 @@ export interface Defs7 { * ``` */ export interface IfBlock { - description?: Description10 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -2480,8 +1800,12 @@ export interface IfBlock { } | null defs?: Defs8 - def?: Def7 - contribute?: Contribute7 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType7 /** * Parser to use to construct a value out of a string result. */ @@ -2491,11 +1815,32 @@ export interface IfBlock { * */ fallback?: BlockType | null - retry?: Retry7 - trace_error_on_retry?: TraceErrorOnRetry7 - role?: Role7 - pdl__context?: PdlContext7 - pdl__id?: PdlId7 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -2568,7 +1913,11 @@ export interface Defs8 { * - then: Too low */ export interface MatchBlock { - description?: Description11 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -2599,22 +1948,47 @@ export interface MatchBlock { } | null defs?: Defs9 - def?: Def8 - contribute?: Contribute8 /** - * Parser to use to construct a value out of a string result. + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType8 + /** + * Parser to use to construct a value out of a string result. + */ + parser?: ParserType | null + /** + * Block to execute in case of error. + * + */ + fallback?: BlockType | null + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. */ - parser?: ParserType | null + role?: string | null /** - * Block to execute in case of error. + * Current context * */ - fallback?: BlockType | null - retry?: Retry8 - trace_error_on_retry?: TraceErrorOnRetry8 - role?: Role8 - pdl__context?: PdlContext8 - pdl__id?: PdlId8 + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -2646,21 +2020,21 @@ export interface MatchCase { * Match any of the patterns. */ export interface OrPattern { - def?: Def9 + def?: string | null anyOf: Anyof } /** * Match an array. */ export interface ArrayPattern { - def?: Def10 + def?: string | null array: Array } /** * Match an object. */ export interface ObjectPattern { - def?: Def11 + def?: string | null object: Object1 } export interface Object1 { @@ -2670,7 +2044,7 @@ export interface Object1 { * Match any value. */ export interface AnyPattern { - def?: Def12 + def?: string | null any: Any } /** @@ -2700,7 +2074,11 @@ export interface AnyPattern { * ``` */ export interface RepeatBlock { - description?: Description12 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -2731,8 +2109,12 @@ export interface RepeatBlock { } | null defs?: Defs10 - def?: Def13 - contribute?: Contribute9 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType9 /** * Parser to use to construct a value out of a string result. */ @@ -2742,11 +2124,32 @@ export interface RepeatBlock { * */ fallback?: BlockType | null - retry?: Retry9 - trace_error_on_retry?: TraceErrorOnRetry9 - role?: Role9 - pdl__context?: PdlContext9 - pdl__id?: PdlId9 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -2754,7 +2157,11 @@ export interface RepeatBlock { context?: IndependentEnum2 kind?: Kind9 for?: For - index?: Index + /** + * Name of the variable containing the loop iteration. + * + */ + index?: string | null while?: While /** * Body of the loop. @@ -2828,7 +2235,11 @@ export interface Defs10 { * ``` */ export interface MapBlock { - description?: Description13 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -2859,8 +2270,12 @@ export interface MapBlock { } | null defs?: Defs11 - def?: Def14 - contribute?: Contribute10 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType10 /** * Parser to use to construct a value out of a string result. */ @@ -2870,11 +2285,32 @@ export interface MapBlock { * */ fallback?: BlockType | null - retry?: Retry10 - trace_error_on_retry?: TraceErrorOnRetry10 - role?: Role10 - pdl__context?: PdlContext10 - pdl__id?: PdlId10 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -2882,7 +2318,11 @@ export interface MapBlock { context?: IndependentEnum3 kind?: Kind10 for?: For1 - index?: Index1 + /** + * Name of the variable containing the loop iteration. + * + */ + index?: string | null /** * Body of the iterator. * @@ -2933,7 +2373,11 @@ export interface Defs11 { * Create the concatenation of the stringify version of the result of each block of the list of blocks. */ export interface TextBlock { - description?: Description14 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -2964,8 +2408,12 @@ export interface TextBlock { } | null defs?: Defs12 - def?: Def15 - contribute?: Contribute11 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType11 /** * Parser to use to construct a value out of a string result. */ @@ -2975,11 +2423,32 @@ export interface TextBlock { * */ fallback?: BlockType | null - retry?: Retry11 - trace_error_on_retry?: TraceErrorOnRetry11 - role?: Role11 - pdl__context?: PdlContext11 - pdl__id?: PdlId11 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -2999,7 +2468,11 @@ export interface Defs12 { * Return the value of the last block if the list of blocks. */ export interface LastOfBlock { - description?: Description15 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -3030,8 +2503,12 @@ export interface LastOfBlock { } | null defs?: Defs13 - def?: Def16 - contribute?: Contribute12 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType12 /** * Parser to use to construct a value out of a string result. */ @@ -3041,11 +2518,32 @@ export interface LastOfBlock { * */ fallback?: BlockType | null - retry?: Retry12 - trace_error_on_retry?: TraceErrorOnRetry12 - role?: Role12 - pdl__context?: PdlContext12 - pdl__id?: PdlId12 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -3065,7 +2563,11 @@ export interface Defs13 { * Return the array of values computed by each block of the list of blocks. */ export interface ArrayBlock { - description?: Description16 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -3096,8 +2598,12 @@ export interface ArrayBlock { } | null defs?: Defs14 - def?: Def17 - contribute?: Contribute13 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType13 /** * Parser to use to construct a value out of a string result. */ @@ -3107,11 +2613,32 @@ export interface ArrayBlock { * */ fallback?: BlockType | null - retry?: Retry13 - trace_error_on_retry?: TraceErrorOnRetry13 - role?: Role13 - pdl__context?: PdlContext13 - pdl__id?: PdlId13 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -3131,7 +2658,11 @@ export interface Defs14 { * Return the object where the value of each field is defined by a block. If the body of the object is an array, the resulting object is the union of the objects computed by each element of the array. */ export interface ObjectBlock { - description?: Description17 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -3162,8 +2693,12 @@ export interface ObjectBlock { } | null defs?: Defs15 - def?: Def18 - contribute?: Contribute14 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType14 /** * Parser to use to construct a value out of a string result. */ @@ -3173,11 +2708,32 @@ export interface ObjectBlock { * */ fallback?: BlockType | null - retry?: Retry14 - trace_error_on_retry?: TraceErrorOnRetry14 - role?: Role14 - pdl__context?: PdlContext14 - pdl__id?: PdlId14 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -3197,7 +2753,11 @@ export interface Defs15 { * Create a message. */ export interface MessageBlock { - description?: Description18 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -3228,8 +2788,12 @@ export interface MessageBlock { } | null defs?: Defs16 - def?: Def19 - contribute?: Contribute15 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType15 /** * Parser to use to construct a value out of a string result. */ @@ -3239,11 +2803,32 @@ export interface MessageBlock { * */ fallback?: BlockType | null - retry?: Retry15 - trace_error_on_retry?: TraceErrorOnRetry15 - role?: Role15 - pdl__context?: PdlContext15 - pdl__id?: PdlId15 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -3305,7 +2890,11 @@ export interface Defs16 { * ``` */ export interface ReadBlock { - description?: Description19 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -3336,8 +2925,12 @@ export interface ReadBlock { } | null defs?: Defs17 - def?: Def20 - contribute?: Contribute16 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType16 /** * Parser to use to construct a value out of a string result. */ @@ -3347,18 +2940,43 @@ export interface ReadBlock { * */ fallback?: BlockType | null - retry?: Retry16 - trace_error_on_retry?: TraceErrorOnRetry16 - role?: Role16 - pdl__context?: PdlContext16 - pdl__id?: PdlId16 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf16 kind?: Kind16 read: Read - message?: Message + /** + * Message to prompt the user to enter a value. + * + */ + message?: string | null multiline?: Multiline } /** @@ -3372,7 +2990,11 @@ export interface Defs17 { * Include a PDL file. */ export interface IncludeBlock { - description?: Description20 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -3403,8 +3025,12 @@ export interface IncludeBlock { } | null defs?: Defs18 - def?: Def21 - contribute?: Contribute17 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType17 /** * Parser to use to construct a value out of a string result. */ @@ -3414,11 +3040,32 @@ export interface IncludeBlock { * */ fallback?: BlockType | null - retry?: Retry17 - trace_error_on_retry?: TraceErrorOnRetry17 - role?: Role17 - pdl__context?: PdlContext17 - pdl__id?: PdlId17 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -3439,7 +3086,11 @@ export interface Defs18 { * Import a PDL file. */ export interface ImportBlock { - description?: Description21 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -3470,8 +3121,12 @@ export interface ImportBlock { } | null defs?: Defs19 - def?: Def22 - contribute?: Contribute18 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType18 /** * Parser to use to construct a value out of a string result. */ @@ -3481,11 +3136,32 @@ export interface ImportBlock { * */ fallback?: BlockType | null - retry?: Retry18 - trace_error_on_retry?: TraceErrorOnRetry18 - role?: Role18 - pdl__context?: PdlContext18 - pdl__id?: PdlId18 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -3505,7 +3181,11 @@ export interface Defs19 { * Block representing an error generated at runtime. */ export interface ErrorBlock { - description?: Description22 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -3536,8 +3216,12 @@ export interface ErrorBlock { } | null defs?: Defs20 - def?: Def23 - contribute?: Contribute19 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType19 /** * Parser to use to construct a value out of a string result. */ @@ -3547,11 +3231,32 @@ export interface ErrorBlock { * */ fallback?: BlockType | null - retry?: Retry19 - trace_error_on_retry?: TraceErrorOnRetry19 - role?: Role19 - pdl__context?: PdlContext19 - pdl__id?: PdlId19 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -3601,7 +3306,11 @@ export interface Defs20 { * Block without an action. It can contain definitions. */ export interface EmptyBlock { - description?: Description23 + /** + * Documentation associated to the block. + * + */ + description?: string | null /** * Type specification of the result of the block. * @@ -3632,8 +3341,12 @@ export interface EmptyBlock { } | null defs?: Defs21 - def?: Def24 - contribute?: Contribute20 + /** + * Name of the variable used to store the result of the execution of the block. + * + */ + def?: string | null + contribute?: ContributeType20 /** * Parser to use to construct a value out of a string result. */ @@ -3643,11 +3356,32 @@ export interface EmptyBlock { * */ fallback?: BlockType | null - retry?: Retry20 - trace_error_on_retry?: TraceErrorOnRetry20 - role?: Role20 - pdl__context?: PdlContext20 - pdl__id?: PdlId20 + /** + * The maximum number of times to retry when an error occurs within a block. + * + */ + retry?: number | null + /** + * Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. + * + */ + trace_error_on_retry?: boolean | string | null + /** + * Role associated to the block and sub-blocks. + * Typical roles are `system`, `user`, and `assistant`, + * but there may be other roles such as `available_tools`. + */ + role?: string | null + /** + * Current context + * + */ + pdl__context?: ModelInput | null + /** + * Unique identifier for this block + * + */ + pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null pdl__timing?: PdlTiming | null @@ -3697,8 +3431,8 @@ export interface JoinReduce { * Internal data structure to record token consumption usage information. */ export interface PdlUsage { - completion_tokens?: CompletionTokens - prompt_tokens?: PromptTokens + completion_tokens?: number | null + prompt_tokens?: number | null [k: string]: unknown } /** diff --git a/src/pdl/pdl-schema.json b/src/pdl/pdl-schema.json index 5ea9fd1ab..b26826fd4 100644 --- a/src/pdl/pdl-schema.json +++ b/src/pdl/pdl-schema.json @@ -5,16 +5,8 @@ "description": "Match any value.", "properties": { "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Def" + "$ref": "#/$defs/OptionalStr", + "default": null }, "any": { "const": null, @@ -33,17 +25,9 @@ "description": "Execute a command line, which will spawn a subprocess with the given argument vector. Note: if you need a shell script execution, you must wrap your command line in /bin/sh or some shell of your choosing.\n\nExample:\n```PDL\nargs:\n- /bin/sh\n- \"-c\"\n- \"if [[ $x = 1 ]]; then echo y; else echo n; fi\"\n```", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -60,39 +44,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -119,97 +81,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -268,17 +170,9 @@ "description": "Return the array of values computed by each block of the list of blocks.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -295,39 +189,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -354,97 +226,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -494,16 +306,8 @@ "description": "Match an array.", "properties": { "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Def" + "$ref": "#/$defs/OptionalStr", + "default": null }, "array": { "items": { @@ -609,17 +413,9 @@ "description": "Calling a function.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -636,39 +432,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -695,103 +469,43 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { + "$ref": "#/$defs/OptionalModelInput", + "default": [], + "description": "Current context\n " + }, + "pdl__id": { + "$ref": "#/$defs/OptionalStr", + "default": "", + "description": "Unique identifier for this block\n " + }, + "pdl__result": { + "$ref": "#/$defs/OptionalAny", + "default": null, + "description": "Result of the execution of the block" + }, + "pdl__location": { + "$ref": "#/$defs/OptionalPdlLocationType", + "default": null + }, + "pdl__timing": { "anyOf": [ { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": [], - "description": "Current context\n ", - "title": "Pdl Context" - }, - "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" - }, - "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], - "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" - }, - "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], - "default": null - }, - "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" + "$ref": "#/$defs/PdlTiming" }, { "type": "null" @@ -863,17 +577,9 @@ "description": "Execute a piece of code.\n\nExample:\n```PDL\nlang: python\ncode: |\n import random\n # (In PDL, set `result` to the output you wish for your code block.)\n result = random.randint(1, 20)\n```", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -890,39 +596,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -949,97 +633,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -1098,6 +722,22 @@ "title": "ContributeTarget", "type": "string" }, + "ContributeType": { + "items": { + "anyOf": [ + { + "$ref": "#/$defs/ContributeTarget" + }, + { + "additionalProperties": { + "$ref": "#/$defs/ContributeValue" + }, + "type": "object" + } + ] + }, + "type": "array" + }, "ContributeValue": { "additionalProperties": false, "description": "Contribution of a specific value instead of the default one.", @@ -1129,17 +769,9 @@ "description": "Arbitrary value, equivalent to JSON.\n\nExample. As part of a `defs` section, set `numbers` to the list `[1, 2, 3, 4]`:\n```PDL\ndefs:\n numbers:\n data: [1, 2, 3, 4]\n```\n\nExample. Evaluate `${ TEST.answer }` in\n[Jinja](https://jinja.palletsprojects.com/en/stable/), passing\nthe result to a regex parser with capture groups. Set\n`EXTRACTED_GROUND_TRUTH` to an object with attribute `answer`,\na string, containing the value of the capture group.\n```PDL\n- data: ${ TEST.answer }\n parser:\n regex: \"(.|\\n)*#### (?P([0-9])*)\\n*\"\n spec:\n answer: string\n def: EXTRACTED_GROUND_TRUTH\n```", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -1156,39 +788,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -1215,97 +825,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -1362,17 +912,9 @@ "description": "Block without an action. It can contain definitions.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -1389,39 +931,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -1448,97 +968,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -1589,17 +1049,9 @@ "description": "Block representing an error generated at runtime.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -1616,39 +1068,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -1675,97 +1105,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -1813,17 +1183,9 @@ "description": "Function declaration.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -1840,39 +1202,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -1899,97 +1239,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -2062,17 +1342,9 @@ "description": "Get the value of a variable.\n\nThe GetBlock is deprecated. Use DataBlock instead.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -2089,39 +1361,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -2148,97 +1398,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -2281,17 +1471,9 @@ "description": "Call an LLM through the granite-io API.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -2308,39 +1490,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -2352,112 +1512,52 @@ } ], "default": null, - "description": "Parser to use to construct a value out of a string result." - }, - "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Block to execute in case of error.\n " - }, - "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" - }, - "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" - }, - "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Parser to use to construct a value out of a string result." }, - "pdl__context": { + "fallback": { "anyOf": [ { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" + "$ref": "#/$defs/BlockType" }, { "type": "null" } ], + "default": null, + "description": "Block to execute in case of error.\n " + }, + "retry": { + "$ref": "#/$defs/OptionalInt", + "default": null, + "description": "The maximum number of times to retry when an error occurs within a block.\n " + }, + "trace_error_on_retry": { + "$ref": "#/$defs/OptionalBoolOrStr", + "default": null, + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " + }, + "role": { + "$ref": "#/$defs/OptionalStr", + "default": null, + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." + }, + "pdl__context": { + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -2489,17 +1589,9 @@ "description": "Messages to send to the model.\n " }, "modelResponse": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Variable where to store the raw response of the model.\n ", - "title": "Modelresponse" + "description": "Variable where to store the raw response of the model.\n " }, "pdl__usage": { "anyOf": [ @@ -2514,20 +1606,8 @@ "description": "Tokens consumed during model call\n " }, "pdl__model_input": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Pdl Model Input" + "$ref": "#/$defs/OptionalModelInput", + "default": null }, "platform": { "const": "granite-io", @@ -2639,17 +1719,9 @@ "description": "Conditional control structure.\n\nExample:\n```PDL\ndefs:\n answer:\n read:\n message: \"Enter a number? \"\nif: ${ (answer | int) == 42 }\nthen: You won!\n```", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -2666,39 +1738,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -2725,97 +1775,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -2889,17 +1879,9 @@ "description": "Import a PDL file.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -2916,39 +1898,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -2975,97 +1935,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -3119,17 +2019,9 @@ "description": "Include a PDL file.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -3146,39 +2038,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" - ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + ], + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -3205,97 +2075,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -3506,17 +2316,9 @@ "description": "Return the value of the last block if the list of blocks.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -3533,39 +2335,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -3592,97 +2372,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -3732,17 +2452,9 @@ "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```", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -3759,39 +2471,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -3818,97 +2508,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -3940,17 +2570,9 @@ "description": "Messages to send to the model.\n " }, "modelResponse": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Variable where to store the raw response of the model.\n ", - "title": "Modelresponse" + "description": "Variable where to store the raw response of the model.\n " }, "pdl__usage": { "anyOf": [ @@ -3965,20 +2587,8 @@ "description": "Tokens consumed during model call\n " }, "pdl__model_input": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Pdl Model Input" + "$ref": "#/$defs/OptionalModelInput", + "default": null }, "platform": { "const": "litellm", @@ -4447,15 +3057,8 @@ "default": null, "title": "Pdl Result" }, - "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "pdl__location": { + "$ref": "#/$defs/OptionalPdlLocationType", "default": null } }, @@ -4470,17 +3073,9 @@ "description": "Independent executions of a block.\nRepeat the execution of a block starting from the initial scope\nand `pdl_context`.\n\nFor loop example:\n```PDL\nfor:\n number: [1, 2, 3, 4]\n name: [\"Bob\", \"Carol\", \"David\", \"Ernest\"]\nmap:\n \"${ name }'s number is ${ number }\\n\"\n```\n\nBounded loop:\n```PDL\nindex: i\nmaxIterations: 5\nmap:\n ${ i }\njoin:\n as: array\n```", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -4497,39 +3092,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -4556,97 +3129,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -4704,17 +3217,9 @@ "title": "For" }, "index": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable containing the loop iteration.\n ", - "title": "Index" + "description": "Name of the variable containing the loop iteration.\n " }, "map": { "$ref": "#/$defs/BlockType", @@ -4774,17 +3279,9 @@ "description": "Match control structure.\n\nExample:\n```PDL\ndefs:\n answer:\n read:\n message: \"Enter a number? \"\nmatch: ${ (answer | int) }\nwith:\n- case: 42\n then: You won!\n- case:\n any:\n def: x\n if: ${ x > 42 }\n then: Too high\n- then: Too low", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -4801,39 +3298,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -4860,97 +3335,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -5093,17 +3508,9 @@ "description": "Create a message.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -5120,39 +3527,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -5179,97 +3564,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" - }, - "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", + "default": "", + "description": "Unique identifier for this block\n " + }, + "pdl__result": { + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -5338,22 +3663,21 @@ "title": "MessageBlock", "type": "object" }, + "ModelInput": { + "items": { + "additionalProperties": true, + "type": "object" + }, + "type": "array" + }, "ObjectBlock": { "additionalProperties": false, "description": "Return the object where the value of each field is defined by a block. If the body of the object is an array, the resulting object is the union of the objects computed by each element of the array.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -5370,39 +3694,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -5429,97 +3731,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -5578,16 +3820,8 @@ "description": "Match an object.", "properties": { "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Def" + "$ref": "#/$defs/OptionalStr", + "default": null }, "object": { "additionalProperties": { @@ -5621,6 +3855,57 @@ "title": "ObjectPdlType", "type": "object" }, + "OptionalAny": { + "anyOf": [ + {}, + { + "type": "null" + } + ] + }, + "OptionalBoolOrStr": { + "anyOf": [ + { + "type": "boolean" + }, + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "OptionalInt": { + "anyOf": [ + { + "type": "integer" + }, + { + "type": "null" + } + ] + }, + "OptionalModelInput": { + "anyOf": [ + { + "$ref": "#/$defs/ModelInput" + }, + { + "type": "null" + } + ] + }, + "OptionalPdlLocationType": { + "anyOf": [ + { + "$ref": "#/$defs/PdlLocationType" + }, + { + "type": "null" + } + ] + }, "OptionalPdlType": { "additionalProperties": false, "description": "Optional type.", @@ -5635,21 +3920,23 @@ "title": "OptionalPdlType", "type": "object" }, + "OptionalStr": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, "OrPattern": { "additionalProperties": false, "description": "Match any of the patterns.", "properties": { "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Def" + "$ref": "#/$defs/OptionalStr", + "default": null }, "anyOf": { "items": { @@ -5754,16 +4041,8 @@ "description": "Use a PDL program as a parser specification (experimental).", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" + "$ref": "#/$defs/OptionalStr", + "default": null }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -5784,52 +4063,20 @@ "description": "Internal data structure to record timing information in the trace.", "properties": { "start_nanos": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": 0, - "title": "Start Nanos" + "$ref": "#/$defs/OptionalInt", + "default": 0 }, "end_nanos": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": 0, - "title": "End Nanos" + "$ref": "#/$defs/OptionalInt", + "default": 0 }, "first_use_nanos": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": 0, - "title": "First Use Nanos" + "$ref": "#/$defs/OptionalInt", + "default": 0 }, "timezone": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": "", - "title": "Timezone" + "$ref": "#/$defs/OptionalStr", + "default": "" } }, "title": "PdlTiming", @@ -5888,28 +4135,12 @@ "description": "Internal data structure to record token consumption usage information.", "properties": { "completion_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": 0, - "title": "Completion Tokens" + "$ref": "#/$defs/OptionalInt", + "default": 0 }, "prompt_tokens": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], - "default": 0, - "title": "Prompt Tokens" + "$ref": "#/$defs/OptionalInt", + "default": 0 } }, "title": "PdlUsage", @@ -5925,17 +4156,9 @@ "description": "Read from a file or standard input.\n\nExample. Read from the standard input with a prompt starting with `> `.\n```PDL\nread:\nmessage: \"> \"\n```\n\nExample. Read the file `./data.yaml` in the same directory of the PDL file containing the block and parse it into YAML.\n```PDL\nread: ./data.yaml\nparser: yaml\n```", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -5952,39 +4175,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ - "result", - "context" - ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "result", + "context" + ], + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -6011,97 +4212,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -6143,17 +4284,9 @@ "title": "Read" }, "message": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Message to prompt the user to enter a value.\n ", - "title": "Message" + "description": "Message to prompt the user to enter a value.\n " }, "multiline": { "default": false, @@ -6173,16 +4306,8 @@ "description": "A regular expression parser.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Description" + "$ref": "#/$defs/OptionalStr", + "default": null }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -6216,17 +4341,9 @@ "description": "Repeat the execution of a block sequentially.\nThe scope and `pdl_context` are accumulated in between iterations.\n\nFor loop example:\n```PDL\nfor:\n number: [1, 2, 3, 4]\n name: [\"Bob\", \"Carol\", \"David\", \"Ernest\"]\nrepeat:\n \"${ name }'s number is ${ number }\\n\"\n```\n\nWhile loop:\n```PDL\ndefs:\n i: 0\nwhile: ${i < 5}\nrepeat:\n defs:\n i: ${ i + 1}\n data: ${ i }\njoin:\n as: array\n```", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -6243,39 +4360,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -6302,97 +4397,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { @@ -6450,17 +4485,9 @@ "title": "For" }, "index": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable containing the loop iteration.\n ", - "title": "Index" + "description": "Name of the variable containing the loop iteration.\n " }, "while": { "anyOf": [ @@ -6552,17 +4579,9 @@ "description": "Create the concatenation of the stringify version of the result of each block of the list of blocks.", "properties": { "description": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Documentation associated to the block.\n ", - "title": "Description" + "description": "Documentation associated to the block.\n " }, "spec": { "$ref": "#/$defs/PdlTypeType", @@ -6579,39 +4598,17 @@ "type": "object" }, "def": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Name of the variable used to store the result of the execution of the block.\n ", - "title": "Def" + "description": "Name of the variable used to store the result of the execution of the block.\n " }, "contribute": { + "$ref": "#/$defs/ContributeType", "default": [ "result", "context" ], - "description": "Indicate if the block contributes to the result and background context.\n ", - "items": { - "anyOf": [ - { - "$ref": "#/$defs/ContributeTarget" - }, - { - "additionalProperties": { - "$ref": "#/$defs/ContributeValue" - }, - "type": "object" - } - ] - }, - "title": "Contribute", - "type": "array" + "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { "anyOf": [ @@ -6638,97 +4635,37 @@ "description": "Block to execute in case of error.\n " }, "retry": { - "anyOf": [ - { - "type": "integer" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalInt", "default": null, - "description": "The maximum number of times to retry when an error occurs within a block.\n ", - "title": "Retry" + "description": "The maximum number of times to retry when an error occurs within a block.\n " }, "trace_error_on_retry": { - "anyOf": [ - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBoolOrStr", "default": null, - "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n ", - "title": "Trace Error On Retry" + "description": "Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials.\n " }, "role": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": null, - "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`.", - "title": "Role" + "description": "Role associated to the block and sub-blocks.\nTypical roles are `system`, `user`, and `assistant`,\nbut there may be other roles such as `available_tools`." }, "pdl__context": { - "anyOf": [ - { - "items": { - "additionalProperties": true, - "type": "object" - }, - "type": "array" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n ", - "title": "Pdl Context" + "description": "Current context\n " }, "pdl__id": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n ", - "title": "Pdl Id" + "description": "Unique identifier for this block\n " }, "pdl__result": { - "anyOf": [ - {}, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block", - "title": "Pdl Result" + "description": "Result of the execution of the block" }, "pdl__location": { - "anyOf": [ - { - "$ref": "#/$defs/PdlLocationType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { diff --git a/src/pdl/pdl_ast.py b/src/pdl/pdl_ast.py index 8a69be90d..0e7e3a3f2 100644 --- a/src/pdl/pdl_ast.py +++ b/src/pdl/pdl_ast.py @@ -37,13 +37,17 @@ def _ensure_lower(value): return value -ScopeType: TypeAlias = PdlDict[str, Any] +OptionalStr = TypeAliasType("OptionalStr", Optional[str]) +OptionalInt = TypeAliasType("OptionalInt", Optional[int]) +OptionalBoolOrStr = TypeAliasType("OptionalBoolOrStr", Optional[Union[bool, str]]) +OptionalAny = TypeAliasType("OptionalAny", Optional[Any]) -ModelInput: TypeAlias = Sequence[Mapping[str, Any]] +ScopeType = TypeAliasType("ScopeType", PdlDict[str, Any]) - -LazyMessage: TypeAlias = PdlLazy[dict[str, Any]] +ModelInput = TypeAliasType("ModelInput", Sequence[Mapping[str, Any]]) +OptionalModelInput = TypeAliasType("OptionalModelInput", Optional[ModelInput]) +LazyMessage = TypeAliasType("LazyMessage", PdlLazy[dict[str, Any]]) LazyMessages: TypeAlias = PDLContext @@ -79,6 +83,11 @@ class PdlLocationType(BaseModel): table: dict[str, int] +OptionalPdlLocationType = TypeAliasType( + "OptionalPdlLocationType", Optional[PdlLocationType] +) + + empty_block_location = PdlLocationType(file="", path=[], table={}) @@ -96,7 +105,7 @@ class LocalizedExpression(BaseModel, Generic[LocalizedExpressionT]): ) pdl__expr: Any pdl__result: Optional[LocalizedExpressionT] = None - pdl__location: Optional[PdlLocationType] = None + pdl__location: OptionalPdlLocationType = None ExpressionTypeT = TypeVar("ExpressionTypeT") @@ -108,7 +117,7 @@ class Pattern(BaseModel): """Common fields for structured patterns.""" model_config = ConfigDict(extra="forbid") - def_: Optional[str] = Field(default=None, alias="def") + def_: OptionalStr = Field(default=None, alias="def") """Name of the variable used to store the value matched by the pattern. """ @@ -229,7 +238,7 @@ class Parser(BaseModel): """Common fields for all parsers (`parser` field).""" model_config = ConfigDict(extra="forbid") - description: Optional[str] = None + description: OptionalStr = None """Documentation associated to the parser. """ spec: PdlTypeType = None @@ -260,7 +269,7 @@ class RegexParser(Parser): "ParserType", Union[Literal["json", "jsonl", "yaml"], PdlParser, RegexParser] ) -RoleType: TypeAlias = Optional[str] +RoleType: TypeAlias = OptionalStr """Role name.""" @@ -280,20 +289,25 @@ class ContributeValue(BaseModel): """Value to contribute.""" +ContributeType = TypeAliasType( + "ContributeType", Sequence[Union[ContributeTarget, dict[str, ContributeValue]]] +) + + class PdlTiming(BaseModel): """Internal data structure to record timing information in the trace.""" model_config = ConfigDict(extra="forbid") - start_nanos: Optional[int] = 0 + start_nanos: OptionalInt = 0 """Time at which block execution began. """ - end_nanos: Optional[int] = 0 + end_nanos: OptionalInt = 0 """Time at which block execution ended. """ - first_use_nanos: Optional[int] = 0 + first_use_nanos: OptionalInt = 0 """Time at which the value of the block was needed for the first time. """ - timezone: Optional[str] = "" + timezone: OptionalStr = "" """Timezone of start_nanos and end_nanos. """ @@ -301,10 +315,10 @@ class PdlTiming(BaseModel): class PdlUsage(BaseModel): """Internal data structure to record token consumption usage information.""" - completion_tokens: Optional[int] = 0 + completion_tokens: OptionalInt = 0 """Completion tokens consumed """ - prompt_tokens: Optional[int] = 0 + prompt_tokens: OptionalInt = 0 """Prompt tokens consumed """ @@ -319,7 +333,7 @@ class Block(BaseModel): validate_by_name=True, ) - description: Optional[str] = None + description: OptionalStr = None """Documentation associated to the block. """ spec: PdlTypeType = None @@ -328,10 +342,10 @@ class Block(BaseModel): defs: dict[str, "BlockType"] = {} """Set of definitions executed before the execution of the block. """ - def_: Optional[str] = Field(default=None, alias="def") + def_: OptionalStr = Field(default=None, alias="def") """Name of the variable used to store the result of the execution of the block. """ - contribute: Sequence[ContributeTarget | dict[str, ContributeValue]] = [ + contribute: ContributeType = [ ContributeTarget.RESULT, ContributeTarget.CONTEXT, ] @@ -342,10 +356,10 @@ class Block(BaseModel): fallback: Optional["BlockType"] = None """Block to execute in case of error. """ - retry: Optional[int] = None + retry: OptionalInt = None """The maximum number of times to retry when an error occurs within a block. """ - trace_error_on_retry: Optional[bool] | str = None + trace_error_on_retry: OptionalBoolOrStr = None """Whether to add the errors while retrying to the trace. Set this to true to use retry feature for multiple LLM trials. """ role: RoleType = None @@ -354,15 +368,15 @@ class Block(BaseModel): but there may be other roles such as `available_tools`. """ # Fields for internal use - pdl__context: Optional[ModelInput] = [] + pdl__context: OptionalModelInput = [] """Current context """ - pdl__id: Optional[str] = "" + pdl__id: OptionalStr = "" """Unique identifier for this block """ - pdl__result: Optional[Any] = None + pdl__result: OptionalAny = None """Result of the execution of the block""" - pdl__location: Optional[PdlLocationType] = None + pdl__location: OptionalPdlLocationType = None pdl__timing: Optional[PdlTiming] = None @@ -514,14 +528,14 @@ class ModelBlock(LeafBlock): input: "BlockType" = "${ pdl_context }" """Messages to send to the model. """ - modelResponse: Optional[str] = None + modelResponse: OptionalStr = None """Variable where to store the raw response of the model. """ # Field for internal use pdl__usage: Optional[PdlUsage] = None """Tokens consumed during model call """ - pdl__model_input: Optional[ModelInput] = None + pdl__model_input: OptionalModelInput = None class LitellmModelBlock(ModelBlock): @@ -877,7 +891,7 @@ class RepeatBlock(StructuredBlock): for_: Optional[dict[str, ExpressionType[list]]] = Field(default=None, alias="for") """Arrays to iterate over. """ - index: Optional[str] = None + index: OptionalStr = None """Name of the variable containing the loop iteration. """ while_: ExpressionType[bool] = Field(default=True, alias="while") @@ -929,7 +943,7 @@ class MapBlock(StructuredBlock): for_: Optional[dict[str, ExpressionType[list]]] = Field(default=None, alias="for") """Arrays to iterate over. """ - index: Optional[str] = None + index: OptionalStr = None """Name of the variable containing the loop iteration. """ map: "BlockType" @@ -965,7 +979,7 @@ class ReadBlock(LeafBlock): read: ExpressionType[str] | None """Name of the file to read. If `None`, read the standard input. """ - message: Optional[str] = None + message: OptionalStr = None """Message to prompt the user to enter a value. """ multiline: bool = False @@ -1076,7 +1090,7 @@ def __init__( message: str, loc: Optional[PdlLocationType] = None, trace: Optional[BlockType] = None, - fallback: Optional[Any] = None, + fallback: OptionalAny = None, ): super().__init__(message) self.loc = loc @@ -1099,7 +1113,7 @@ def __init__( message: str, blocks: list[BlockType], loc: Optional[PdlLocationType] = None, - fallback: Optional[Any] = None, + fallback: OptionalAny = None, ): super().__init__(message) self.loc = loc From 437a94701ccf5eef580e7f3d235cc71238036ddb Mon Sep 17 00:00:00 2001 From: Louis Mandel Date: Tue, 29 Jul 2025 17:12:33 -0400 Subject: [PATCH 06/10] Fix UI Signed-off-by: Louis Mandel --- pdl-live-react/src/helpers.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pdl-live-react/src/helpers.ts b/pdl-live-react/src/helpers.ts index 10edab5df..b63cfa1ef 100644 --- a/pdl-live-react/src/helpers.ts +++ b/pdl-live-react/src/helpers.ts @@ -6,7 +6,7 @@ import type { TextBlock, ArgsBlock, CodeBlock, - PdlModelInput, + ModelInput, LocalizedExpression, } from "./pdl_ast" import { match, P } from "ts-pattern" @@ -232,10 +232,10 @@ export function hasMessage(block: PdlBlock): block is MessageBearing { export function hasInput(block: PdlBlock): block is | (Omit & { - pdl__model_input: NonNullable + pdl__model_input: NonNullable }) | (Omit & { - pdl__model_input: NonNullable + pdl__model_input: NonNullable }) { const mb = block as ModelBlock return Array.isArray(mb.pdl__model_input) && mb.pdl__model_input.length > 0 From ca6ab65a0956c7c3d3cf6a276b581c45039b5f9c Mon Sep 17 00:00:00 2001 From: Louis Mandel Date: Tue, 29 Jul 2025 17:16:51 -0400 Subject: [PATCH 07/10] More type aliases Signed-off-by: Louis Mandel --- pdl-live-react/src/pdl_ast.d.ts | 198 ++++---- src/pdl/pdl-schema.json | 870 ++++++++------------------------ src/pdl/pdl_ast.py | 28 +- 3 files changed, 342 insertions(+), 754 deletions(-) diff --git a/pdl-live-react/src/pdl_ast.d.ts b/pdl-live-react/src/pdl_ast.d.ts index aba9b14b4..d74405eba 100644 --- a/pdl-live-react/src/pdl_ast.d.ts +++ b/pdl-live-react/src/pdl_ast.d.ts @@ -739,17 +739,18 @@ export interface FunctionBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf21 kind?: Kind21 @@ -895,17 +896,18 @@ export interface CallBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf kind?: Kind @@ -1097,17 +1099,18 @@ export interface LitellmModelBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf1 kind?: Kind1 @@ -1235,17 +1238,18 @@ export interface GraniteioModelBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf2 kind?: Kind2 @@ -1382,17 +1386,18 @@ export interface CodeBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf3 kind?: Kind3 @@ -1515,17 +1520,18 @@ export interface ArgsBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf4 kind?: Kind4 @@ -1612,17 +1618,18 @@ export interface GetBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf5 kind?: Kind5 @@ -1727,17 +1734,18 @@ export interface DataBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf6 kind?: Kind6 @@ -1832,17 +1840,18 @@ export interface IfBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf7 context?: IndependentEnum @@ -1980,17 +1989,18 @@ export interface MatchBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf8 context?: IndependentEnum1 @@ -2141,17 +2151,18 @@ export interface RepeatBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf9 context?: IndependentEnum2 @@ -2302,17 +2313,18 @@ export interface MapBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf10 context?: IndependentEnum3 @@ -2440,17 +2452,18 @@ export interface TextBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf11 context?: IndependentEnum4 @@ -2535,17 +2548,18 @@ export interface LastOfBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf12 context?: IndependentEnum5 @@ -2630,17 +2644,18 @@ export interface ArrayBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf13 context?: IndependentEnum6 @@ -2725,17 +2740,18 @@ export interface ObjectBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf14 context?: IndependentEnum7 @@ -2820,17 +2836,18 @@ export interface MessageBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf15 kind?: Kind15 @@ -2957,17 +2974,18 @@ export interface ReadBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf16 kind?: Kind16 @@ -3057,17 +3075,18 @@ export interface IncludeBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf17 context?: IndependentEnum8 @@ -3153,17 +3172,18 @@ export interface ImportBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf18 kind?: Kind18 @@ -3248,17 +3268,18 @@ export interface ErrorBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf19 kind?: Kind19 @@ -3373,17 +3394,18 @@ export interface EmptyBlock { */ role?: string | null /** - * Current context - * + * Current context. */ pdl__context?: ModelInput | null /** - * Unique identifier for this block - * + * Unique identifier for this block. */ pdl__id?: string | null pdl__result?: unknown pdl__location?: PdlLocationType | null + /** + * Execution timing information. + */ pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf20 kind?: Kind20 diff --git a/src/pdl/pdl-schema.json b/src/pdl/pdl-schema.json index b26826fd4..a611d83d0 100644 --- a/src/pdl/pdl-schema.json +++ b/src/pdl/pdl-schema.json @@ -57,26 +57,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -98,32 +84,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": true, @@ -202,26 +182,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -243,32 +209,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": false, @@ -445,26 +405,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -486,32 +432,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": true, @@ -555,14 +495,7 @@ "title": "Args" }, "pdl__trace": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null } }, @@ -609,26 +542,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -650,32 +569,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": true, @@ -801,26 +714,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -842,32 +741,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": true, @@ -944,26 +837,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -985,32 +864,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": true, @@ -1081,26 +954,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -1122,32 +981,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": true, @@ -1215,26 +1068,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -1256,32 +1095,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": true, @@ -1374,26 +1207,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -1415,32 +1234,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": true, @@ -1503,26 +1316,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -1544,32 +1343,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": true, @@ -1751,26 +1544,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -1792,32 +1571,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": false, @@ -1855,14 +1628,7 @@ "description": "Branch to execute if the condition is true.\n " }, "else": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Branch to execute if the condition is false.\n " } @@ -1911,26 +1677,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -1952,32 +1704,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": true, @@ -1997,14 +1743,7 @@ "type": "string" }, "pdl__trace": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null } }, @@ -2051,26 +1790,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -2092,33 +1817,27 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", - "default": null, - "description": "Result of the execution of the block" - }, - "pdl__location": { - "$ref": "#/$defs/OptionalPdlLocationType", - "default": null - }, - "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], + "default": null, + "description": "Result of the execution of the block." + }, + "pdl__location": { + "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, + "pdl__timing": { + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." + }, "pdl__is_leaf": { "const": false, "default": false, @@ -2141,14 +1860,7 @@ "type": "string" }, "pdl__trace": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null } }, @@ -2348,26 +2060,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -2389,32 +2087,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": false, @@ -2484,26 +2176,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -2525,32 +2203,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": true, @@ -3105,26 +2777,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -3146,32 +2804,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": false, @@ -3311,26 +2963,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -3352,32 +2990,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": false, @@ -3540,26 +3172,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -3581,32 +3199,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": true, @@ -3707,26 +3319,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -3748,32 +3346,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": false, @@ -3863,6 +3455,16 @@ } ] }, + "OptionalBlockType": { + "anyOf": [ + { + "$ref": "#/$defs/BlockType" + }, + { + "type": "null" + } + ] + }, "OptionalBoolOrStr": { "anyOf": [ { @@ -3896,6 +3498,16 @@ } ] }, + "OptionalParserType": { + "anyOf": [ + { + "$ref": "#/$defs/ParserType" + }, + { + "type": "null" + } + ] + }, "OptionalPdlLocationType": { "anyOf": [ { @@ -3906,6 +3518,16 @@ } ] }, + "OptionalPdlTiming": { + "anyOf": [ + { + "$ref": "#/$defs/PdlTiming" + }, + { + "type": "null" + } + ] + }, "OptionalPdlType": { "additionalProperties": false, "description": "Optional type.", @@ -4188,26 +3810,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -4229,32 +3837,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": true, @@ -4373,26 +3975,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -4414,32 +4002,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": false, @@ -4611,26 +4193,12 @@ "description": "Indicate if the block contributes to the result and background context.\n " }, "parser": { - "anyOf": [ - { - "$ref": "#/$defs/ParserType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalParserType", "default": null, "description": "Parser to use to construct a value out of a string result." }, "fallback": { - "anyOf": [ - { - "$ref": "#/$defs/BlockType" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalBlockType", "default": null, "description": "Block to execute in case of error.\n " }, @@ -4652,32 +4220,26 @@ "pdl__context": { "$ref": "#/$defs/OptionalModelInput", "default": [], - "description": "Current context\n " + "description": "Current context." }, "pdl__id": { "$ref": "#/$defs/OptionalStr", "default": "", - "description": "Unique identifier for this block\n " + "description": "Unique identifier for this block." }, "pdl__result": { "$ref": "#/$defs/OptionalAny", "default": null, - "description": "Result of the execution of the block" + "description": "Result of the execution of the block." }, "pdl__location": { "$ref": "#/$defs/OptionalPdlLocationType", "default": null }, "pdl__timing": { - "anyOf": [ - { - "$ref": "#/$defs/PdlTiming" - }, - { - "type": "null" - } - ], - "default": null + "$ref": "#/$defs/OptionalPdlTiming", + "default": null, + "description": "Execution timing information." }, "pdl__is_leaf": { "const": false, diff --git a/src/pdl/pdl_ast.py b/src/pdl/pdl_ast.py index 0e7e3a3f2..5138ed028 100644 --- a/src/pdl/pdl_ast.py +++ b/src/pdl/pdl_ast.py @@ -268,6 +268,8 @@ class RegexParser(Parser): ParserType = TypeAliasType( "ParserType", Union[Literal["json", "jsonl", "yaml"], PdlParser, RegexParser] ) +OptionalParserType = TypeAliasType("OptionalParserType", Optional[ParserType]) + RoleType: TypeAlias = OptionalStr """Role name.""" @@ -311,6 +313,8 @@ class PdlTiming(BaseModel): """Timezone of start_nanos and end_nanos. """ +OptionalPdlTiming = TypeAliasType("OptionalPdlTiming", Optional[PdlTiming]) + class PdlUsage(BaseModel): """Internal data structure to record token consumption usage information.""" @@ -351,9 +355,9 @@ class Block(BaseModel): ] """Indicate if the block contributes to the result and background context. """ - parser: Annotated[Optional[ParserType], BeforeValidator(_ensure_lower)] = None + parser: Annotated[OptionalParserType, BeforeValidator(_ensure_lower)] = None """Parser to use to construct a value out of a string result.""" - fallback: Optional["BlockType"] = None + fallback: "OptionalBlockType" = None """Block to execute in case of error. """ retry: OptionalInt = None @@ -369,15 +373,14 @@ class Block(BaseModel): """ # Fields for internal use pdl__context: OptionalModelInput = [] - """Current context - """ + """Current context.""" pdl__id: OptionalStr = "" - """Unique identifier for this block - """ + """Unique identifier for this block.""" pdl__result: OptionalAny = None - """Result of the execution of the block""" + """Result of the execution of the block.""" pdl__location: OptionalPdlLocationType = None - pdl__timing: Optional[PdlTiming] = None + pdl__timing: OptionalPdlTiming = None + """Execution timing information.""" class LeafBlock(Block): @@ -422,7 +425,7 @@ class CallBlock(LeafBlock): """Arguments of the function with their values. """ # Field for internal use - pdl__trace: Optional["BlockType"] = None + pdl__trace: "OptionalBlockType" = None class LitellmParameters(BaseModel): @@ -746,7 +749,7 @@ class IfBlock(StructuredBlock): then: "BlockType" """Branch to execute if the condition is true. """ - else_: Optional["BlockType"] = Field(default=None, alias="else") + else_: "OptionalBlockType" = Field(default=None, alias="else") """Branch to execute if the condition is false. """ @@ -995,7 +998,7 @@ class IncludeBlock(StructuredBlock): """Name of the file to include. """ # Field for internal use - pdl__trace: Optional["BlockType"] = None + pdl__trace: "OptionalBlockType" = None class ImportBlock(LeafBlock): @@ -1006,7 +1009,7 @@ class ImportBlock(LeafBlock): """Name of the file to import. """ # Field for internal use - pdl__trace: Optional["BlockType"] = None + pdl__trace: "OptionalBlockType" = None class ErrorBlock(LeafBlock): @@ -1061,6 +1064,7 @@ class EmptyBlock(LeafBlock): BlockOrBlocksType: TypeAlias = BlockType | list[BlockType] # pyright: ignore """Block or list of blocks. """ +OptionalBlockType = TypeAliasType("OptionalBlockType", Optional[BlockType]) class Program(RootModel): From 9e10bb3376e2534c80063410475e3210ce0a01d5 Mon Sep 17 00:00:00 2001 From: Louis Mandel Date: Tue, 29 Jul 2025 21:01:12 -0400 Subject: [PATCH 08/10] Formatting Signed-off-by: Louis Mandel --- src/pdl/pdl_ast.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pdl/pdl_ast.py b/src/pdl/pdl_ast.py index 5138ed028..654da3b12 100644 --- a/src/pdl/pdl_ast.py +++ b/src/pdl/pdl_ast.py @@ -313,6 +313,7 @@ class PdlTiming(BaseModel): """Timezone of start_nanos and end_nanos. """ + OptionalPdlTiming = TypeAliasType("OptionalPdlTiming", Optional[PdlTiming]) From 62b91d15a97896603af24f40160735306cbcfc6f Mon Sep 17 00:00:00 2001 From: Louis Mandel Date: Tue, 29 Jul 2025 22:03:08 -0400 Subject: [PATCH 09/10] Fix recursive types issue and more type aliases Signed-off-by: Louis Mandel --- pdl-live-react/src/pdl_ast.d.ts | 103 ++++++------ src/pdl/pdl-schema.json | 289 ++++++++++++-------------------- src/pdl/pdl_ast.py | 66 +++++--- src/pdl/pdl_interpreter.py | 3 + 4 files changed, 200 insertions(+), 261 deletions(-) diff --git a/pdl-live-react/src/pdl_ast.d.ts b/pdl-live-react/src/pdl_ast.d.ts index d74405eba..8c203db9b 100644 --- a/pdl-live-react/src/pdl_ast.d.ts +++ b/pdl-live-react/src/pdl_ast.d.ts @@ -174,11 +174,12 @@ export type ContributeType4 = ( export type PdlIsLeaf4 = true export type Kind4 = "code" export type Lang1 = "command" +export type ExpressionStr = LocalizedExpression | string /** * The argument vector to spawn. * */ -export type Args1 = (LocalizedExpression | string)[] +export type Args1 = ExpressionStr[] /** * Indicate if the block contributes to the result and background context. * @@ -224,11 +225,6 @@ export type ContributeType7 = ( export type PdlIsLeaf7 = false export type IndependentEnum = "independent" | "dependent" export type Kind7 = "if" -/** - * Condition. - * - */ -export type If = LocalizedExpression | boolean | string /** * Indicate if the block contributes to the result and background context. * @@ -254,7 +250,7 @@ export type PatternType = export type Anyof = PatternType[] export type Array = PatternType[] export type Any = null -export type If1 = LocalizedExpression | boolean | string | null +export type ExpressionBool = LocalizedExpression | boolean | string export type PdlCaseResult = boolean | null export type PdlIfResult = boolean | null export type PdlMatched = boolean | null @@ -283,11 +279,6 @@ export type Kind9 = "repeat" export type For = { [k: string]: LocalizedExpression | unknown[] | string } | null -/** - * Condition to stay at the beginning of the loop. - * - */ -export type While = LocalizedExpression | boolean | string /** * Indicate if the block contributes to the result and background context. * @@ -402,11 +393,6 @@ export type ContributeType16 = ( )[] export type PdlIsLeaf16 = true export type Kind16 = "read" -/** - * Name of the file to read. If `None`, read the standard input. - * - */ -export type Read = LocalizedExpression | string | null /** * Indicate if one or multiple lines should be read. * @@ -476,19 +462,7 @@ export type ContributeType20 = ( )[] export type PdlIsLeaf20 = true export type Kind20 = "empty" -/** - * For example, the name of the tool that was invoked, for which this message is the tool response. - */ -export type Name = LocalizedExpression | string | null -/** - * The id of the tool invocation for which this message is the tool response. - */ -export type ToolCallId = LocalizedExpression | string | null -/** - * Maximal number of iterations to perform. - * - */ -export type Maxiterations = LocalizedExpression | number | string | null +export type ExpressionInt = LocalizedExpression | number | string /** * String concatenation of the result of each iteration. * @@ -520,16 +494,6 @@ export type As4 = "reduce" */ export type Reduce = LocalizedExpression | string export type PdlTrace = BlockType[] | null -/** - * Condition to exit at the end of the loop. - * - */ -export type Until = LocalizedExpression | boolean | string -/** - * Maximal number of iterations to perform. - * - */ -export type Maxiterations1 = LocalizedExpression | number | string | null export type PdlTrace1 = BlockType[] | null /** * Optional field to ensure that the block is using granite-io. @@ -552,11 +516,6 @@ export type Parameters = * */ export type Platform1 = "litellm" -/** - * Name of the model following the LiteLLM convention. - * - */ -export type Model1 = LocalizedExpression | string /** * Parameters to send to the model. * @@ -1157,7 +1116,11 @@ export interface LitellmModelBlock { pdl__usage?: PdlUsage | null pdl__model_input?: ModelInput | null platform?: Platform1 - model: Model1 + /** + * Name of the model following the LiteLLM convention. + * + */ + model: LocalizedExpression | string parameters?: Parameters1 } /** @@ -1856,7 +1819,11 @@ export interface IfBlock { pdl__is_leaf?: PdlIsLeaf7 context?: IndependentEnum kind?: Kind7 - if: If + /** + * Condition. + * + */ + if: LocalizedExpression | boolean | string /** * Branch to execute if the condition is true. * @@ -2020,7 +1987,7 @@ export interface Defs9 { */ export interface MatchCase { case?: PatternType | null - if?: If1 + if?: ExpressionBool | null then: BlockType pdl__case_result?: PdlCaseResult pdl__if_result?: PdlIfResult @@ -2173,7 +2140,11 @@ export interface RepeatBlock { * */ index?: string | null - while?: While + /** + * Condition to stay at the beginning of the loop. + * + */ + while?: LocalizedExpression | boolean | string /** * Body of the loop. * @@ -2205,8 +2176,16 @@ export interface RepeatBlock { | ErrorBlock | EmptyBlock | null - until?: Until - maxIterations?: Maxiterations1 + /** + * Condition to exit at the end of the loop. + * + */ + until?: LocalizedExpression | boolean | string + /** + * Maximal number of iterations to perform. + * + */ + maxIterations?: ExpressionInt | null /** * Define how to combine the result of each iteration. * @@ -2366,7 +2345,11 @@ export interface MapBlock { | ErrorBlock | EmptyBlock | null - maxIterations?: Maxiterations + /** + * Maximal number of iterations to perform. + * + */ + maxIterations?: ExpressionInt | null /** * Define how to combine the result of each iteration. * @@ -2881,8 +2864,14 @@ export interface MessageBlock { | ErrorBlock | EmptyBlock | null - name?: Name - tool_call_id?: ToolCallId + /** + * For example, the name of the tool that was invoked, for which this message is the tool response. + */ + name?: ExpressionStr | null + /** + * The id of the tool invocation for which this message is the tool response. + */ + tool_call_id?: ExpressionStr | null } /** * Set of definitions executed before the execution of the block. @@ -2989,7 +2978,11 @@ export interface ReadBlock { pdl__timing?: PdlTiming | null pdl__is_leaf?: PdlIsLeaf16 kind?: Kind16 - read: Read + /** + * Name of the file to read. If `None`, read the standard input. + * + */ + read: ExpressionStr | null /** * Message to prompt the user to enter a value. * diff --git a/src/pdl/pdl-schema.json b/src/pdl/pdl-schema.json index a611d83d0..230ad79bd 100644 --- a/src/pdl/pdl-schema.json +++ b/src/pdl/pdl-schema.json @@ -126,14 +126,7 @@ "args": { "description": "The argument vector to spawn.\n ", "items": { - "anyOf": [ - { - "$ref": "#/$defs/LocalizedExpression_TypeVar_" - }, - { - "type": "string" - } - ] + "$ref": "#/$defs/ExpressionStr" }, "title": "Args", "type": "array" @@ -1031,6 +1024,42 @@ "title": "ErrorBlock", "type": "object" }, + "ExpressionBool": { + "anyOf": [ + { + "$ref": "#/$defs/LocalizedExpression_TypeVar_" + }, + { + "type": "boolean" + }, + { + "type": "string" + } + ] + }, + "ExpressionInt": { + "anyOf": [ + { + "$ref": "#/$defs/LocalizedExpression_TypeVar_" + }, + { + "type": "integer" + }, + { + "type": "string" + } + ] + }, + "ExpressionStr": { + "anyOf": [ + { + "$ref": "#/$defs/LocalizedExpression_TypeVar_" + }, + { + "type": "string" + } + ] + }, "FunctionBlock": { "additionalProperties": false, "description": "Function declaration.", @@ -1387,14 +1416,7 @@ "description": "Variable where to store the raw response of the model.\n " }, "pdl__usage": { - "anyOf": [ - { - "$ref": "#/$defs/PdlUsage" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlUsage", "default": null, "description": "Tokens consumed during model call\n " }, @@ -1455,34 +1477,12 @@ "GraniteioProcessor": { "properties": { "type": { - "anyOf": [ - { - "$ref": "#/$defs/LocalizedExpression_TypeVar_" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Type" + "$ref": "#/$defs/OptionalExpressionStr", + "default": null }, "model": { - "anyOf": [ - { - "$ref": "#/$defs/LocalizedExpression_TypeVar_" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "Model" + "$ref": "#/$defs/OptionalExpressionStr", + "default": null }, "backend": { "anyOf": [ @@ -1609,19 +1609,8 @@ "type": "string" }, "if": { - "anyOf": [ - { - "$ref": "#/$defs/LocalizedExpression_TypeVar_" - }, - { - "type": "boolean" - }, - { - "type": "string" - } - ], - "description": "Condition.\n ", - "title": "If" + "$ref": "#/$defs/ExpressionBool", + "description": "Condition.\n " }, "then": { "$ref": "#/$defs/BlockType", @@ -2247,14 +2236,7 @@ "description": "Variable where to store the raw response of the model.\n " }, "pdl__usage": { - "anyOf": [ - { - "$ref": "#/$defs/PdlUsage" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalPdlUsage", "default": null, "description": "Tokens consumed during model call\n " }, @@ -2270,16 +2252,8 @@ "type": "string" }, "model": { - "anyOf": [ - { - "$ref": "#/$defs/LocalizedExpression_TypeVar_" - }, - { - "type": "string" - } - ], - "description": "Name of the model following the LiteLLM convention.\n ", - "title": "Model" + "$ref": "#/$defs/ExpressionStr", + "description": "Name of the model following the LiteLLM convention.\n " }, "parameters": { "anyOf": [ @@ -2878,23 +2852,9 @@ "description": "Body of the iterator.\n " }, "maxIterations": { - "anyOf": [ - { - "$ref": "#/$defs/LocalizedExpression_TypeVar_" - }, - { - "type": "integer" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalExpressionInt", "default": null, - "description": "Maximal number of iterations to perform.\n ", - "title": "Maxiterations" + "description": "Maximal number of iterations to perform.\n " }, "join": { "$ref": "#/$defs/JoinType", @@ -3072,22 +3032,8 @@ "default": null }, "if": { - "anyOf": [ - { - "$ref": "#/$defs/LocalizedExpression_TypeVar_" - }, - { - "type": "boolean" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], - "default": null, - "title": "If" + "$ref": "#/$defs/OptionalExpressionBool", + "default": null }, "then": { "$ref": "#/$defs/BlockType" @@ -3237,36 +3183,14 @@ "description": "Content of the message." }, "name": { - "anyOf": [ - { - "$ref": "#/$defs/LocalizedExpression_TypeVar_" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalExpressionStr", "default": null, - "description": "For example, the name of the tool that was invoked, for which this message is the tool response.", - "title": "Name" + "description": "For example, the name of the tool that was invoked, for which this message is the tool response." }, "tool_call_id": { - "anyOf": [ - { - "$ref": "#/$defs/LocalizedExpression_TypeVar_" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalExpressionStr", "default": null, - "description": "The id of the tool invocation for which this message is the tool response.", - "title": "Tool Call Id" + "description": "The id of the tool invocation for which this message is the tool response." } }, "required": [ @@ -3478,6 +3402,36 @@ } ] }, + "OptionalExpressionBool": { + "anyOf": [ + { + "$ref": "#/$defs/ExpressionBool" + }, + { + "type": "null" + } + ] + }, + "OptionalExpressionInt": { + "anyOf": [ + { + "$ref": "#/$defs/ExpressionInt" + }, + { + "type": "null" + } + ] + }, + "OptionalExpressionStr": { + "anyOf": [ + { + "$ref": "#/$defs/ExpressionStr" + }, + { + "type": "null" + } + ] + }, "OptionalInt": { "anyOf": [ { @@ -3542,6 +3496,16 @@ "title": "OptionalPdlType", "type": "object" }, + "OptionalPdlUsage": { + "anyOf": [ + { + "$ref": "#/$defs/PdlUsage" + }, + { + "type": "null" + } + ] + }, "OptionalStr": { "anyOf": [ { @@ -3871,19 +3835,8 @@ "type": "string" }, "read": { - "anyOf": [ - { - "$ref": "#/$defs/LocalizedExpression_TypeVar_" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], - "description": "Name of the file to read. If `None`, read the standard input.\n ", - "title": "Read" + "$ref": "#/$defs/OptionalExpressionStr", + "description": "Name of the file to read. If `None`, read the standard input.\n " }, "message": { "$ref": "#/$defs/OptionalStr", @@ -4072,59 +4025,23 @@ "description": "Name of the variable containing the loop iteration.\n " }, "while": { - "anyOf": [ - { - "$ref": "#/$defs/LocalizedExpression_TypeVar_" - }, - { - "type": "boolean" - }, - { - "type": "string" - } - ], + "$ref": "#/$defs/ExpressionBool", "default": true, - "description": "Condition to stay at the beginning of the loop.\n ", - "title": "While" + "description": "Condition to stay at the beginning of the loop.\n " }, "repeat": { "$ref": "#/$defs/BlockType", "description": "Body of the loop.\n " }, "until": { - "anyOf": [ - { - "$ref": "#/$defs/LocalizedExpression_TypeVar_" - }, - { - "type": "boolean" - }, - { - "type": "string" - } - ], + "$ref": "#/$defs/ExpressionBool", "default": false, - "description": "Condition to exit at the end of the loop.\n ", - "title": "Until" + "description": "Condition to exit at the end of the loop.\n " }, "maxIterations": { - "anyOf": [ - { - "$ref": "#/$defs/LocalizedExpression_TypeVar_" - }, - { - "type": "integer" - }, - { - "type": "string" - }, - { - "type": "null" - } - ], + "$ref": "#/$defs/OptionalExpressionInt", "default": null, - "description": "Maximal number of iterations to perform.\n ", - "title": "Maxiterations" + "description": "Maximal number of iterations to perform.\n " }, "join": { "$ref": "#/$defs/JoinType", diff --git a/src/pdl/pdl_ast.py b/src/pdl/pdl_ast.py index 654da3b12..6a0fc6221 100644 --- a/src/pdl/pdl_ast.py +++ b/src/pdl/pdl_ast.py @@ -42,6 +42,10 @@ def _ensure_lower(value): OptionalBoolOrStr = TypeAliasType("OptionalBoolOrStr", Optional[Union[bool, str]]) OptionalAny = TypeAliasType("OptionalAny", Optional[Any]) +OptionalBlockType = TypeAliasType("OptionalBlockType", Optional["BlockType"]) +"""Optional block. +""" + ScopeType = TypeAliasType("ScopeType", PdlDict[str, Any]) @@ -112,6 +116,26 @@ class LocalizedExpression(BaseModel, Generic[LocalizedExpressionT]): ExpressionType: TypeAlias = LocalizedExpression[ExpressionTypeT] | ExpressionTypeT | str """Expressions are represented Jinja as strings in between `${` and `}`.""" +ExpressionStr = TypeAliasType("ExpressionStr", ExpressionType[str]) +"""Expression evaluating into a string.""" + +OptionalExpressionStr = TypeAliasType("OptionalExpressionStr", Optional[ExpressionStr]) +"""Optional expression evaluating into a string.""" + +ExpressionInt = TypeAliasType("ExpressionInt", ExpressionType[int]) +"""Expression evaluating into an int.""" + +OptionalExpressionInt = TypeAliasType("OptionalExpressionInt", Optional[ExpressionInt]) +"""Optional expression evaluating into an int.""" + +ExpressionBool = TypeAliasType("ExpressionBool", ExpressionType[bool]) +"""Expression evaluating into a bool.""" + +OptionalExpressionBool = TypeAliasType( + "OptionalExpressionBool", Optional[ExpressionBool] +) +"""Optional expression evaluating into a bool.""" + class Pattern(BaseModel): """Common fields for structured patterns.""" @@ -328,6 +352,9 @@ class PdlUsage(BaseModel): """ +OptionalPdlUsage = TypeAliasType("OptionalPdlUsage", Optional[PdlUsage]) + + class Block(BaseModel): """Common fields for all PDL blocks.""" @@ -358,7 +385,7 @@ class Block(BaseModel): """ parser: Annotated[OptionalParserType, BeforeValidator(_ensure_lower)] = None """Parser to use to construct a value out of a string result.""" - fallback: "OptionalBlockType" = None + fallback: OptionalBlockType = None """Block to execute in case of error. """ retry: OptionalInt = None @@ -426,7 +453,7 @@ class CallBlock(LeafBlock): """Arguments of the function with their values. """ # Field for internal use - pdl__trace: "OptionalBlockType" = None + pdl__trace: OptionalBlockType = None class LitellmParameters(BaseModel): @@ -536,7 +563,7 @@ class ModelBlock(LeafBlock): """Variable where to store the raw response of the model. """ # Field for internal use - pdl__usage: Optional[PdlUsage] = None + pdl__usage: OptionalPdlUsage = None """Tokens consumed during model call """ pdl__model_input: OptionalModelInput = None @@ -557,7 +584,7 @@ class LitellmModelBlock(ModelBlock): platform: Literal[ModelPlatform.LITELLM] = ModelPlatform.LITELLM """Optional field to ensure that the block is using LiteLLM. """ - model: ExpressionType[str] + model: ExpressionStr """Name of the model following the LiteLLM convention. """ parameters: Optional[LitellmParameters | ExpressionType[dict]] = None @@ -566,10 +593,10 @@ class LitellmModelBlock(ModelBlock): class GraniteioProcessor(BaseModel): - type: Optional[ExpressionType[str]] = None + type: OptionalExpressionStr = None """Type of IO processor. """ - model: Optional[ExpressionType[str]] = None + model: OptionalExpressionStr = None """Model name used by the backend. """ backend: ExpressionType[str | dict[str, Any] | object] @@ -634,7 +661,7 @@ class ArgsBlock(BaseCodeBlock): """ lang: Annotated[Literal["command"], BeforeValidator(_ensure_lower)] = "command" - args: list[ExpressionType[str]] + args: list[ExpressionStr] """The argument vector to spawn. """ @@ -722,9 +749,9 @@ class MessageBlock(LeafBlock): kind: Literal[BlockKind.MESSAGE] = BlockKind.MESSAGE content: "BlockType" """Content of the message.""" - name: Optional[ExpressionType[str]] = None + name: OptionalExpressionStr = None """For example, the name of the tool that was invoked, for which this message is the tool response.""" - tool_call_id: Optional[ExpressionType[str]] = None + tool_call_id: OptionalExpressionStr = None """The id of the tool invocation for which this message is the tool response.""" @@ -744,13 +771,13 @@ class IfBlock(StructuredBlock): """ kind: Literal[BlockKind.IF] = BlockKind.IF - condition: ExpressionType[bool] = Field(alias="if") + condition: ExpressionBool = Field(alias="if") """Condition. """ then: "BlockType" """Branch to execute if the condition is true. """ - else_: "OptionalBlockType" = Field(default=None, alias="else") + else_: OptionalBlockType = Field(default=None, alias="else") """Branch to execute if the condition is false. """ @@ -762,7 +789,7 @@ class MatchCase(BaseModel): case: Optional[PatternType] = None """Value to match. """ - if_: Optional[ExpressionType[bool]] = Field(default=None, alias="if") + if_: OptionalExpressionBool = Field(default=None, alias="if") """Boolean condition to satisfy. """ then: "BlockType" @@ -898,16 +925,16 @@ class RepeatBlock(StructuredBlock): index: OptionalStr = None """Name of the variable containing the loop iteration. """ - while_: ExpressionType[bool] = Field(default=True, alias="while") + while_: ExpressionBool = Field(default=True, alias="while") """Condition to stay at the beginning of the loop. """ repeat: "BlockType" """Body of the loop. """ - until: ExpressionType[bool] = False + until: ExpressionBool = False """Condition to exit at the end of the loop. """ - maxIterations: Optional[ExpressionType[int]] = None + maxIterations: OptionalExpressionInt = None """Maximal number of iterations to perform. """ join: JoinType = JoinText() @@ -953,7 +980,7 @@ class MapBlock(StructuredBlock): map: "BlockType" """Body of the iterator. """ - maxIterations: Optional[ExpressionType[int]] = None + maxIterations: OptionalExpressionInt = None """Maximal number of iterations to perform. """ join: JoinType = JoinText() @@ -980,7 +1007,7 @@ class ReadBlock(LeafBlock): """ kind: Literal[BlockKind.READ] = BlockKind.READ - read: ExpressionType[str] | None + read: OptionalExpressionStr """Name of the file to read. If `None`, read the standard input. """ message: OptionalStr = None @@ -999,7 +1026,7 @@ class IncludeBlock(StructuredBlock): """Name of the file to include. """ # Field for internal use - pdl__trace: "OptionalBlockType" = None + pdl__trace: OptionalBlockType = None class ImportBlock(LeafBlock): @@ -1010,7 +1037,7 @@ class ImportBlock(LeafBlock): """Name of the file to import. """ # Field for internal use - pdl__trace: "OptionalBlockType" = None + pdl__trace: OptionalBlockType = None class ErrorBlock(LeafBlock): @@ -1065,7 +1092,6 @@ class EmptyBlock(LeafBlock): BlockOrBlocksType: TypeAlias = BlockType | list[BlockType] # pyright: ignore """Block or list of blocks. """ -OptionalBlockType = TypeAliasType("OptionalBlockType", Optional[BlockType]) class Program(RootModel): diff --git a/src/pdl/pdl_interpreter.py b/src/pdl/pdl_interpreter.py index d0fb3aa51..23552d8a2 100644 --- a/src/pdl/pdl_interpreter.py +++ b/src/pdl/pdl_interpreter.py @@ -229,6 +229,9 @@ def __call__(self, *args, **kwargs): return result +ClosureBlock.model_rebuild() + + def generate( pdl_file: str | Path, state: Optional[InterpreterState], From 6e24391b29851019c2ade3ef94d04747ce7b813e Mon Sep 17 00:00:00 2001 From: Louis Mandel Date: Tue, 29 Jul 2025 22:17:00 -0400 Subject: [PATCH 10/10] Documentation Signed-off-by: Louis Mandel --- src/pdl/pdl_ast.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/pdl/pdl_ast.py b/src/pdl/pdl_ast.py index 6a0fc6221..65e066784 100644 --- a/src/pdl/pdl_ast.py +++ b/src/pdl/pdl_ast.py @@ -38,19 +38,26 @@ def _ensure_lower(value): OptionalStr = TypeAliasType("OptionalStr", Optional[str]) +"""Optional string.""" OptionalInt = TypeAliasType("OptionalInt", Optional[int]) +"""Optional integer.""" OptionalBoolOrStr = TypeAliasType("OptionalBoolOrStr", Optional[Union[bool, str]]) +"""Optional boolean or string.""" OptionalAny = TypeAliasType("OptionalAny", Optional[Any]) +"""Optional value of any type.""" OptionalBlockType = TypeAliasType("OptionalBlockType", Optional["BlockType"]) -"""Optional block. -""" +"""Optional block.""" ScopeType = TypeAliasType("ScopeType", PdlDict[str, Any]) +"""Type of the execution environment.""" ModelInput = TypeAliasType("ModelInput", Sequence[Mapping[str, Any]]) +"""Type of the input of an LLM call.""" OptionalModelInput = TypeAliasType("OptionalModelInput", Optional[ModelInput]) +"""Optional value of type ModelInput.""" + LazyMessage = TypeAliasType("LazyMessage", PdlLazy[dict[str, Any]]) LazyMessages: TypeAlias = PDLContext @@ -90,6 +97,7 @@ class PdlLocationType(BaseModel): OptionalPdlLocationType = TypeAliasType( "OptionalPdlLocationType", Optional[PdlLocationType] ) +"""Optional location type.""" empty_block_location = PdlLocationType(file="", path=[], table={}) @@ -292,8 +300,9 @@ class RegexParser(Parser): ParserType = TypeAliasType( "ParserType", Union[Literal["json", "jsonl", "yaml"], PdlParser, RegexParser] ) +"""Different parsers.""" OptionalParserType = TypeAliasType("OptionalParserType", Optional[ParserType]) - +"""Optional parser.""" RoleType: TypeAlias = OptionalStr """Role name.""" @@ -318,6 +327,7 @@ class ContributeValue(BaseModel): ContributeType = TypeAliasType( "ContributeType", Sequence[Union[ContributeTarget, dict[str, ContributeValue]]] ) +"""Type of the contribute field.""" class PdlTiming(BaseModel): @@ -339,6 +349,7 @@ class PdlTiming(BaseModel): OptionalPdlTiming = TypeAliasType("OptionalPdlTiming", Optional[PdlTiming]) +"""Optional execution time information.""" class PdlUsage(BaseModel): @@ -353,6 +364,7 @@ class PdlUsage(BaseModel): OptionalPdlUsage = TypeAliasType("OptionalPdlUsage", Optional[PdlUsage]) +"""Optional usage of statistics of an LLM call.""" class Block(BaseModel):