Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ async def ingest_file(
metadata: str = Form("{}"),
rules: str = Form("[]"),
auth: AuthContext = Depends(verify_token),
external_id: Optional[str] = Form(None),
use_colpali: Optional[bool] = None,
folder_name: Optional[str] = Form(None),
end_user_id: Optional[str] = Form(None),
Expand Down Expand Up @@ -421,6 +422,7 @@ def str2bool(v):
# Create a document with processing status
doc = Document(
content_type=file.content_type,
external_id=external_id if external_id else None,
filename=file.filename,
metadata=metadata_dict,
owner={"type": auth.entity_type.value, "id": auth.entity_id},
Expand Down
1 change: 1 addition & 0 deletions core/models/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class IngestTextRequest(BaseModel):
use_colpali: Optional[bool] = None
folder_name: Optional[str] = Field(None, description="Optional folder scope for the operation")
end_user_id: Optional[str] = Field(None, description="Optional end-user scope for the operation")
external_id: Optional[str] = None


class CreateGraphRequest(BaseModel):
Expand Down
3 changes: 3 additions & 0 deletions core/services/document_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ async def query(
async def ingest_text(
self,
content: str,
external_id=external_id if external_id else None,
filename: Optional[str] = None,
metadata: Optional[Dict[str, Any]] = None,
auth: AuthContext = None,
Expand All @@ -574,8 +575,10 @@ async def ingest_text(
settings = get_settings()

doc = Document(
external_id=external_id,
content_type="text/plain",
filename=filename,
content=content,
metadata=metadata or {},
owner={"type": auth.entity_type, "id": auth.entity_id},
access_control={
Expand Down