25 lines
595 B
Python
25 lines
595 B
Python
from __future__ import annotations
|
|
|
|
from collections.abc import Sequence
|
|
|
|
from journal.ai import analysis
|
|
from journal.core.models import JournalEntry
|
|
|
|
|
|
def ai_health() -> dict[str, object]:
|
|
backend = analysis.get_nlp_backend()
|
|
return {
|
|
"provider": "python-local",
|
|
"enabled": True,
|
|
"healthy": True,
|
|
"message": f"ok ({backend})",
|
|
}
|
|
|
|
|
|
def summarize_entry(entry: JournalEntry) -> str:
|
|
return analysis.summarize_entry(entry)
|
|
|
|
|
|
def summarize_all_entries(entries: Sequence[JournalEntry]) -> str:
|
|
return analysis.summarize_all_entries(list(entries))
|