User prompt
Optionaloptions: GenTextOptionsOptional configuration
Generated text
// Simplest possible
const answer = await genText("What is 2+2?");
// With system prompt
const poem = await genText("Write a haiku about coding", {
system: "You are a creative poet",
});
// With model and options
const analysis = await genText("Analyze this data", {
model: "gpt-4o",
system: "You are a data analyst",
temperature: 0.3,
});
Generate text from an LLM in a single call.