Skip to main content

Interface: UseBaleybotReturn<TOutput>

Defined in: react/src/hooks/useBaleybot.ts:71

Return type for useBaleybot hook

Type Parameters

TOutput

TOutput

Properties

bot

bot: Baleybot<unknown, Record<string, ZodToolDefinition<ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>, unknown> | ToolDefinition<(...args) => unknown> | Processable<unknown, unknown>>> | null

Defined in: react/src/hooks/useBaleybot.ts:91

The underlying baleybot instance (stable across prop changes unless reconfigured)


cancel

cancel: () => void

Defined in: react/src/hooks/useBaleybot.ts:89

Cancel ongoing batch processing

Returns

void


error

error: Error | null

Defined in: react/src/hooks/useBaleybot.ts:85

Last error, if any


isProcessing

isProcessing: boolean

Defined in: react/src/hooks/useBaleybot.ts:83

Whether any processing is in progress


process

process: ProcessFunction<TOutput>

Defined in: react/src/hooks/useBaleybot.ts:73

Process data - accepts single items, arrays, iterables, or async iterables


reconfigure

reconfigure: (next?) => void

Defined in: react/src/hooks/useBaleybot.ts:93

Recreate the underlying bot with new options (merging with current options)

Parameters

next?

Partial<UseBaleybotOptions>

Returns

void


reset

reset: () => void

Defined in: react/src/hooks/useBaleybot.ts:87

Reset all state

Returns

void


result

result: TOutput | null

Defined in: react/src/hooks/useBaleybot.ts:77

Last result produced (useful in managed mode); null if none yet


results

results: TOutput[]

Defined in: react/src/hooks/useBaleybot.ts:75

All results from batch processing (empty array for single item processing)


streamingResult

streamingResult: Partial<TOutput> | null

Defined in: react/src/hooks/useBaleybot.ts:81

Partially parsed structured output from the stream (available when outputSchema is set)


streamingText

streamingText: string

Defined in: react/src/hooks/useBaleybot.ts:79

Streaming text for the current item being processed