mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
fix: add cost calculation to VolcEngine transform_get_response_api_response
Greptile P1 issue: VolcEngineResponsesAPIConfig.transform_get_response_api_response was missing cost calculation, causing all GET-response calls to report $0 cost. Added _calculate_response_cost call with model extraction from response JSON or logging_obj, matching the pattern used in Manus provider. Fixes lines 362-380 issue raised in PR review. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
9733797655
commit
3b5f467192
1 changed files with 7 additions and 0 deletions
|
|
@ -377,6 +377,13 @@ class VolcEngineResponsesAPIConfig(OpenAIResponsesAPIConfig):
|
|||
response = ResponsesAPIResponse(**raw_response_json)
|
||||
response._hidden_params["additional_headers"] = processed_headers
|
||||
response._hidden_params["headers"] = raw_response_headers
|
||||
|
||||
# Calculate costs from usage data (fixes P1 issue - VolcEngine GET-response)
|
||||
usage_dict = raw_response_json.get("usage", {})
|
||||
model = raw_response_json.get("model") or getattr(logging_obj, "model", None)
|
||||
if model:
|
||||
self._calculate_response_cost(model, usage_dict, response)
|
||||
|
||||
return response
|
||||
|
||||
#########################################################
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue