Spaces:
Sleeping
Sleeping
Ilke Ileri
commited on
Commit
·
260002e
1
Parent(s):
7242003
Enhance request logging for better Vapi debugging
Browse files
app.py
CHANGED
|
@@ -58,8 +58,12 @@ def health_check():
|
|
| 58 |
@app.route("/chat/completions", methods=["POST", "OPTIONS"])
|
| 59 |
def chat_completions():
|
| 60 |
# Log incoming request
|
| 61 |
-
print(
|
|
|
|
| 62 |
print(f"Headers: {dict(request.headers)}")
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
# OPTIONS isteği için preflight response
|
| 65 |
if request.method == "OPTIONS":
|
|
|
|
| 58 |
@app.route("/chat/completions", methods=["POST", "OPTIONS"])
|
| 59 |
def chat_completions():
|
| 60 |
# Log incoming request
|
| 61 |
+
print("=" * 60)
|
| 62 |
+
print(f"NEW REQUEST: {request.method} from {request.remote_addr}")
|
| 63 |
print(f"Headers: {dict(request.headers)}")
|
| 64 |
+
if request.method == "POST":
|
| 65 |
+
print(f"Body: {request.get_data(as_text=True)[:200]}...")
|
| 66 |
+
print("=" * 60)
|
| 67 |
|
| 68 |
# OPTIONS isteği için preflight response
|
| 69 |
if request.method == "OPTIONS":
|