PhilSad commited on
Commit
c6f7173
·
1 Parent(s): 1dcf466
Files changed (1) hide show
  1. app.py +12 -15
app.py CHANGED
@@ -31,18 +31,15 @@ async def proxy_mistral(request_data: Dict):
31
  print("attempting to sendc the request")
32
  print(request_data)
33
 
34
- try:
35
- # Send the request to the Mistral API
36
- async with httpx.AsyncClient() as client:
37
- response = await client.post(url, headers=headers, json=request_data)
38
- print("my response" , response)
39
-
40
- # Check the response status
41
- if response.status_code != 200:
42
- raise HTTPException(status_code=response.status_code, detail=response.text)
43
- print(response.json())
44
- # Return the Mistral API response
45
- return response.json()
46
-
47
- except Exception as e:
48
- raise HTTPException(status_code=500, detail=str(e))
 
31
  print("attempting to sendc the request")
32
  print(request_data)
33
 
34
+ # Send the request to the Mistral API
35
+ async with httpx.AsyncClient() as client:
36
+ response = await client.post(url, headers=headers, json=request_data)
37
+ print("my response" , response)
38
+
39
+ # Check the response status
40
+ if response.status_code != 200:
41
+ raise HTTPException(status_code=response.status_code, detail=response.text)
42
+ print(response.json())
43
+ # Return the Mistral API response
44
+ return response.json()
45
+