We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8f12f49 commit 0b31416Copy full SHA for 0b31416
1 file changed
content-gen/src/backend/app.py
@@ -81,13 +81,10 @@ async def set_conversation_context():
81
82
# 1. Extract from JSON body (POST requests)
83
if request.content_type and "json" in request.content_type:
84
- try:
85
- data = await request.get_json()
86
- if data and isinstance(data, dict):
87
- conversation_id = data.get("conversation_id", "")
88
- user_id = data.get("user_id", "")
89
- except Exception:
90
- pass
+ data = await request.get_json(silent=True)
+ if data and isinstance(data, dict):
+ conversation_id = data.get("conversation_id", "")
+ user_id = data.get("user_id", "")
91
92
# 2. Extract from URL path parameters (e.g. /api/conversations/<conversation_id>)
93
if not conversation_id and request.view_args:
0 commit comments