Hand checked processing selections to execution
This commit is contained in:
@@ -19,6 +19,8 @@ import (
|
||||
type StructuredLLMClient = structuredoutput.Client
|
||||
|
||||
// TranscriptModule is the minimal contract for framework-integrated modules.
|
||||
// Propose may run concurrently on an instance across sections. Request data
|
||||
// is borrowed for the call. Copy it before retaining it or modifying it.
|
||||
type TranscriptModule interface {
|
||||
Key() string
|
||||
ReplacementPolicy() proposals.ReplacementPolicy
|
||||
@@ -31,18 +33,35 @@ type StructuredCompletionResponse = structuredoutput.Response
|
||||
|
||||
// ModuleRunSpec identifies one resolved module instance in a pipeline.
|
||||
type ModuleRunSpec struct {
|
||||
ModuleKey string `json:"module_key"`
|
||||
InstanceName string `json:"instance_name"`
|
||||
ReplacementPolicy proposals.ReplacementPolicy `json:"replacement_policy"`
|
||||
Index int `json:"-"`
|
||||
ID *string `json:"-"`
|
||||
Settings config.Stage `json:"-"`
|
||||
Glossary []glossary.Entry `json:"-"`
|
||||
ProtectedTerms []glossary.Term `json:"-"`
|
||||
CaptureProposalExchange bool `json:"-"`
|
||||
ProposalClient StructuredLLMClient `json:"-"`
|
||||
ValidationClient StructuredLLMClient `json:"-"`
|
||||
RepairClient StructuredLLMClient `json:"-"`
|
||||
ModuleKey string `json:"module_key"`
|
||||
InstanceName string `json:"instance_name"`
|
||||
ReplacementPolicy proposals.ReplacementPolicy `json:"replacement_policy"`
|
||||
Index int `json:"-"`
|
||||
ID *string `json:"-"`
|
||||
Settings config.Stage `json:"-"`
|
||||
Glossary []glossary.Entry `json:"-"`
|
||||
ProtectedTerms []glossary.Term `json:"-"`
|
||||
GlossaryView *validators.GlossaryView `json:"-"`
|
||||
GlossaryVariables *promptcontext.GlossaryVariables `json:"-"`
|
||||
CaptureProposalExchange bool `json:"-"`
|
||||
ProposalClient StructuredLLMClient `json:"-"`
|
||||
ValidationClient StructuredLLMClient `json:"-"`
|
||||
RepairClient StructuredLLMClient `json:"-"`
|
||||
}
|
||||
|
||||
// PrepareGlossary constructs the read-only views used by proposal and validation.
|
||||
func (s *ModuleRunSpec) PrepareGlossary() error {
|
||||
if s.GlossaryVariables == nil {
|
||||
variables, err := promptcontext.PrepareGlossaryVariables(s.Glossary, s.ProtectedTerms)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
s.GlossaryVariables = &variables
|
||||
}
|
||||
if s.GlossaryView == nil {
|
||||
s.GlossaryView = validators.PrepareGlossaryView(s.Glossary, s.ProtectedTerms)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// SectionMetadata captures chunk-level metadata without embedding full segment payloads.
|
||||
|
||||
Reference in New Issue
Block a user