mirror of
https://gitea.toothfairyai.com/ToothFairyAI/tf_code.git
synced 2026-04-12 19:59:00 +00:00
core: improve session API reliability with proper input validation
This commit is contained in:
@@ -1031,7 +1031,11 @@ export namespace SessionPrompt {
|
||||
break
|
||||
|
||||
case "finish-step":
|
||||
const usage = Session.getUsage(input.model, value.usage, value.providerMetadata)
|
||||
const usage = Session.getUsage({
|
||||
model: input.model,
|
||||
usage: value.usage,
|
||||
metadata: value.providerMetadata,
|
||||
})
|
||||
assistantMsg.cost += usage.cost
|
||||
assistantMsg.tokens = usage.tokens
|
||||
await Session.updatePart({
|
||||
|
||||
Reference in New Issue
Block a user