ux(cards): place 🌝/🌚 and chevron inline with original link; collapse hides entire card; improve YouTube summarization path groundwork

This commit is contained in:
Thomas Cravey 2025-08-17 19:12:26 -05:00
parent 575622b45c
commit fed806bfc0
3 changed files with 37 additions and 44 deletions

View file

@ -197,7 +197,9 @@ func (o *OpenAI) SummarizeLink(ctx context.Context, rawURL string) (string, erro
}
text = strings.ReplaceAll(text, "\r", "")
text = strings.TrimSpace(text)
if len(text) > 6000 { text = text[:6000] }
if len(text) > 6000 {
text = text[:6000]
}
content = text
}
}()
@ -237,11 +239,17 @@ func (o *OpenAI) SummarizeLink(ctx context.Context, rawURL string) (string, erro
},
MaxCompletionTokens: o.maxTokens,
}
if !reasoningLike { req.Temperature = 0.2 }
if !reasoningLike {
req.Temperature = 0.2
}
resp, err := client.CreateChatCompletion(ctx, req)
if err != nil { return "", err }
if len(resp.Choices) == 0 { return "", nil }
if err != nil {
return "", err
}
if len(resp.Choices) == 0 {
return "", nil
}
return strings.TrimSpace(resp.Choices[0].Message.Content), nil
}

View file

@ -1,15 +1,13 @@
package summarizer
import (
"context"
"time"
"context"
"time"
"sojuboy/internal/store"
"sojuboy/internal/store"
)
type Summarizer interface {
Summarize(ctx context.Context, channel string, msgs []store.Message, window time.Duration) (string, error)
SummarizeLink(ctx context.Context, rawURL string) (string, error)
Summarize(ctx context.Context, channel string, msgs []store.Message, window time.Duration) (string, error)
SummarizeLink(ctx context.Context, rawURL string) (string, error)
}