Include glossary guidance in proposal conversations
This commit is contained in:
@@ -31,6 +31,9 @@ collections:
|
||||
{{ .TranscriptDescriptionBlock }}Glossary context:
|
||||
{{ .GlossaryJSON }}
|
||||
|
||||
Glossary-use guidance:
|
||||
{{ .GlossaryInstructionsBlock }}
|
||||
|
||||
Protected spellings:
|
||||
{{ .ProtectedTermsJSON }}
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ collections:
|
||||
{{ .TranscriptDescriptionBlock }}Glossary context:
|
||||
{{ .GlossaryJSON }}
|
||||
|
||||
Glossary-use guidance:
|
||||
{{ .GlossaryInstructionsBlock }}
|
||||
|
||||
Protected spellings:
|
||||
{{ .ProtectedTermsJSON }}
|
||||
|
||||
|
||||
@@ -28,6 +28,9 @@ collections:
|
||||
{{ .TranscriptDescriptionBlock }}Glossary context:
|
||||
{{ .GlossaryJSON }}
|
||||
|
||||
Glossary-use guidance:
|
||||
{{ .GlossaryInstructionsBlock }}
|
||||
|
||||
Protected spellings:
|
||||
{{ .ProtectedTermsJSON }}
|
||||
|
||||
|
||||
@@ -31,6 +31,9 @@ collections:
|
||||
{{ .TranscriptDescriptionBlock }}Glossary context:
|
||||
{{ .GlossaryJSON }}
|
||||
|
||||
Glossary-use guidance:
|
||||
{{ .GlossaryInstructionsBlock }}
|
||||
|
||||
Protected spellings:
|
||||
{{ .ProtectedTermsJSON }}
|
||||
|
||||
|
||||
@@ -112,6 +112,9 @@ func mergeSharedVariables(values map[string]string, authoritative bool) map[stri
|
||||
if _, exists := result["ProtectedTermsJSON"]; !exists {
|
||||
result["ProtectedTermsJSON"] = "[]"
|
||||
}
|
||||
if _, exists := result["GlossaryInstructionsBlock"]; !exists {
|
||||
result["GlossaryInstructionsBlock"] = ""
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ func TestEmbeddedDefinitionsPrepareThroughPromptKit(t *testing.T) {
|
||||
"HardeningPolicy": prompts.HardeningText(),
|
||||
"TranscriptDescriptionBlock": "Transcript description:\nfixture-description\n\n",
|
||||
"GlossaryJSON": "{\"name\":\"fixture-glossary\"}",
|
||||
"GlossaryInstructionsBlock": "fixture-guidance",
|
||||
"SectionJSON": "{\"text\":\"fixture-section\"}",
|
||||
"PayloadJSON": "[{\"text\":\"fixture-correction\"}]",
|
||||
}
|
||||
@@ -59,6 +60,21 @@ func TestEmbeddedDefinitionsPrepareThroughPromptKit(t *testing.T) {
|
||||
if strings.HasPrefix(tc.id, "audita/modules.") && !strings.Contains(rendered, "fixture-glossary") {
|
||||
t.Error("missing glossary context")
|
||||
}
|
||||
if strings.HasPrefix(tc.id, "audita/modules.") {
|
||||
if !strings.Contains(rendered, "fixture-guidance") {
|
||||
t.Error("missing guidance")
|
||||
}
|
||||
without := make(map[string]string, len(vars))
|
||||
for k, v := range vars {
|
||||
if k != "GlossaryInstructionsBlock" {
|
||||
without[k] = v
|
||||
}
|
||||
}
|
||||
without = prompts.WithSharedVariables(without)
|
||||
if _, err := engine.Prepare(context.Background(), pk.RunRequest{PromptID: tc.id, ProfileID: "fixture", Vars: without}); err != nil {
|
||||
t.Fatalf("omitted guidance: %v", err)
|
||||
}
|
||||
}
|
||||
missing := map[string]string{"HardeningPolicy": prompts.HardeningText()}
|
||||
if _, err := engine.Prepare(context.Background(), pk.RunRequest{PromptID: tc.id, ProfileID: "fixture", Vars: missing}); err == nil {
|
||||
t.Error("missing variables accepted")
|
||||
|
||||
Reference in New Issue
Block a user