mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-05 12:23:28 +00:00
fix debug logging
This commit is contained in:
+3
-2
@@ -18,8 +18,9 @@ from litellm.types.utils import (
|
||||
)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..success_handler import PassThroughEndpointLogging
|
||||
from litellm.types.passthrough_endpoints.pass_through_endpoints import EndpointType
|
||||
|
||||
from ..success_handler import PassThroughEndpointLogging
|
||||
else:
|
||||
PassThroughEndpointLogging = Any
|
||||
EndpointType = Any
|
||||
@@ -193,7 +194,7 @@ class GeminiPassthroughLoggingHandler:
|
||||
kwargs["custom_llm_provider"] = custom_llm_provider
|
||||
|
||||
# pretty print standard logging object
|
||||
verbose_proxy_logger.debug("kwargs= %s", json.dumps(kwargs, indent=4))
|
||||
verbose_proxy_logger.debug("kwargs= %s", kwargs)
|
||||
|
||||
# set litellm_call_id to logging response object
|
||||
litellm_model_response.id = logging_obj.litellm_call_id
|
||||
|
||||
+12
-9
@@ -17,19 +17,20 @@ from litellm.llms.vertex_ai.vector_stores.search_api.transformation import (
|
||||
)
|
||||
from litellm.proxy._types import PassThroughEndpointLoggingTypedDict
|
||||
from litellm.types.utils import (
|
||||
Choices,
|
||||
EmbeddingResponse,
|
||||
ImageResponse,
|
||||
ModelResponse,
|
||||
SpecialEnums,
|
||||
StandardPassThroughResponseObject,
|
||||
TextCompletionResponse,
|
||||
Choices,
|
||||
)
|
||||
from litellm.types.utils import SpecialEnums
|
||||
|
||||
vertex_search_api_config = VertexSearchAPIVectorStoreConfig()
|
||||
if TYPE_CHECKING:
|
||||
from ..success_handler import PassThroughEndpointLogging
|
||||
from litellm.types.utils import LiteLLMBatch
|
||||
|
||||
from ..success_handler import PassThroughEndpointLogging
|
||||
else:
|
||||
PassThroughEndpointLogging = Any
|
||||
LiteLLMBatch = Any
|
||||
@@ -489,7 +490,7 @@ class VertexPassthroughLoggingHandler:
|
||||
kwargs["model"] = model
|
||||
|
||||
# pretty print standard logging object
|
||||
verbose_proxy_logger.debug("kwargs= %s", json.dumps(kwargs, indent=4))
|
||||
verbose_proxy_logger.debug("kwargs= %s", kwargs)
|
||||
|
||||
# set litellm_call_id to logging response object
|
||||
litellm_model_response.id = logging_obj.litellm_call_id
|
||||
@@ -513,10 +514,13 @@ class VertexPassthroughLoggingHandler:
|
||||
Handle batch prediction jobs passthrough logging.
|
||||
Creates a managed object for cost tracking when batch job is successfully created.
|
||||
"""
|
||||
from litellm.llms.vertex_ai.batches.transformation import VertexAIBatchTransformation
|
||||
from litellm._uuid import uuid
|
||||
import base64
|
||||
|
||||
from litellm._uuid import uuid
|
||||
from litellm.llms.vertex_ai.batches.transformation import (
|
||||
VertexAIBatchTransformation,
|
||||
)
|
||||
|
||||
try:
|
||||
_json_response = httpx_response.json()
|
||||
|
||||
@@ -676,8 +680,7 @@ class VertexPassthroughLoggingHandler:
|
||||
managed_files_hook = proxy_logging_obj.get_proxy_hook("managed_files")
|
||||
if managed_files_hook is not None and hasattr(managed_files_hook, 'store_unified_object_id'):
|
||||
# Create a mock user API key dict for the managed object storage
|
||||
from litellm.proxy._types import UserAPIKeyAuth
|
||||
from litellm.proxy._types import LitellmUserRoles
|
||||
from litellm.proxy._types import LitellmUserRoles, UserAPIKeyAuth
|
||||
user_api_key_dict = UserAPIKeyAuth(
|
||||
user_id=kwargs.get("user_id", "default-user"),
|
||||
api_key="",
|
||||
@@ -704,7 +707,7 @@ class VertexPassthroughLoggingHandler:
|
||||
# Store the unified object for batch cost tracking
|
||||
import asyncio
|
||||
asyncio.create_task(
|
||||
managed_files_hook.store_unified_object_id(
|
||||
managed_files_hook.store_unified_object_id( # type: ignore
|
||||
unified_object_id=unified_object_id,
|
||||
file_object=batch_object,
|
||||
litellm_parent_otel_span=None,
|
||||
|
||||
Reference in New Issue
Block a user