```tsx
import {createAiChat, MessageReceivedCallback, MessageReceivedEventDetails} from '@nlux/core';

const messageReceivedCallback: MessageReceivedCallback = (event: MessageReceivedEventDetails) => {
    console.log('Message received:', event.message);
};
```

```tsx
// Registering the messageReceivedCallback when creating the AiChat instance
const aiChat = createAiChat().withAdapter(adapter).on('messageReceived', messageReceivedCallback);
```

```tsx
// Registering the messageReceivedCallback after creating the AiChat instance
aiChat.on('messageReceived', callback);
```

```tsx
// Removing messageReceivedCallback
aiChat.removeEventListener('messageReceived', callback);
```
