mirror of
https://github.com/thegeneralist01/archivr
synced 2026-10-09 21:03:17 +02:00
feat: model opt-in summary images
This commit is contained in:
parent
6c6de347d1
commit
3a6de87e10
2 changed files with 331 additions and 6 deletions
|
|
@ -585,7 +585,11 @@ async fn request_entry_summary_handler(
|
|||
|
||||
// 2. Extract the same content the summarizer will feed the model, so the
|
||||
// digest below is the identical cache key summarize_entry will compute.
|
||||
let input = summarizer::build_summary_input(&archive_paths, &entry_uid)
|
||||
let input = summarizer::build_summary_input(
|
||||
&archive_paths,
|
||||
&entry_uid,
|
||||
summarizer::SummaryBuildOptions::default(),
|
||||
)
|
||||
.map_err(|e| ApiError::bad_request(&format!("{e:#}")))?;
|
||||
|
||||
// 3. Cache hit: identical entry + provider + model + prompt + input.
|
||||
|
|
@ -630,7 +634,13 @@ async fn request_entry_summary_handler(
|
|||
// upsert above and the one inside it resolve to one row). We only have
|
||||
// to catch the case where it fails before it can record anything.
|
||||
if let Err(e) =
|
||||
summarizer::summarize_entry(&archive_paths, &entry_uid_bg, provider.as_ref(), summarizer::PROMPT_VERSION)
|
||||
summarizer::summarize_entry(
|
||||
&archive_paths,
|
||||
&entry_uid_bg,
|
||||
summarizer::SummaryBuildOptions::default(),
|
||||
provider.as_ref(),
|
||||
summarizer::PROMPT_VERSION,
|
||||
)
|
||||
{
|
||||
eprintln!("warn: summary {summary_uid_bg}: {e:#}");
|
||||
if let Ok(conn) = database::open_or_initialize(&archive_path) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue