Loading...
Skip to main content

Module: inspector/console

Functions

showInspector

showInspector(componentToInspect, opts?): void

showInspector renders an interactive, ASCII-based debug tool in the terminal window.

The left side shows the streamed final output, and the right side shows the debug tree. You can use the left and right arrow keys to step through the debug tree, to see how your program was evaluated step by step.

Note that if you call showInspector and also write to stdout or stderr (for instance, with console.log), the output may be messed up.

See

DebugTree

Example

function MyApp() {
return (
<ChatCompletion>
<UserMessage>Generate a poem about red pandas.</UserMessage>
</ChatCompletion>
);
}
showInspector(<MyApp />);

Parameters

NameType
componentToInspectNode
optsObject
opts.showDebugTree?boolean

Returns

void

Defined in

ai-jsx/src/inspector/console.tsx:175


useStdoutDimensions

useStdoutDimensions(): [number, number]

Get the size of the terminal window.

Returns

[number, number]

Defined in

ai-jsx/src/inspector/console.tsx:12