Optional
_data: anyProtected
initSend a prompt to the chat and get a response.
The returned command can be executed in multiple ways:
await chat.prompt("question")
- returns final resultawait chat.prompt("question").run()
- same as aboveawait chat.prompt("question").stream()
- returns event emitterThe message or question to send to the chat
ChatCommand that can be executed or streamed
const chat = agent.chat('my_chat_id');
// Simple prompt (promise mode)
const answer = await chat.prompt("What is the capital of France?");
// Streaming for long responses
const stream = await chat.prompt("Write a detailed report").stream();
stream.on('data', chunk => console.log(chunk));
stream.on('end', () => console.log('Complete!'));
Base class for all SDK objects.
This class provides a base implementation for all SDK objects. It handles event emission, promise management, and initialization.
This object is used to ensure that an SRE instance is initialized, and if not, create one with default settings.