Promise mode: returns the final result as a string
Streaming mode: returns a stream event emitter
Parameters
prompt: string
Optionaloptions: any
Returns LLMCommand
Example
// Promise mode : returns the final result as a string constresponse = awaitllm.prompt("Hello, world!");
// Streaming mode : returns an EventEmitter conststream = awaitllm.prompt("Tell me a story").stream(); stream.on('data', chunk=>process.stdout.write(chunk));
Represents a LLM instance. These instances are created by the LLM Factory (LLM).
Example: Usage example
More examples are available in the LLM namespace.