Skip to content

[Go] Support using a custom filesystem to load prompts from #3746

@naqerl

Description

@naqerl

Is your feature request related to a problem? Please describe.
Loading prompts from a directory is awesome, but it requires distributing additional files along with the application. It's an additional bit of work for web services and a pain for CLI tools.

Describe the solution you'd like.
Allow a custom fs.FS to be set in genkit.Init so embed.FS or any other implementation could be used.

Describe alternatives you've considered.
Distributing the prompts directory along with the app.

Additional context.
The API could look like this:

g := genkit.Init(ctx,
    genkit.WithPlugins(&googlegenai.GoogleAI{}),
    genkit.WithPromptDir("prompts"),
    // Without this, the OS filesystem will be used
    genkit.WithPromptFS(prompts),
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions