Skip to content

Commit 96e68f6

Browse files
committed
feat: add support for CodeBlocks with argv
Signed-off-by: Nick Mitchell <[email protected]>
1 parent 41f6429 commit 96e68f6

File tree

9 files changed

+1057
-185
lines changed

9 files changed

+1057
-185
lines changed

pdl-live-react/src/helpers.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@ import type {
44
GraniteioModelBlock,
55
PdlBlock,
66
TextBlock,
7+
ArgsBlock,
8+
CodeBlock,
79
} from "./pdl_ast"
810

911
/** Re-export for convenience */
10-
export { type PdlBlock } from "./pdl_ast"
12+
export type { PdlBlock } from "./pdl_ast"
1113

1214
export type ModelBlock = Extract<
1315
PdlBlock,
@@ -258,3 +260,7 @@ export function extractStructuredModelResponse({
258260

259261
return { resultForDisplay, lang, meta }
260262
}
263+
264+
export function isArgs(block: ArgsBlock | CodeBlock): block is ArgsBlock {
265+
return Array.isArray((block as ArgsBlock).args)
266+
}

0 commit comments

Comments
 (0)