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:
@@ -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(),
|
||||
)),
|
||||
|
||||
Reference in New Issue
Block a user