Skip to content

Commit d3f8a67

Browse files
committed
feat: add support for CodeBlocks with argv
Signed-off-by: Nick Mitchell <[email protected]>
1 parent 102a589 commit d3f8a67

File tree

9 files changed

+1052
-183
lines changed

9 files changed

+1052
-183
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
type MakeNonNullable<T> = {
1315
[K in keyof T]-?: NonNullable<T[K]>
@@ -282,3 +284,7 @@ export function extractStructuredModelResponse({
282284

283285
return { resultForDisplay, lang, meta }
284286
}
287+
288+
export function isArgs(block: ArgsBlock | CodeBlock): block is ArgsBlock {
289+
return Array.isArray((block as ArgsBlock).args)
290+
}

0 commit comments

Comments
 (0)