Remove redundant captured prompt fields

This commit is contained in:
2026-11-05 14:34:05 +00:00
parent 7db5572b62
commit cee9bbc7b2
7 changed files with 10 additions and 10 deletions

View File

@@ -87,7 +87,6 @@ func (state *loaded) materializePrompt(id string, raw promptConfig, base configk
definition.Inputs = inputs
definition.Templates = messages
entry := &promptEntry{requirementInputs: inputMetadata, messages: compiledMessages}
definition.OutputFormat = contract.Format
definition.Validation = contract
if raw.SessionID != nil {
var err error

View File

@@ -145,7 +145,6 @@ type PromptDefinition struct {
SessionID string `yaml:"session_id" json:"session_id,omitempty"`
Inputs []PromptInput `yaml:"inputs"`
Templates []PromptMessageTemplate `yaml:"templates"`
OutputFormat OutputFormat `yaml:"output_format"`
Validation OutputContract `yaml:"validation"`
}
@@ -170,7 +169,6 @@ type PromptInput struct {
type PromptMessageTemplate struct {
Role string `yaml:"role"`
Content string `yaml:"content"`
ContentFile string `yaml:"content_file"`
CacheControl *CacheControl `yaml:"cache_control,omitempty" json:"cache_control,omitempty"`
}

View File

@@ -49,7 +49,7 @@ func TestGoRenderer_Render(t *testing.T) {
def := &domain.PromptDefinition{
Inputs: []domain.PromptInput{{Name: "transcript", Required: true}},
Templates: []domain.PromptMessageTemplate{
{Role: "user", Content: "From file: {{input \"transcript\"}}", ContentFile: "/tmp/user.tmpl"},
{Role: "user", Content: "From file: {{input \"transcript\"}}"},
},
}

View File

@@ -641,9 +641,6 @@ func copyExtraParams(src map[string]any) map[string]any {
func resolveOutputContract(def *domain.PromptDefinition, override *domain.OutputContract) (domain.OutputContract, error) {
contract := def.Validation
if contract.Format == "" {
contract.Format = def.OutputFormat
}
if override != nil {
contract = *override
if contract.Format == "" {

View File

@@ -2504,7 +2504,6 @@ func promptDef(format domain.OutputFormat, mode domain.ValidationMode, attempts
DefaultProfile: "exec",
Inputs: []domain.PromptInput{{Name: "transcript", Required: true}},
Templates: []domain.PromptMessageTemplate{{Role: "user", Content: "x"}},
OutputFormat: format,
Validation: domain.OutputContract{
ValidationMode: mode,
RepairAttempts: attempts,