Events
import ProteusAI from '@proteus-ai/sdk';
const proteus = new ProteusAI({ apiKey: '66563d92e59961d11fc67a39' });
try {
const conversation = await proteus.conversations.create({
characterId: '659a21168ad10b77542a3587'
});
proteus.messages.on('MESSAGE_SENT', (message) => console.log('This message was sent'));
conversation.on('MESSAGE_SENT', (message) => console.log('This message was sent in this conversation'));
proteus.messages.on('USER_MESSAGE_SENT', (message) => console.log('This message was sent by a user'));
conversation.on('USER_MESSAGE_SENT', (message) => console.log('This message was sent by a user in this conversation'));
proteus.messages.on('CHARACTER_MESSAGE_SENT', (message) => console.log('This message was sent by an AI character'));
conversation.on('CHARACTER_MESSAGE_SENT', (message) => console.log('This message was sent by an AI character in this conversation'));
} catch (_) {}