Skip to content

Commit 33e1907

Browse files
authored
Use ${ pdl_context } as default value for the input field of a model block (#757)
1 parent 2ba92d7 commit 33e1907

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

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

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ export type Description19 = string | null
140140
*/
141141
export type Def = string | null
142142
export type ContributeTarget = "result" | "context"
143-
export type Value = unknown[]
143+
export type Value = unknown[] | string | LocalizedExpression
144+
export type Path = string[]
145+
export type File = string
144146
/**
145147
* Indicate if the block contributes to the result and background context.
146148
*
@@ -243,8 +245,6 @@ export type Context =
243245
*
244246
*/
245247
export type PdlId = string | null
246-
export type Path = string[]
247-
export type File = string
248248
export type StartNanos = number | null
249249
export type EndNanos = number | null
250250
export type FirstUseNanos = number | null
@@ -3821,6 +3821,24 @@ export interface Defs19 {
38213821
export interface ContributeValue {
38223822
value: Value
38233823
}
3824+
export interface LocalizedExpression {
3825+
expr: Expr
3826+
pdl__location?: PdlLocationType | null
3827+
}
3828+
export interface Expr {
3829+
[k: string]: unknown
3830+
}
3831+
/**
3832+
* Internal data structure to keep track of the source location information.
3833+
*/
3834+
export interface PdlLocationType {
3835+
path: Path
3836+
file: File
3837+
table: Table
3838+
}
3839+
export interface Table {
3840+
[k: string]: number
3841+
}
38243842
export interface PdlParser {
38253843
description?: Description20
38263844
spec?: Spec20
@@ -3835,17 +3853,6 @@ export interface RegexParser {
38353853
regex: Regex
38363854
mode?: Mode
38373855
}
3838-
/**
3839-
* Internal data structure to keep track of the source location information.
3840-
*/
3841-
export interface PdlLocationType {
3842-
path: Path
3843-
file: File
3844-
table: Table
3845-
}
3846-
export interface Table {
3847-
[k: string]: number
3848-
}
38493856
/**
38503857
* Internal data structure to record timing information in the trace.
38513858
*/
@@ -3855,13 +3862,6 @@ export interface PdlTiming {
38553862
first_use_nanos?: FirstUseNanos
38563863
timezone?: Timezone
38573864
}
3858-
export interface LocalizedExpression {
3859-
expr: Expr
3860-
pdl__location?: PdlLocationType | null
3861-
}
3862-
export interface Expr {
3863-
[k: string]: unknown
3864-
}
38653865
export interface JoinText {
38663866
as?: As
38673867
with?: With

src/pdl/pdl-schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3766,7 +3766,7 @@
37663766
"type": "null"
37673767
}
37683768
],
3769-
"default": null,
3769+
"default": "${ pdl_context }",
37703770
"description": "Messages to send to the model.\n ",
37713771
"title": "Input"
37723772
},
@@ -6237,7 +6237,7 @@
62376237
"type": "null"
62386238
}
62396239
],
6240-
"default": null,
6240+
"default": "${ pdl_context }",
62416241
"description": "Messages to send to the model.\n ",
62426242
"title": "Input"
62436243
},

src/pdl/pdl_ast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ class ModelBlock(LeafBlock):
388388
model: ExpressionType
389389
"""Model to use.
390390
"""
391-
input: Optional["BlockType"] = None
391+
input: "BlockType" = "${ pdl_context }"
392392
"""Messages to send to the model.
393393
"""
394394
modelResponse: Optional[str] = None

0 commit comments

Comments
 (0)