Add transcript description prompt context
This commit is contained in:
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"gitea.maximumdirect.net/eric/audita/internal/core/schema"
|
||||
"gitea.maximumdirect.net/eric/audita/internal/framework/contracts"
|
||||
"gitea.maximumdirect.net/eric/audita/internal/framework/promptcontext"
|
||||
)
|
||||
|
||||
type promptSegment struct {
|
||||
@@ -22,7 +23,7 @@ type promptTranscriptSection struct {
|
||||
Segments []promptSegment `json:"segments"`
|
||||
}
|
||||
|
||||
func BuildProposalMessages(transcript *schema.Transcript, glossary *schema.Glossary, sectionIndex int) ([]contracts.LLMMessage, error) {
|
||||
func BuildProposalMessages(transcript *schema.Transcript, glossary *schema.Glossary, sectionIndex int, transcriptDescription string) ([]contracts.LLMMessage, error) {
|
||||
glossaryJSON, err := json.MarshalIndent(glossary, "", " ")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("marshal glossary prompt context: %w", err)
|
||||
@@ -71,6 +72,7 @@ func BuildProposalMessages(transcript *schema.Transcript, glossary *schema.Gloss
|
||||
"- Return only changed segments; do not return entries for unchanged segments.\n" +
|
||||
"- confidence must be between 0.0 and 1.0.\n" +
|
||||
"- If no corrections are needed, return an empty corrections list.\n\n" +
|
||||
promptcontext.TranscriptDescriptionBlock(transcriptDescription) +
|
||||
fmt.Sprintf("Glossary:\n%s\n\nTranscript section:\n%s", string(glossaryJSON), string(sectionJSON))
|
||||
|
||||
return []contracts.LLMMessage{
|
||||
|
||||
Reference in New Issue
Block a user