Merge branch 'ingestion-flow' into fix-create-task-service

This commit is contained in:
Edwin Jose 2025-09-09 00:28:53 -04:00 committed by GitHub
commit 28f9bfc820
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 10 additions and 6 deletions

View file

@ -1,6 +1,6 @@
[project]
name = "openrag"
version = "0.1.1"
version = "0.1.2"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.13"

View file

@ -66,6 +66,7 @@ async def connector_sync(request: Request, connector_service, session_manager):
max_files,
jwt_token=jwt_token,
)
task_ids.append(task_id)
return JSONResponse(
{
"task_ids": task_ids,

View file

@ -400,8 +400,9 @@ class GoogleDriveConnector(BaseConnector):
export_mime = self._pick_export_mime(mime_type)
if mime_type.startswith("application/vnd.google-apps."):
# default fallback if not overridden
if not export_mime:
export_mime = "application/pdf"
#if not export_mime:
# export_mime = "application/pdf"
export_mime = "application/pdf"
# NOTE: export_media does not accept supportsAllDrives/includeItemsFromAllDrives
request = self.service.files().export_media(fileId=file_id, mimeType=export_mime)
else:

View file

@ -53,9 +53,11 @@ class LangflowConnectorService:
filename=document.filename,
)
suffix = self._get_file_extension(document.mimetype)
# Create temporary file from document content
with tempfile.NamedTemporaryFile(
delete=False, suffix=self._get_file_extension(document.mimetype)
delete=False, suffix=suffix
) as tmp_file:
tmp_file.write(document.content)
tmp_file.flush()
@ -65,7 +67,7 @@ class LangflowConnectorService:
logger.debug("Uploading file to Langflow", filename=document.filename)
content = document.content
file_tuple = (
document.filename,
document.filename.replace(" ", "_").replace("/", "_")+suffix,
content,
document.mimetype or "application/octet-stream",
)

View file

@ -33,7 +33,7 @@ class LangflowFileService:
"[LF] Upload failed",
status_code=resp.status_code,
reason=resp.reason_phrase,
body=resp.text[:500],
body=resp.text,
)
resp.raise_for_status()
return resp.json()