Include glossary guidance in proposal conversations
This commit is contained in:
@@ -3,14 +3,31 @@ package promptcontext
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"gitea.maximumdirect.net/eric/audita/v4/internal/core/glossary"
|
||||
)
|
||||
|
||||
// GlossaryVariables contains the glossary inputs shared by a stage's proposals.
|
||||
type GlossaryVariables struct {
|
||||
ContextJSON string
|
||||
ProtectionJSON string
|
||||
ContextJSON string
|
||||
ProtectionJSON string
|
||||
InstructionsBlock string
|
||||
}
|
||||
|
||||
type GlossaryInstruction struct {
|
||||
Collection string
|
||||
Text string
|
||||
}
|
||||
|
||||
func GlossaryInstructionsBlock(instructions []GlossaryInstruction) string {
|
||||
var blocks []string
|
||||
for _, instruction := range instructions {
|
||||
if instruction.Text != "" {
|
||||
blocks = append(blocks, instruction.Collection+":\n"+instruction.Text)
|
||||
}
|
||||
}
|
||||
return strings.Join(blocks, "\n\n")
|
||||
}
|
||||
|
||||
func PrepareGlossaryVariables(entries []glossary.Entry, terms []glossary.Term) (GlossaryVariables, error) {
|
||||
|
||||
Reference in New Issue
Block a user