refac
This commit is contained in:
@@ -2074,7 +2074,7 @@ async def process_web(
|
|||||||
):
|
):
|
||||||
config = await get_retrieval_config()
|
config = await get_retrieval_config()
|
||||||
try:
|
try:
|
||||||
content, docs = await run_in_threadpool(get_content_from_url, request, form_data.url)
|
content, docs = await get_content_from_url(request, form_data.url)
|
||||||
log.debug(f'text_content: {content}')
|
log.debug(f'text_content: {content}')
|
||||||
|
|
||||||
if process:
|
if process:
|
||||||
|
|||||||
@@ -264,7 +264,7 @@ async def fetch_url(
|
|||||||
return json.dumps({'error': 'Request context not available'})
|
return json.dumps({'error': 'Request context not available'})
|
||||||
|
|
||||||
try:
|
try:
|
||||||
content, _ = await asyncio.to_thread(get_content_from_url, __request__, url)
|
content, _ = await get_content_from_url(__request__, url)
|
||||||
|
|
||||||
# Truncate if configured (WEB_FETCH_MAX_CONTENT_LENGTH)
|
# Truncate if configured (WEB_FETCH_MAX_CONTENT_LENGTH)
|
||||||
# Guard: content may be None if the web loader silently failed
|
# Guard: content may be None if the web loader silently failed
|
||||||
|
|||||||
Reference in New Issue
Block a user