feat: upload audio, get a private Swedish transcript, discuss it (#33, ADR-033) #39
@@ -41,6 +41,11 @@ type Request struct {
|
|||||||
Transcript string
|
Transcript string
|
||||||
History []Turn
|
History []Turn
|
||||||
Question string
|
Question string
|
||||||
|
// MaxChars, when positive, overrides the Service's transcript budget for this
|
||||||
|
// request. The Service default is sized for YouTube captions (~22 minutes of
|
||||||
|
// speech); an uploaded recording is much longer, and truncation keeps only the
|
||||||
|
// head (ADR-033). Zero or negative means "use the Service default".
|
||||||
|
MaxChars int
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reply is the model's answer plus whether the transcript was bounded to fit the
|
// Reply is the model's answer plus whether the transcript was bounded to fit the
|
||||||
@@ -113,7 +118,11 @@ func (s *Service) Answer(ctx context.Context, req Request) (Reply, error) {
|
|||||||
model = s.DefaultModel("")
|
model = s.DefaultModel("")
|
||||||
}
|
}
|
||||||
|
|
||||||
transcript, truncated := truncate(req.Transcript, s.maxChars)
|
budget := s.maxChars
|
||||||
|
if req.MaxChars > 0 {
|
||||||
|
budget = req.MaxChars
|
||||||
|
}
|
||||||
|
transcript, truncated := truncate(req.Transcript, budget)
|
||||||
system := buildSystem(transcript, truncated)
|
system := buildSystem(transcript, truncated)
|
||||||
user := buildUser(req.History, req.Question)
|
user := buildUser(req.History, req.Question)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user