Simplify references and output instructions in LLM prompts
This commit is contained in:
@@ -21,7 +21,8 @@ type transcriptSectionPayload struct {
|
||||
}
|
||||
|
||||
// MarshalTranscriptSectionJSON builds the standardized transcript-section JSON
|
||||
// payload consumed by proposal prompt templates.
|
||||
// payload consumed by proposal prompt templates. IDs are one-based positions in
|
||||
// this request; the transcript and its actual IDs are unchanged.
|
||||
func MarshalTranscriptSectionJSON(transcript *schema.Transcript, sectionIndex int) ([]byte, error) {
|
||||
payload := transcriptSectionPayload{
|
||||
SectionIndex: sectionIndex,
|
||||
@@ -29,9 +30,9 @@ func MarshalTranscriptSectionJSON(transcript *schema.Transcript, sectionIndex in
|
||||
}
|
||||
|
||||
if transcript != nil {
|
||||
for _, s := range transcript.Segments {
|
||||
for i, s := range transcript.Segments {
|
||||
payload.Segments = append(payload.Segments, transcriptSectionSegment{
|
||||
ID: s.ID,
|
||||
ID: i + 1,
|
||||
Speaker: s.Speaker,
|
||||
Start: s.Start,
|
||||
End: s.End,
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
|
||||
func TestMarshalTranscriptSectionJSONShape(t *testing.T) {
|
||||
transcript := &schema.Transcript{Segments: []schema.Segment{
|
||||
{ID: 1, Speaker: "A", Start: 0.1, End: 1.2, Text: "alpha", Categories: []string{"session", "intro"}},
|
||||
{ID: 817, Speaker: "A", Start: 0.1, End: 1.2, Text: "alpha", Categories: []string{"session", "intro"}},
|
||||
}}
|
||||
|
||||
raw, err := MarshalTranscriptSectionJSON(transcript, 3)
|
||||
|
||||
Reference in New Issue
Block a user