Skip to content

[Docs] document usage of dotprompt + handlebars mechanism #2865

Open
@evaisse

Description

@evaisse

Is your report related to a problem? Please describe.

I can't find any up to date documentation regarding the usage of handlebars helpers with the new dotprompt mechanism.

I do have found the following update from last year, here, and the documentation mentioning the custom helpers in dotprompt

but I can't make this code works anyway :

import {genkit} from 'genkit';
import {googleAI} from '@genkit-ai/googleai';
import { defineHelper } from '@genkit-ai/dotprompt';

defineHelper("eq", (a, b) => a === b);

/*
  https://github.com/firebase/genkit/issues/416
*/
export const ai = genkit({
  promptDir: './prompts',
  plugins: [
    googleAI({
      apiKey: process.env.GOOGLE_GENAI_API_KEY,
    }),
  ],
  model: 'googleai/gemini-2.0-flash',
});

I always get You specified knownHelpersOnly, but used the unknown helper...

Looks like their is no way to set knownHelpersOnly: false with the current genkit builder.

Additional context

Using :

   "@genkit-ai/googleai": "^1.7.0",
   "@genkit-ai/dotprompt": "^0.9.12",

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsImprovements or additions to documentation

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions