diff --git a/prompt.txt b/prompt.txt index 29f2bbd..2cb7363 100644 --- a/prompt.txt +++ b/prompt.txt @@ -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 diff --git a/util/translation.py b/util/translation.py index 42ef947..01bce08 100644 --- a/util/translation.py +++ b/util/translation.py @@ -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):