docs: expand .env example to show max/large values; add SUMM_TIMEOUT and summarizer tunables\n\nfeat: summarizer improvements\n- readability extraction for articles\n- image links passed to model as vision inputs\n- configurable max groups/links/bytes and timeout\n- higher default ceilings; resilient fallback summary
This commit is contained in:
parent
2954e85e7a
commit
9ecf4f4f4c
7 changed files with 296 additions and 53 deletions
|
|
@ -32,6 +32,8 @@ type Server struct {
|
|||
Logger *slog.Logger
|
||||
Metrics *Metrics
|
||||
Ready func() bool
|
||||
// Optional timeout override for summarizer
|
||||
SummarizerTimeout time.Duration
|
||||
}
|
||||
|
||||
func (s *Server) Start(ctx context.Context) error {
|
||||
|
|
@ -106,8 +108,12 @@ func (s *Server) handleTrigger(w http.ResponseWriter, r *http.Request) {
|
|||
_, _ = w.Write([]byte("summarizer not configured"))
|
||||
return
|
||||
}
|
||||
// Timeout summarization to avoid hung requests.
|
||||
ctxSum, cancel := context.WithTimeout(ctx, 60*time.Second)
|
||||
// Timeout summarization using configurable timeout (default 5m)
|
||||
tout := s.SummarizerTimeout
|
||||
if tout <= 0 {
|
||||
tout = 5 * time.Minute
|
||||
}
|
||||
ctxSum, cancel := context.WithTimeout(ctx, tout)
|
||||
defer cancel()
|
||||
summary, err := s.Summarizer.Summarize(ctxSum, channel, msgs, window)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue