mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-07-06 10:57:50 +02:00
Revert "Add debug logs for metadata push."
This reverts commit f247682fa3.
This commit is contained in:
@@ -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],
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user