genkit
genkit copied to clipboard
[Go] Support using a custom filesystem to load prompts from
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),
)
Hi @naqerl, thanks for the valuable contribution. We will take a look at this proposal!