From 8191c83c12b60d7be0528c6194902c773255d37f Mon Sep 17 00:00:00 2001 From: Hemang Date: Wed, 26 Mar 2025 19:57:00 +0100 Subject: [PATCH] Revert "Add debug logs for metadata push." This reverts commit f247682fa349e551d5052337855801927ef72a26. --- gateway/integrations/explorer.py | 3 --- gateway/routes/anthropic.py | 3 --- gateway/routes/gemini.py | 3 --- 3 files changed, 9 deletions(-) diff --git a/gateway/integrations/explorer.py b/gateway/integrations/explorer.py index 7ea264a..ed4098d 100644 --- a/gateway/integrations/explorer.py +++ b/gateway/integrations/explorer.py @@ -59,9 +59,6 @@ async def push_trace( dataset=dataset_name, metadata=metadata, ) - print( - "[DEBUG] Pushing trace to Invariant Explorer: ", request.to_json(), flush=True - ) client = AsyncClient( api_url=os.getenv("INVARIANT_API_URL", DEFAULT_API_URL).rstrip("/"), api_key=invariant_authorization.split("Bearer ")[1], diff --git a/gateway/routes/anthropic.py b/gateway/routes/anthropic.py index 672285a..01004c6 100644 --- a/gateway/routes/anthropic.py +++ b/gateway/routes/anthropic.py @@ -93,13 +93,10 @@ def create_metadata( context: RequestContextData, response_json: dict[str, Any] ) -> dict[str, Any]: """Creates metadata for the trace""" - print("[DEBUG] Anthropic Request JSON: ", context.request_json, flush=True) - print("[DEBUG] Anthropic Response JSON: ", response_json, flush=True) metadata = {k: v for k, v in context.request_json.items() if k != "messages"} metadata["via_gateway"] = True if response_json.get("usage"): metadata["usage"] = response_json.get("usage") - print("[DEBUG] Anthropic Metadata: ", metadata, flush=True) return metadata diff --git a/gateway/routes/gemini.py b/gateway/routes/gemini.py index 97d37be..905f14f 100644 --- a/gateway/routes/gemini.py +++ b/gateway/routes/gemini.py @@ -193,8 +193,6 @@ def create_metadata( context: RequestContextData, response_json: dict[str, Any] ) -> dict[str, Any]: """Creates metadata for the trace""" - print("[DEBUG] Gemimini Request JSON: ", context.request_json, flush=True) - print("[DEBUG] Gemini Response JSON: ", response_json, flush=True) metadata = { k: v for k, v in context.request_json.items() @@ -208,7 +206,6 @@ def create_metadata( if key in ("usageMetadata", "modelVersion") } ) - print("[DEBUG] Gemini Metadata: ", metadata, flush=True) return metadata