Skip to content

Commit 20bfa31

Browse files
authored
refactor: refactor AST to generate simpler JSON Schema (#1079)
Before: ``` % wc src/pdl/pdl-schema.json 12553 22420 313983 src/pdl/pdl-schema.json ``` After: ``` % wc src/pdl/pdl-schema.json 4209 11048 125514 src/pdl/pdl-schema.json ``` --------- Signed-off-by: Louis Mandel <[email protected]>
1 parent 7fe7f05 commit 20bfa31

File tree

6 files changed

+4382
-14575
lines changed

6 files changed

+4382
-14575
lines changed

pdl-live-react/src/helpers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {
66
TextBlock,
77
ArgsBlock,
88
CodeBlock,
9-
PdlModelInput,
9+
ModelInput,
1010
LocalizedExpression,
1111
} from "./pdl_ast"
1212
import { match, P } from "ts-pattern"
@@ -232,10 +232,10 @@ export function hasMessage(block: PdlBlock): block is MessageBearing {
232232

233233
export function hasInput(block: PdlBlock): block is
234234
| (Omit<GraniteioModelBlock, "input"> & {
235-
pdl__model_input: NonNullable<PdlModelInput>
235+
pdl__model_input: NonNullable<ModelInput>
236236
})
237237
| (Omit<LitellmModelBlock, "input"> & {
238-
pdl__model_input: NonNullable<PdlModelInput>
238+
pdl__model_input: NonNullable<ModelInput>
239239
}) {
240240
const mb = block as ModelBlock
241241
return Array.isArray(mb.pdl__model_input) && mb.pdl__model_input.length > 0

0 commit comments

Comments
 (0)