Batch adapters can be used when the API sends responses in a single request without streaming.<br />
Batch adapters are **easier to implement**.

In order to implement a custom batch adapter for `NLUX`, you can use the following hook:

```tsx
import {useAsBatchAdapter} from '@nlux/react';
```

```tsx
const adapter = useAsBatchAdapter(send: BatchSend<AiMsg>)
```

Where `send` is a function that developers should implement and pass as a parameter to the hook. It's responsible for
sending the prompt to the API and receiving the response.

The `send` function has the following signature:

```tsx
export type BatchSend<AiMsg> = (
    message: string,
    extras: ChatAdapterExtras<AiMsg>,
) => Promise<AiMsg>;
```

The `send` method takes 2 parameters:

* `message` - The prompt message typed by the user, to be sent to the API.
* `extras` - An object containing [additional information](#adapter-extras) that the adapter might need.

The `send` method should return a promise that resolves to the response from the API.

When the `adapter` is used in the `<AiChat adapter={adapter} />` component, `NLUX` will take care of calling the
`send` method with the appropriate parameters and updating the chat UI with the response, or an error message if the
promise is rejected.
