class CallbackManagerconst prompt = PromptTemplate.fromTemplate("What is the answer to {question}?");
// Example of using LLMChain with OpenAI and a simple prompt
const chain = new LLMChain({
llm: new ChatOpenAI({ model: "gpt-4o-mini", temperature: 0.9 }),
prompt,
});
// Running the chain with a single question
const result = await chain.call({
question: "What is the airspeed velocity of an unladen swallow?",
});
console.log("The answer is:", result);Gets the parent run ID, if any.
Called at the start of a Chain run, with the chain name and inputs and the run ID.
Called at the start of a Chat Model run, with the prompt(s) and the run ID.
Called at the start of an LLM or Chat Model run, with the prompt(s) and the run ID.
Called at the start of a Tool run, with the tool name and input and the run ID.