-
Couldn't load subscription status.
- Fork 540
Open
Labels
Description
Describe the bug
When passing a Go struct as prompt input to .prompt, fields tagged with snake_case (e.g., org_name, date_range) are silently missing in the rendered prompt. No error is thrown. Using camelCase works.
To Reproduce
- example.prompt
---
model: openai/gpt-4.1-mini
input:
schema:
items(array):
org_name: string
date_range: string
---
{{#each items as |it|}}
Org: {{ it.org_name }}
Range: {{ it.date_range }}
{{/each}}- Go
prompt := genkit.LookupPrompt(Genkit, promptName)
if prompt == nil {
return nil, fmt.Errorf("prompt %s not found", promptName)
}
actionOpts, err := prompt.Render(ctx, input)
if err != nil {
return nil, fmt.Errorf("error rendering prompt: %w", err)
}Log the action options and see that org and date range are missing from the parsed prompt.
- Control: Works if using camelCase (template + struct tags):
orgName,dateRange.
Expected behavior
Snake_case JSON keys should be available in the template per struct tags; the rendered prompt should include the values or report a validation error if mismatched.
Environment
- OS: macOS (darwin/arm64)
- Go: 1.25.1
- Genkit (Go): 0.7.x
matheus-foscarinid
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status