i get the error "runPrompt is not defined" with this sample code:
defTool("poet", "Writes 4 line poems", {}, async () => {
const result = await runPrompt(`Write a 4 line poem`, {
model: "openai:gpt-4o",
label: "Poem writer",
});
return result.text;
});
script({
description: "Writes poems using the poet tool.",
model: "gpt-4o",
maxTokens: 4000,
tools: ["poet"],
});
$`Write a poem with the poet tool`;
Error stack :
runPrompt is not defined
ReferenceError: runPrompt is not defined
at Object.impl (file:///Users/alzyad/Dev/myProject/genaisrc/writePoemByTool.genai.mts?tsx-namespace=1726655022826:1:64)
at runToolCalls (/Users/alzyad/.npm/_npx/d3761ca94263c43f/node_modules/genaiscript/built/genaiscript.cjs:137950:35)
at processChatMessage (/Users/alzyad/.npm/_npx/d3761ca94263c43f/node_modules/genaiscript/built/genaiscript.cjs:138134:11)
at executeChatSession (/Users/alzyad/.npm/_npx/d3761ca94263c43f/node_modules/genaiscript/built/genaiscript.cjs:138265:30)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runTemplate (/Users/alzyad/.npm/_npx/d3761ca94263c43f/node_modules/genaiscript/built/genaiscript.cjs:143643:20)
at async runScript (/Users/alzyad/.npm/_npx/d3761ca94263c43f/node_modules/genaiscript/built/genaiscript.cjs:144464:14)
Am I doing something wrong ? or is this not working correctly ?
i get the error "runPrompt is not defined" with this sample code:
Error stack :
Am I doing something wrong ? or is this not working correctly ?