Feature: Add structured logging for each LLM-generated article summary
This commit is contained in:
parent
916e5f8610
commit
634cc45f3a
10
llm.go
10
llm.go
@ -106,6 +106,16 @@ func summarizeArticles(ollamaURL, ollamaModel string) {
|
||||
for id, result := range summaries {
|
||||
for _, article := range batch {
|
||||
if article.ID == id {
|
||||
// Log the summary details for each article
|
||||
logInfo("summary_result", "LLM generated summary", map[string]interface{}{
|
||||
"id": article.ID,
|
||||
"title": article.Title,
|
||||
"summary": result.Summary,
|
||||
"importance": result.Importance,
|
||||
"source": article.Source,
|
||||
"length": len(result.Summary),
|
||||
})
|
||||
|
||||
article.Summary = result.Summary
|
||||
article.Importance = result.Importance
|
||||
if err := updateArticle(article); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user