Download OpenAPI specification:Download
Extensible API and framework to build your Retrieval Augmented Generation (RAG) and Information Extraction (IE) applications with LLMs
POST /collections endpoint
content-type required | string (Content-Type) |
name required | string (Name) |
cmetadata required | object (Cmetadata) |
{- "name": "string",
- "cmetadata": { }
}
null
PATCH /collections endpoint
uuid required | string (Uuid) |
content-type required | string (Content-Type) |
name required | string (Name) |
cmetadata required | object (Cmetadata) |
{- "name": "string",
- "cmetadata": { }
}
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Add single document to collection index
content-type required | string (Content-Type) |
content required | string (Content) |
collection_id required | string (Collection Id) |
document_id required | string (Document Id) |
metadata | object (Metadata) Default: {} |
{- "content": "string",
- "collection_id": "string",
- "document_id": "string",
- "metadata": { }
}
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Upload a PDF file and perform index on a collection
file required | string <binary> (File) |
collection_id required | string (Collection Id) |
document_id required | string (Document Id) |
Metadata (string) or Metadata (null) (Metadata) | |
Options (string) or Options (null) (Options) |
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
Add a web page content to a collection index
link required | string (Link) |
collection_id required | string (Collection Id) |
document_id required | string (Document Id) |
metadata | object (Metadata) Default: {} |
options | object (Options) Default: {} |
{- "link": "string",
- "collection_id": "string",
- "document_id": "string",
- "metadata": { },
- "options": { }
}
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
/search endpoint: Search the first {docs_num} relevant documents for a question
Specify distance_strategy: EUCLIDEAN = EmbeddingStore.embedding.l2_distance (default) COSINE = EmbeddingStore.embedding.cosine_distance MAX_INNER_PRODUCT = EmbeddingStore.embedding.max_inner_product
content-type required | string (Content-Type) |
query required | string (Query) |
collection required | string (Collection) |
Docs Num (integer) or Docs Num (null) (Docs Num) | |
distance_strategy_name | string (Distance Strategy Name) Default: "cosine" |
Filter (object) or Filter (null) (Filter) |
{- "query": "string",
- "collection": "string",
- "docs_num": 0,
- "distance_strategy_name": "cosine",
- "filter": {
- "property1": "string",
- "property2": "string"
}
}
null
/chat_history endpoint, read stored chat history
Min Date (string) or Min Date (null) (Min Date) | |
Max Date (string) or Max Date (null) (Max Date) | |
Collection (string) or Collection (null) (Collection) | |
Session Id (string) or Session Id (null) (Session Id) | |
page | integer (Page) Default: 1 |
page_size | integer (Page Size) Default: 50 |
null
/chat_history sessions endpoint, read stored chat history sessions
Min Date (string) or Min Date (null) (Min Date) | |
Max Date (string) or Max Date (null) (Max Date) | |
Collection (string) or Collection (null) (Collection) | |
Session Id (string) or Session Id (null) (Session Id) | |
page | integer (Page) Default: 1 |
page_size | integer (Page Size) Default: 50 |
null
/evaluate endpoint, save chat history item user evaluation
content-type required | string (Content-Type) |
uuid required | string (Uuid) |
user_evaluation required | boolean (User Evaluation) |
User Feedback (string) or User Feedback (null) (User Feedback) | |
Metadata (object) or Metadata (null) (Metadata) |
{- "uuid": "string",
- "user_evaluation": true,
- "user_feedback": "string",
- "metadata": { }
}
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
/chat endpoint, ask chatbot about a collection of documents
X-Chat-Session (string) or X-Chat-Session (null) (X-Chat-Session) | |
content-type required | string (Content-Type) |
Docs Num (integer) or Docs Num (null) (Docs Num) | |
streaming | boolean (Streaming) Default: false |
Distance Strategy Name (string) or Distance Strategy Name (null) (Distance Strategy Name) | |
Filter (object) or Filter (null) (Filter) | |
source_docs | boolean (Source Docs) Default: false |
multiquery | boolean (Multiquery) Default: false |
question required | string (Question) |
collection required | string (Collection) |
chat_history | Array of any (Chat History) Default: [] |
Chat Lang (string) or Chat Lang (null) (Chat Lang) | |
token_data | boolean (Token Data) Default: false |
{- "docs_num": 0,
- "streaming": false,
- "distance_strategy_name": "string",
- "filter": {
- "property1": "string",
- "property2": "string"
}, - "source_docs": false,
- "multiquery": false,
- "question": "string",
- "collection": "string",
- "chat_history": [ ],
- "chat_lang": "string",
- "token_data": false
}
null
/chat endpoint, ask chatbot about a collection of documents
X-Chat-Session (string) or X-Chat-Session (null) (X-Chat-Session) | |
content-type required | string (Content-Type) |
Docs Num (integer) or Docs Num (null) (Docs Num) | |
streaming | boolean (Streaming) Default: false |
Distance Strategy Name (string) or Distance Strategy Name (null) (Distance Strategy Name) | |
Filter (object) or Filter (null) (Filter) | |
source_docs | boolean (Source Docs) Default: false |
multiquery | boolean (Multiquery) Default: false |
question required | string (Question) |
collection required | string (Collection) |
chat_history | Array of any (Chat History) Default: [] |
Chat Lang (string) or Chat Lang (null) (Chat Lang) | |
token_data | boolean (Token Data) Default: false |
{- "docs_num": 0,
- "streaming": false,
- "distance_strategy_name": "string",
- "filter": {
- "property1": "string",
- "property2": "string"
}, - "source_docs": false,
- "multiquery": false,
- "question": "string",
- "collection": "string",
- "chat_history": [ ],
- "chat_lang": "string",
- "token_data": false
}
null
/summarize endpoint: Summarize text and return a summary with algorithm selection and custom prompt options.
Args: summarize (SummarizeBody): An object representing the request data It contains the following parameters: text (str): The text to be summarized chain_type: The main langchain summarization chain type should be one of "stuff", "map_reduce", and "refine". if not providerd stuff is used by default initial_prompt: Optional custom prompt to be used in the selected langchain chain type to replace the main chain prompt defaults iteration_prompt: Optional custom prompts to be used in the selected langchain chain type to replace the second chain promopt defaults token_data (bool): A boolean indicating whether to include token-level data in the summary
Returns: JSON object representing the summary of the provided text
Raises: - HTTPException with status code 400 if the 'text' field is empty
With this endpoint, you can choose the summarization algorithm from those available in the Langchain library and customize the prompts according on the chosen algorithm
content-type required | string (Content-Type) |
text required | string (Text) |
Chain Type (string) or Chain Type (null) (Chain Type) | |
Initial Prompt (object) or Initial Prompt (null) (Initial Prompt) | |
Iteration Prompt (object) or Iteration Prompt (null) (Iteration Prompt) | |
token_data | boolean (Token Data) Default: false |
{- "text": "string",
- "chain_type": "string",
- "initial_prompt": { },
- "iteration_prompt": { },
- "token_data": false
}
null
Upload a PDF file and perform summarization with algorithm selection and custom prompt options.
Args: background_tasks (BackgroundTasks): A background task manager for handling asynchronous tasks chain_type (str, optional): The main Langchain summarization chain type Should be one of "stuff", "map_reduce", or "refine" If not provided, 'stuff' is used by default initial_prompt (str, optional): Optional custom prompt as json string to be used in the selected Langchain chain type to replace the main chain prompt defaults iteration_prompt (str, optional): Optional custom prompt as json string to be used in the selected Langchain chain type to replace the second chain prompt defaults file (UploadFile | None): An uploaded PDF file to be summarized file_content (str, optional): Content of the PDF file provided as a base64-encoded string token_data (bool, optional): A boolean indicating whether to include token-level data in the summary payload (str, optional): Optional payload in JSON format to use in the async job service to add custom options and custom fields
Returns: A JSON object representing the job UUID for the asynchronous summarization task
Raises: HTTPException with status code 400 if either 'file' or 'file_content' form field is missing
With this endpoint, you can upload a PDF file for summarization, select a summarization algorithm from those available in the Langchain library, and customize the prompts according to your chosen algorithm
chain_type | string (Chain Type) Default: "" |
initial_prompt | string (Initial Prompt) Default: "" |
iteration_prompt | string (Iteration Prompt) Default: "" |
File (string) or File (null) (File) | |
file_content | string (File Content) Default: "" |
token_data | boolean (Token Data) Default: false |
payload | string (Payload) Default: "{}" |
null
Update metadata of a single document in a collection
content-type required | string (Content-Type) |
collection_id required | string (Collection Id) |
document_id required | string (Document Id) |
metadata | object (Metadata) Default: {} |
{- "collection_id": "string",
- "document_id": "string",
- "metadata": { }
}
{- "detail": [
- {
- "loc": [
- "string"
], - "msg": "string",
- "type": "string"
}
]
}
/completion endpoint, send a text with a custom prompt and get a completion
content-type required | string (Content-Type) |
Prompt (object) or Prompt (null) (Prompt) | |
text required | string (Text) |
token_data | boolean (Token Data) Default: false |
{- "prompt": { },
- "text": "string",
- "token_data": false
}
null
POST /config endpoint, save Brevia configuration
content-type required | string (Content-Type) |
{ }
null
POST /config/reset endpoint, reset to default a list of settings
content-type required | string (Content-Type) |
[- "string"
]
null