You can listen to an event by using the `events` property when defining your `<AiChat />` component.

The `events` property is an object where the key is the event name and the value is a callback function that
will be called when the event is triggered. Here is an example of how to listen to the `messageSent`
and `messageReceived` events:

```tsx
import {useCallback} from 'react';
import {AiChat, EventsConfig, MessageReceivedCallback, MessageSentCallback} from '@nlux/react';

// We define an event callback using the `useCallback` hook
const messageReceivedCallback = useCallback<MessageReceivedCallback>((eventDetails) => {
    console.log('Message received:', eventDetails.message);
}, [/* Your callback code dependencies */]);

const messageSentCallback = useCallback<MessageSentCallback>((eventDetails) => {
    console.log('Message sent:', eventDetails.message);
}, [/* Your callback code dependencies */]);

const eventCallbacks: EventsConfig = {
    messageReceived: messageReceivedCallback,
    messageSent: messageSentCallback
};

<AiChat adapter={adapter} events={eventCallbacks} />
```

You can only register **one event callback** for each event.
