Skip to content

[JS] ai.prompt('_FILENAME') #2928

Open
Open
@tailot

Description

@tailot

Describe the bug
The genkit framework raises an exception when I try to call a prompt file whose name starts with the '_' character.

To Reproduce
define a file among your prompts with the name _verify.prompt and run in your flow:

   const verifyPrompt = await ai.prompt('_verify');

Expected behavior
Normal execution of the program.

Software version:

  • OS: macos 15.4.1 (24E263)
  • Node: v22.15.0
  • genkit: 1.8.0 and 1.9.0

Additional context
I tested it in both 1.8 and 1.9

Stacktrace

/Users/tailot/forgeIdea/genkit/node_modules/@genkit-ai/ai/src/prompt.ts:845
  throw new GenkitError({
        ^


GenkitError: NOT_FOUND: Prompt _verify not found
    at lookupPrompt (/Users/tailot/forgeIdea/genkit/node_modules/@genkit-ai/ai/src/prompt.ts:845:9)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async prompt (/Users/tailot/forgeIdea/genkit/node_modules/@genkit-ai/ai/src/prompt.ts:818:10) {
  source: undefined,
  status: 'NOT_FOUND',
  detail: undefined,
  code: 404,
  originalMessage: 'Prompt _verify not found'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtooling

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions