ibl-data-manager (3.59.0-ai-plus)
API for iblai
Request
Train a document through a worker process.
This endpoint queues larger documents for training through a worker process, which is more suitable for handling documents that would take too long to process directly.
Args: request: The HTTP request containing the document information. org: Organization key identifier.
Returns: Response: A confirmation that the document was queued for training, including a task ID for tracking the progress.
Raises: ValidationError: If the request data is invalid. BadRequest: If there was an error processing the document.
- multipart/form-data
- application/x-www-form-urlencoded
- application/json
The patterns that the crawler should use to match urls. Patterns may be a glob pattern or a full regex pattern. Indicate the specified type in crawler_use_glob_matching
.
- Mock server
https://docs.ibl.ai/_mock/apis/ibl/api/ai-index/orgs/{org}/users/{user_id}/documents/train/
https://base.manager.iblai.app/api/ai-index/orgs/{org}/users/{user_id}/documents/train/
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://docs.ibl.ai/_mock/apis/ibl/api/ai-index/orgs/{org}/users/{user_id}/documents/train/' \
-H 'Authorization: YOUR_API_KEY_HERE' \
-H 'Content-Type: multipart/form-data' \
-F pathway=string \
-F url=string \
-F text=string \
-F type=string \
-F translate=false \
-F file=string \
-F access=private \
-F branch=string \
-F google_drive_auth_data=null \
-F dropbox_auth_data=null \
-F crawler_max_depth=0 \
-F crawler_max_pages_limit=0 \
-F crawler_max_concurrency=0 \
-F crawler_match_patterns=string \
-F crawler_use_glob_matching=true
[ { "task_id": "4194d20c-37d5-4148-882f-f7d2d91f7769", "document_id": "doc-123456", "message": "Document received. Your request to train is queued" } ]
Request
Train a document directly without using a worker.
This endpoint is designed for training smaller documents directly without queuing them through a worker process. For larger documents, use the TrainDocumentView endpoint instead.
Args: request: The HTTP request containing the document information. org: Organization key identifier.
Returns: Response: A confirmation that the document was trained successfully.
Raises: ValidationError: If the request data is invalid. BadRequest: If the document training failed.
- multipart/form-data
- application/x-www-form-urlencoded
- application/json
- Mock server
https://docs.ibl.ai/_mock/apis/ibl/api/ai-index/orgs/{org}/users/{user_id}/documents/train/retriever/
https://base.manager.iblai.app/api/ai-index/orgs/{org}/users/{user_id}/documents/train/retriever/
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://docs.ibl.ai/_mock/apis/ibl/api/ai-index/orgs/{org}/users/{user_id}/documents/train/retriever/' \
-H 'Authorization: YOUR_API_KEY_HERE' \
-H 'Content-Type: multipart/form-data' \
-F pathway=string \
-F url=string
{ "detail": "Document trained successfully" }
Request
Description: Submit a document file in a chat session. Checks file type, size, and ensures the session exists, then processes the file. Process document for use in a specific chat session. which will be processed and made available for the AI to reference when responding to queries in that session.
Methods:
- POST: Submits a document or media file for training within a specified chat session.
Parameters:
- org (str):
- session_id (str): UUID of the chat session for which the document is being submitted.
- *args, **kwargs: Additional arguments.
- file (file): Multipart file input.
Returns:
- POST: Returns a JSON message with the result of the upload process. Response code 200 on success. { "message": "File processed." }
Error Responses:
- 400 Bad Request:
- "File field is required" if the 'file' parameter is missing.
- "invalid file object" if the file object is not valid.
- Specific error message if an exception occurs while saving to Redis.
- 404 Not Found:
- "Session not found" if the provided session_id does not match any existing session.
- 413 Request Entity Too Large:
- "file is too large" including specific limits for document and media files if the file exceeds size limits.
Access Control: Requires authentication with a Bearer token in the Authorization header. The user associated with the session must exist and be authorized for the request.
- multipart/form-data
- application/x-www-form-urlencoded
- application/json
- Mock server
https://docs.ibl.ai/_mock/apis/ibl/api/ai-index/orgs/{org}/users/{user_id}/documents/train/sessions/{session_id}/
https://base.manager.iblai.app/api/ai-index/orgs/{org}/users/{user_id}/documents/train/sessions/{session_id}/
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://docs.ibl.ai/_mock/apis/ibl/api/ai-index/orgs/{org}/users/{user_id}/documents/train/sessions/{session_id}/' \
-H 'Authorization: YOUR_API_KEY_HERE' \
-H 'Content-Type: multipart/form-data' \
-F file=string
{ "message": "File processed." }