mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
latency fix proxy (#7563)
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 13s
All checks were successful
Read Version from pyproject.toml / read-version (push) Successful in 13s
This commit is contained in:
parent
0d366c58a1
commit
2bf20ebfdf
1 changed files with 10 additions and 7 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import asyncio
|
||||||
import copy
|
import copy
|
||||||
import time
|
import time
|
||||||
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
from typing import TYPE_CHECKING, Any, Dict, Optional, Union
|
||||||
|
@ -616,7 +617,8 @@ async def add_litellm_data_to_request( # noqa: PLR0915
|
||||||
)
|
)
|
||||||
|
|
||||||
end_time = time.time()
|
end_time = time.time()
|
||||||
await service_logger_obj.async_service_success_hook(
|
asyncio.create_task(
|
||||||
|
service_logger_obj.async_service_success_hook(
|
||||||
service=ServiceTypes.PROXY_PRE_CALL,
|
service=ServiceTypes.PROXY_PRE_CALL,
|
||||||
duration=end_time - start_time,
|
duration=end_time - start_time,
|
||||||
call_type="add_litellm_data_to_request",
|
call_type="add_litellm_data_to_request",
|
||||||
|
@ -624,6 +626,7 @@ async def add_litellm_data_to_request( # noqa: PLR0915
|
||||||
end_time=end_time,
|
end_time=end_time,
|
||||||
parent_otel_span=user_api_key_dict.parent_otel_span,
|
parent_otel_span=user_api_key_dict.parent_otel_span,
|
||||||
)
|
)
|
||||||
|
)
|
||||||
return data
|
return data
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue