---
title: "Type Alias UseMetabotResult"
url: "https://www.metabase.com/docs/latest/embedding/sdk/api/UseMetabotResult"
version: "65"
---

> For the complete documentation index, see [llms.txt](https://www.metabase.com/docs/llms.txt).

# Type Alias UseMetabotResult

```ts
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`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/0b728411cd1dfb4bd26992bb35a73cf8edaa22e7/types/react/index.d.ts#L104)\<[`MetabotChartProps`](https://www.metabase.com/docs/latest/embedding/sdk/api/MetabotChartProps.md)\> \| `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`](https://www.metabase.com/docs/latest/embedding/sdk/api/MetabotErrorMessage.md)[]                                                                                                                                                                   | Errors are conversation-level, not attached to individual messages.                                                                                                                                                                                                       |
| `incompleteResponse`               | \| [`MetabotIncompleteResponse`](https://www.metabase.com/docs/latest/embedding/sdk/api/MetabotIncompleteResponse.md) \| `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`](https://www.metabase.com/docs/latest/embedding/sdk/api/MetabotMessage.md)[]                                                                                                                                                                             | All messages in the conversation. Chart messages include a `Chart` property.                                                                                                                                                                                              |
| `resetConversation`                 | () => `void`                                                                                                                                                                                                              | Clear all messages and start fresh.                                                                                                                                                                                                                                       |
| `retryMessage`                           | (`messageId`: `string`) => [`Promise`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/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`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<`void`\>                                                                                        | Submit a new message to the conversation.                                                                                                                                                                                                                                 |
