feat: return normalized token usage from one-shot AI calls (closes #15)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-18 23:15:04 +02:00
parent 97fd213817
commit 33929fd04b
4 changed files with 132 additions and 26 deletions

View File

@@ -293,7 +293,7 @@ fn translate_post_ai(
}),
},
)? {
OneShotResponse::Translation(result) => Ok(result),
(OneShotResponse::Translation(result), _usage) => Ok(result),
_ => Err(EngineError::Parse(
"unexpected post translation response".into(),
)),
@@ -320,7 +320,7 @@ fn translate_media_ai(
}),
},
)? {
OneShotResponse::MediaTranslation(result) => Ok(result),
(OneShotResponse::MediaTranslation(result), _usage) => Ok(result),
_ => Err(EngineError::Parse(
"unexpected media translation response".into(),
)),