Spaces:
Sleeping
Sleeping
Commit
·
2b656f3
1
Parent(s):
201f912
bug fix
Browse files
main.py
CHANGED
|
@@ -232,7 +232,9 @@ async def stream_notion_response(notion_request_body: NotionRequestBody):
|
|
| 232 |
|
| 233 |
try:
|
| 234 |
async with httpx.AsyncClient(timeout=None) as client: # No timeout for streaming
|
| 235 |
-
|
|
|
|
|
|
|
| 236 |
if response.status_code != 200:
|
| 237 |
error_content = await response.aread()
|
| 238 |
print(f"Error from Notion API: {response.status_code}")
|
|
|
|
| 232 |
|
| 233 |
try:
|
| 234 |
async with httpx.AsyncClient(timeout=None) as client: # No timeout for streaming
|
| 235 |
+
# Explicitly serialize using .json() to respect Pydantic Config (like json_encoders for UUID)
|
| 236 |
+
request_body_json = notion_request_body.json()
|
| 237 |
+
async with client.stream("POST", NOTION_API_URL, content=request_body_json, headers=headers) as response:
|
| 238 |
if response.status_code != 200:
|
| 239 |
error_content = await response.aread()
|
| 240 |
print(f"Error from Notion API: {response.status_code}")
|