--- title: UseGridAIRequestOptions description: "Learn how to build custom functionality when working with the React Grid by Kendo UI with the help of the UseGridAIRequestOptions." api_reference: true type: inner_api slug: api_grid_usegridairequestoptions --- # UseGridAIRequestOptions Options for the useGridAIRequest hook.
| Name | Type | Default | Description |
|---|---|---|---|
| #### columns? |
{ field: string; id?: string; values?: any[]; }[]
|
The columns to include in the request. | |
| #### gridRef? |
"null" | Pick<[GridHandle]({% slug api_grid_gridhandle %})>
|
Reference to grid methods. | |
| #### gridState? |
[GridAIState]({% slug api_grid_gridaistate %})
|
The current grid state. | |
| #### httpClient? |
[GridAIHttpClient]({% slug api_grid_gridaihttpclient %})
|
Optional custom HTTP client. When provided, overrides the built-in fetch-based transport. | |
| #### onExportPdf? |
() => void
|
Callback fired when PDF export is requested. | |
| #### onMessages? |
(messages: string[], promptMessage?: string, isRetry?: boolean) => void
|
Callback fired when messages are received from AI. | |
| #### onPromptRequest? |
(request: [GridAIRequestData]({% slug api_grid_gridairequestdata %}), isRetry?: boolean) => void
|
Callback fired before the request is sent. | |
| #### onResponseError? |
(error: any) => void
|
Callback fired when the response returns an error. | |
| #### onResponseSuccess? |
(response: [GridAIResponse]({% slug api_grid_gridairesponse %})<any>, promptMessage?: string, isRetry?: boolean) => void
|
Callback fired when the response is received successfully. | |
| #### onStateChange? |
(newState: [GridAIState]({% slug api_grid_gridaistate %})) => void
|
Callback fired when the grid state should be updated. | |
| #### requestOptions? |
[GridAIRequestConfig]({% slug api_grid_gridairequestconfig %})
|
Additional HTTP request options. | |
| #### requestUrl? |
string
|
The URL to send the AI request to. | |
| #### role? |
string
|
The role for the AI request. Defaults to 'user'. |