1
This commit is contained in:
@@ -17,6 +17,7 @@ from app.models.token_usage import TokenUsage
|
||||
from app.services.generation_log_service import log_provider_call
|
||||
from app.services.provider_limit import provider_limit
|
||||
from app.utils.id_gen import generate_id
|
||||
from app.services.model_pricing.usage_normalizer import normalize_text_pricing_usage
|
||||
|
||||
|
||||
def _absolute_url(url: str) -> str:
|
||||
@@ -180,7 +181,7 @@ async def build_prompt_with_chatapi(db: AsyncSession, record: ChatGenerationTask
|
||||
completion_tokens=output_tokens,
|
||||
total_tokens=total_tokens,
|
||||
)
|
||||
return content, {
|
||||
return content, normalize_text_pricing_usage(usage, base={
|
||||
"token_usage_id": token_usage_id,
|
||||
"model_config_id": config.id,
|
||||
"model_config_name": config.name,
|
||||
@@ -189,4 +190,4 @@ async def build_prompt_with_chatapi(db: AsyncSession, record: ChatGenerationTask
|
||||
"input_tokens": input_tokens,
|
||||
"output_tokens": output_tokens,
|
||||
"total_tokens": total_tokens,
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user