mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-08-16 14:00:20 +02:00
complete anthropic test
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user