GenkitG
Genkit16mo ago
20 replies
sacred-rose

How often do you find yourself writing a

How often do you find yourself writing a flow that is basically a very lightweight wrapper around a prompt/generate call? Where the inputSchema are variables that affect the text of the prompt, and the outputSchema is the output schema of the prompt (maybe with some post-processing)?

I'm wondering if it might make sense to have prompts be more explicitly executable:

const myPrompt = definePrompt({...});

await myPrompt({input: 'variables'});

// above is equivalent to...
const result = generate(await myPrompt({input: 'variables'});
return result.output();


a prompt would also have myPrompt.render() which would render into generate options like it does today, and myPrompt.generate() which would not automatically return the output like it does today
Was this page helpful?