This commit is contained in:
Timothy Jaeryang Baek
2026-01-06 01:53:00 +04:00
parent 119fc21257
commit 619f260466

View File

@@ -9,6 +9,7 @@ IMPORTANT: DO NOT IMPORT THIS MODULE DIRECTLY IN OTHER PARTS OF THE CODEBASE.
import json
import logging
import time
import asyncio
from typing import Optional
from fastapi import Request
@@ -190,7 +191,7 @@ async def fetch_url(
return json.dumps({"error": "Request context not available"})
try:
content, _ = get_content_from_url(__request__, url)
content, _ = await asyncio.to_thread(get_content_from_url, __request__, url)
# Truncate if too long (avoid overwhelming context)
max_length = 50000