The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
TypeScript analyticsbibusiness-intelligencebusinessintelligenceclojuredashboarddatadata-analysisdata-visualizationdatabasemetabasemysqlpostgrespostgresqlreportingslacksql-editorvisualization
type UseMetabotResult = {
cancelRequest: () => void;
contextWindowPercentUsage: number;
CurrentChart: React_2.ComponentType<MetabotChartProps> | null;
errorMessages: MetabotErrorMessage[];
incompleteResponse: MetabotIncompleteResponse | null;
isContextWindowFull: boolean;
isProcessing: boolean;
messages: MetabotMessage[];
resetConversation: () => void;
retryMessage: (messageId: string) => Promise<void>;
submitMessage: (message: string) => Promise<void>;
};
Properties
| Property | Type | Description |
|---|---|---|
cancelRequest |
() => void |
Cancel the current in-flight request. |
contextWindowPercentUsage |
number |
How much of the model's context window the conversation occupies, 0-100. |
CurrentChart |
| React_2.ComponentType<MetabotChartProps> | null |
A pre-wired component bound to the latest chart the agent produced. null until the agent sends a chart — lets consumers detect presence and render a placeholder or swap panel content only when set. Example {CurrentChart ? <CurrentChart /> : <Placeholder />} |
errorMessages |
MetabotErrorMessage[] |
Errors are conversation-level, not attached to individual messages. |
incompleteResponse |
| MetabotIncompleteResponse | null |
Set when the latest agent response stopped before it finished, e.g. at its step limit. |
isContextWindowFull |
boolean |
Whether the conversation has consumed its entire context window. |
isProcessing |
boolean |
true from the moment a message is submitted until the response completes — including success, error, or cancellation. |
messages |
MetabotMessage[] |
All messages in the conversation. Chart messages include a Chart property. |
resetConversation |
() => void |
Clear all messages and start fresh. |
retryMessage |
(messageId: string) => Promise<void> |
Rewinds the conversation to the user message preceding messageId and re-submits that prompt. The agent message at messageId and anything after it is dropped. |
submitMessage |
(message: string) => Promise<void> |
Submit a new message to the conversation. |