complete anthropic test

This commit is contained in:
Zishan
2025-02-18 14:54:09 +01:00
parent 5765dac764
commit b3c5fb4d47
5 changed files with 135 additions and 42 deletions
-3
View File
@@ -68,11 +68,9 @@ async def anthropic_proxy(
)
invariant_authorization = request.headers.get("invariant-authorization")
print("is stream:", request_body_json.get("stream"))
if request_body_json.get("stream"):
return await handle_streaming_response(client, anthropic_request, dataset_name, invariant_authorization)
else:
print("anthropic_request:", anthropic_request)
try:
response = await client.send(anthropic_request)
except httpx.HTTPStatusError as e:
@@ -80,7 +78,6 @@ async def anthropic_proxy(
status_code=response.status_code,
detail=f"Failed to fetch response: {response.text}, got error{e}",
)
print("response:", response.status_code)
await handle_non_streaming_response(
response, dataset_name, request_body_json, invariant_authorization
)
-1
View File
@@ -8,7 +8,6 @@ from invariant_sdk.types.push_traces import PushTracesRequest, PushTracesRespons
DEFAULT_API_URL = "https://explorer.invariantlabs.ai"
async def push_trace(
messages: List[List[Dict[str, Any]]],
dataset_name: str,