Hook Input Type Reference
The HookInput
type defines the configuration options for BAML React hooks.
Type Parameters
FunctionName
The name of the BAML function being called. Used to infer the correct types for responses.
Options
Configuration object that determines streaming behavior. Defaults to { stream?: true }
.
Properties
stream
Flag to enable or disable streaming mode. When true, enables streaming responses.
onStreamData
Callback function for streaming responses. Only available when Options['stream']
is true.
onFinalData
Callback function for the final response.
onData
Unified callback function that receives both streaming and final responses. For non-streaming hooks, only receives final responses.
onError
Callback function for error handling. See Error Types.