-
Notifications
You must be signed in to change notification settings - Fork 675
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Summary
The Python SDK's prompt.py drops the input.default field when constructing the prompt metadata for the reflection API. This is the same issue as #4534 but for the Python SDK.
Root Cause
In py/packages/genkit/src/genkit/blocks/prompt.py, the load_prompt_metadata() function builds the input dict without the default key:
'input': {
'jsonSchema': input_schema.get('schema') if input_schema and isinstance(input_schema, dict) else None,
},But dotprompt's PromptInputConfig has a default field containing default values for input variables. This field is part of the dotprompt spec (spec/variables.yaml) and is supported by all 6 implementations (JS, Python, Go, Dart, Java, Rust).
Fix
Add default to the input dict:
'input': {
'default': input_schema.get('default') if input_schema and isinstance(input_schema, dict) else None,
'jsonSchema': input_schema.get('schema') if input_schema and isinstance(input_schema, dict) else None,
},Impact
- DevUI prompt input forms don't show default values from
.promptfiles - Users must manually enter values that are already specified as defaults in the prompt definition
References
- JS counterpart: bug(js/ai): Prompt input.default from dotprompt not passed to DevUI #4534
- Dotprompt spec:
spec/variables.yamlingoogle/dotprompt - DevUI schema expects
input.default:genkit-tools/common/src/types/prompt.ts:38
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Done