feedsummary-core 1.2.1__tar.gz → 1.2.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. {feedsummary_core-1.2.1/src/feedsummary_core.egg-info → feedsummary_core-1.2.2}/PKG-INFO +1 -1
  2. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/_version.py +3 -3
  3. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/llm_client/__init__.py +3 -1
  4. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/persistence/SqliteStore.py +2 -3
  5. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/persistence/TinyDbStore.py +2 -3
  6. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/persistence/__init__.py +2 -1
  7. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/persistence/helpers.py +1 -1
  8. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/summarizer/helpers.py +4 -19
  9. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/summarizer/summarizer.py +6 -2
  10. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2/src/feedsummary_core.egg-info}/PKG-INFO +1 -1
  11. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/.github/workflows/release.yaml +0 -0
  12. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/.gitignore +0 -0
  13. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/LICENSE +0 -0
  14. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/README.md +0 -0
  15. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/pyproject.toml +0 -0
  16. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/setup.cfg +0 -0
  17. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/__init__.py +0 -0
  18. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/llm_client/fallback_client.py +0 -0
  19. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/llm_client/ollama_cloud.py +0 -0
  20. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/llm_client/ollama_local.py +0 -0
  21. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/persistence/CleanUpPolicy.py +0 -0
  22. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/summarizer/__init__.py +0 -0
  23. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/summarizer/batching.py +0 -0
  24. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/summarizer/chat.py +0 -0
  25. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/summarizer/ingest.py +0 -0
  26. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/summarizer/main.py +0 -0
  27. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/summarizer/prompt_lab.py +0 -0
  28. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/summarizer/prompt_replay.py +0 -0
  29. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core/summarizer/token_budget.py +0 -0
  30. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core.egg-info/SOURCES.txt +0 -0
  31. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core.egg-info/dependency_links.txt +0 -0
  32. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core.egg-info/requires.txt +0 -0
  33. {feedsummary_core-1.2.1 → feedsummary_core-1.2.2}/src/feedsummary_core.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: feedsummary-core
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: Core library for FeedSummary.
5
5
  Author: Martin Vesterlund
6
6
  License-Expression: BSD-3-Clause
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '1.2.1'
32
- __version_tuple__ = version_tuple = (1, 2, 1)
31
+ __version__ = version = '1.2.2'
32
+ __version_tuple__ = version_tuple = (1, 2, 2)
33
33
 
34
- __commit_id__ = commit_id = 'g85db4b80b'
34
+ __commit_id__ = commit_id = 'g167cefb54'
@@ -35,11 +35,13 @@ from feedsummary_core.llm_client.fallback_client import FallbackLLMClient, Fallb
35
35
 
36
36
  from typing import Any, Dict, List, Optional, Protocol
37
37
 
38
+
38
39
  class LLMRateLimitError(RuntimeError):
39
40
  def __init__(self, message: str, retry_after_seconds: Optional[int] = None):
40
41
  super().__init__(message)
41
42
  self.retry_after_seconds = retry_after_seconds
42
-
43
+
44
+
43
45
  class LLMError(Exception):
44
46
  pass
45
47
 
@@ -41,6 +41,7 @@ from typing import Any, Dict, List, Optional
41
41
 
42
42
  from feedsummary_core.persistence import CleanupPolicy
43
43
  from feedsummary_core.persistence.helpers import classify_summary_doc
44
+
44
45
  logger = logging.getLogger(__name__)
45
46
 
46
47
 
@@ -754,9 +755,7 @@ class SqliteStore:
754
755
  f"DELETE FROM summary_docs WHERE id IN ({placeholders})",
755
756
  tuple(part),
756
757
  )
757
- removed["summary_docs"] += (
758
- cur.rowcount if cur.rowcount is not None else 0
759
- )
758
+ removed["summary_docs"] += cur.rowcount if cur.rowcount is not None else 0
760
759
 
761
760
  con.commit()
762
761
  return removed
@@ -292,6 +292,7 @@ class TinyDBStore:
292
292
  rows = t.search(T.job_id == int(job_id))
293
293
  db.close()
294
294
  return rows[0] if rows else None
295
+
295
296
  def run_cleanup(self, pol: CleanupPolicy) -> Dict[str, int]:
296
297
  """
297
298
  Cleanup for TinyDB schema:
@@ -316,9 +317,7 @@ class TinyDBStore:
316
317
  # remove uses a predicate for each row
317
318
  before = len(at)
318
319
  at.remove(
319
- lambda r: (
320
- int(r.get("published_ts") or r.get("fetched_at") or 0) < cut_articles
321
- )
320
+ lambda r: int(r.get("published_ts") or r.get("fetched_at") or 0) < cut_articles
322
321
  )
323
322
  removed["articles"] = max(0, before - len(at))
324
323
 
@@ -32,7 +32,6 @@
32
32
 
33
33
  from __future__ import annotations
34
34
 
35
- from dataclasses import dataclass
36
35
  import os
37
36
  from pathlib import Path
38
37
  from typing import Any, Dict, List, Optional, Protocol
@@ -44,6 +43,7 @@ from feedsummary_core.persistence.SqliteStore import SqliteStore
44
43
  class StoreError(Exception):
45
44
  pass
46
45
 
46
+
47
47
  class NewsStore(Protocol):
48
48
  def get_article(self, article_id: str) -> Optional[Dict[str, Any]]: ...
49
49
 
@@ -89,6 +89,7 @@ class NewsStore(Protocol):
89
89
 
90
90
  def run_cleanup(self, pol: CleanupPolicy) -> Dict[str, int]: ...
91
91
 
92
+
92
93
  def _expand_path(p: str) -> str:
93
94
  expanded = os.path.expandvars(os.path.expanduser(p))
94
95
  return str(Path(expanded).resolve())
@@ -21,4 +21,4 @@ def classify_summary_doc(doc_json: str) -> str:
21
21
  return "weekly"
22
22
  if "daily" in pkg:
23
23
  return "daily"
24
- return "other"
24
+ return "other"
@@ -302,25 +302,6 @@ def entry_published_ts(entry: feedparser.FeedParserDict) -> Optional[int]:
302
302
  # Prompt loader (from config)
303
303
  # ----------------------------
304
304
  def load_prompts(config: Dict[str, Any], package: Optional[str] = None) -> Dict[str, str]:
305
- """
306
- 1) NYTT: läsa promptpaket från config/prompts.yaml
307
- config.yaml:
308
- prompts:
309
- path: "config/prompts.yaml"
310
- default_package: "standard_sv"
311
- selected: "" (kan sättas av webappen)
312
- 2) BAKÅTKOMP: om config["prompts"] redan innehåller batch_system/meta_system etc,
313
- använd det direkt.
314
-
315
- Viktigt:
316
- - Vi returnerar alltid basnycklarna.
317
- - Vi tar även med valfria nycklar om de finns i paketet:
318
- super_meta_system
319
- super_meta_user_template
320
- title_system
321
- title_user_template
322
- """
323
-
324
305
  p_cfg = config.get("prompts") or {}
325
306
 
326
307
  base_keys = (
@@ -334,6 +315,10 @@ def load_prompts(config: Dict[str, Any], package: Optional[str] = None) -> Dict[
334
315
  "super_meta_user_template",
335
316
  "title_system",
336
317
  "title_user_template",
318
+ "proofread_system",
319
+ "proofread_user_template",
320
+ "revise_system",
321
+ "revise_user_template",
337
322
  )
338
323
 
339
324
  # Backward compat: prompts directly embedded in config.yaml
@@ -251,6 +251,7 @@ async def _generate_summary_title(
251
251
  title = title[:120].rstrip() + "…"
252
252
  return title
253
253
 
254
+
254
255
  def _budgeted_proofread_user(
255
256
  *,
256
257
  prompts: Dict[str, Any],
@@ -403,7 +404,9 @@ async def _proofread_and_revise_meta_with_stats(
403
404
  if not t:
404
405
  continue
405
406
  desk_parts.append(f"--- BATCH {idx} ---\n{t}")
406
- desk_underlag = ("\n\n".join(desk_parts).strip() + "\n\n--- KÄLLOR (lista) ---\n" + (sources_text or "")).strip()
407
+ desk_underlag = (
408
+ "\n\n".join(desk_parts).strip() + "\n\n--- KÄLLOR (lista) ---\n" + (sources_text or "")
409
+ ).strip()
407
410
 
408
411
  text = (meta_text or "").strip()
409
412
  last_feedback = ""
@@ -462,6 +465,7 @@ async def _proofread_and_revise_meta_with_stats(
462
465
  "proofread_last_feedback": clip_text(last_feedback, 1200),
463
466
  }
464
467
 
468
+
465
469
  def _budgeted_super_meta_user(
466
470
  *,
467
471
  prompts: Dict[str, Any],
@@ -973,7 +977,7 @@ async def summarize_batches_then_meta_with_stats(
973
977
  meta_text=meta,
974
978
  batch_summaries=batch_summaries,
975
979
  sources_text=sources_text,
976
- max_rounds=4,
980
+ max_rounds=4,
977
981
  )
978
982
  # checkpoint meta-result
979
983
  if cp_enabled and meta_path is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: feedsummary-core
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: Core library for FeedSummary.
5
5
  Author: Martin Vesterlund
6
6
  License-Expression: BSD-3-Clause