Remove redundant captured prompt fields
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
|
||||
@@ -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\"}}"},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -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 == "" {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user