Route proposal modules through embedded PromptKit definitions
This commit is contained in:
27
internal/framework/proposal_generation/variables_test.go
Normal file
27
internal/framework/proposal_generation/variables_test.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package proposal_generation
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gitea.maximumdirect.net/eric/audita/internal/core/schema"
|
||||
)
|
||||
|
||||
func TestBuildProposalVariablesPreservesSectionGlossaryAndDescription(t *testing.T) {
|
||||
transcript := &schema.Transcript{Segments: []schema.Segment{{ID: 1, Speaker: "A", Start: 0, End: 1, Text: "gestures"}}}
|
||||
glossary := &schema.Glossary{Entries: []schema.GlossaryEntry{{Name: "Jesters"}}}
|
||||
variables, err := BuildProposalVariables(transcript, glossary, 0, " Fantasy names ")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !strings.Contains(variables["SectionJSON"], `"section_index": 0`) || !strings.Contains(variables["SectionJSON"], "gestures") || !strings.Contains(variables["GlossaryJSON"], "Jesters") || !strings.Contains(variables["TranscriptDescriptionBlock"], "Fantasy names") {
|
||||
t.Fatalf("encoded variables incomplete: %+v", variables)
|
||||
}
|
||||
empty, err := BuildProposalVariables(transcript, glossary, 0, " ")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if empty["TranscriptDescriptionBlock"] != "" {
|
||||
t.Fatal("empty description added guidance")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user