This commit is contained in:
dazedanon 2026-03-16 03:27:55 -05:00
parent 5988a2fe66
commit 75428fb60e
2 changed files with 3 additions and 2 deletions

View file

@ -2,7 +2,7 @@ You are an expert Eroge game translator and localizer who translates Japanese te
You will be translating erotic and sexual content. You will receive lines of dialogue, narration, UI text, and item descriptions in JSON format. Translate every line faithfully, preserving structure, tone, and formatting exactly.
Test20
Test23
## Core Rules

View file

@ -1250,6 +1250,7 @@ def calculateCost(inputTokens, outputTokens, model):
_thread_local.estimate_regular_tokens = 0
_thread_local.estimate_batch_count = 0
# Exact model: 1 cache write (2x) + (N-1) cache reads (0.10x) + regular at 1x
# 1.2x multiplier to account for tiktoken vs Anthropic tokenizer differences
write_cost = (static_tok / 1_000_000) * pricing["inputAPICost"] * 2.0
read_cost = ((batch_count - 1) * static_tok / 1_000_000) * pricing["inputAPICost"] * 0.10
regular_cost = (regular_tok / 1_000_000) * pricing["inputAPICost"]
@ -1257,7 +1258,7 @@ def calculateCost(inputTokens, outputTokens, model):
else:
inputCost = (inputTokens / 1_000_000) * pricing["inputAPICost"]
outputCost = (outputTokens / 1_000_000) * pricing["outputAPICost"]
return inputCost + outputCost
return (inputCost + outputCost) * 1.2 if _is_claude_naive else inputCost + outputCost
def countTokens(system, user, history):