Skip to content

Commit

Permalink
fix assembly pass through cost tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
ishaan-jaff committed Feb 7, 2025
1 parent 229f270 commit 7739be3
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ def _handle_assemblyai_passthrough_logging(
)
kwargs["model"] = model
kwargs["custom_llm_provider"] = "assemblyai"
logging_obj.model_call_details["model"] = model
logging_obj.model_call_details["custom_llm_provider"] = "assemblyai"
response_cost: Optional[float] = None

transcript_id = response_body.get("id")
if transcript_id is None:
Expand All @@ -116,7 +115,7 @@ def _handle_assemblyai_passthrough_logging(
speech_model=model,
transcript_response=transcript_response,
)
kwargs["response_cost"] = cost
response_cost = cost

# Make standard logging object for Vertex AI
standard_logging_object = get_standard_logging_object_payload(
Expand All @@ -141,6 +140,10 @@ def _handle_assemblyai_passthrough_logging(
verbose_proxy_logger.debug(
"standard_logging_object= %s", json.dumps(standard_logging_object, indent=4)
)
logging_obj.model_call_details["model"] = model
logging_obj.model_call_details["custom_llm_provider"] = "assemblyai"
logging_obj.model_call_details["response_cost"] = response_cost

asyncio.run(
pass_through_endpoint_logging._handle_logging(
logging_obj=logging_obj,
Expand Down

0 comments on commit 7739be3

Please sign in to comment.