Skip to main content

Nuclia Understanding API (v1)

API reference for the Nuclia Understanding API.

Processing

Ingest API endpoints to process data and get results back.

Download Binary File

Download a file referenced in an upload token

query Parameters
token
required
string (Token)

Responses

Response samples

Content type
application/json
null

Pull

Pull internal message on a partition

query Parameters
Timeout (integer) or Timeout (null) (Timeout)
Default: 5
Partition (integer) or Partition (null) (Partition)
Default: 1
From Cursor (integer) or From Cursor (null) (From Cursor)
limit
integer (Limit)
Default: 5

Responses

Response samples

Content type
application/json
{
  • "status": "ok",
  • "payload": "string",
  • "payloads": [ ],
  • "msgid": "string",
  • "cursor": 0
}

Pull Head

Get the pull api position

Responses

Response samples

Content type
application/json
{
  • "cursor": 0
}

Send Data To Process

Push data to process

Request Body schema: application/json
required
Kbid (string) or Kbid (null) (Kbid)
Uuid (string) or Uuid (null) (Uuid)
Title (string) or Title (null) (Title)
labels
Array of strings (Labels)
Default: []
Slug (string) or Slug (null) (Slug)
Source (integer) or null
Userid (string) or Userid (null) (Userid)
object (Genericfield)
Default: {}
object (Filefield)
Default: {}
object (Linkfield)
Default: {}
object (Textfield)
Default: {}
object (Layoutfield)
Default: {}
object (Conversationfield)
Default: {}
PushProcessingOptions (object) or null
LearningConfig (object) or null
WebhookConfig (object) or null

Responses

Request samples

Content type
application/json
{
  • "kbid": "string",
  • "uuid": "string",
  • "title": "string",
  • "labels": [ ],
  • "slug": "string",
  • "source": 0,
  • "userid": "string",
  • "genericfield": { },
  • "filefield": { },
  • "linkfield": { },
  • "textfield": { },
  • "layoutfield": { },
  • "conversationfield": { },
  • "processing_options": {
    },
  • "learning_config": {
    },
  • "webhook_config": {
    }
}

Response samples

Content type
application/json
{
  • "seqid": 0,
  • "account_seq": 0,
  • "queue": "shared",
  • "uuid": "string",
  • "processing_id": "string"
}

Get Processed Data

Retreive status of processed and unprocessed payloads from a zone

query Parameters
Cursor (string) or Cursor (null) (Cursor)
limit
integer (Limit)
Default: 20
Scheduled (boolean) or Scheduled (null) (Scheduled)
Kbid (string) or Kbid (null) (Kbid)
sort_on
string (SortFields)
Enum: "timestamp" "scheduled_at" "completed_at"
sort_order
string (SortOrder)
Enum: "asc" "desc"

Responses

Response samples

Content type
application/json
{
  • "results": [
    ],
  • "cursor": "string"
}

Get Processed Data

Retreive status of processed and unprocessed payloads from a zone

path Parameters
processing_id
required
string (Processing Id)

Responses

Response samples

Content type
application/json
{
  • "processing_id": "string",
  • "resource_id": "string",
  • "kbid": "string",
  • "title": "string",
  • "labels": [
    ],
  • "completed": true,
  • "scheduled": true,
  • "timestamp": "2019-08-24T14:15:22Z",
  • "completed_at": "2019-08-24T14:15:22Z",
  • "scheduled_at": "2019-08-24T14:15:22Z",
  • "failed": false,
  • "retries": 0,
  • "schedule_eta": 0,
  • "schedule_order": 0,
  • "request": "string",
  • "response": "string"
}

Upload Binary File

Upload a file using a multipart request

header Parameters
X-Filename (string) or X-Filename (null) (X-Filename)
Default:
X-Password (string) or X-Password (null) (X-Password)
X-Language (string) or X-Language (null) (X-Language)
X-Md5 (string) or X-Md5 (null) (X-Md5)

Responses

Response samples

Content type
application/json
null

Processing TUS uploads

Processing uploads using TUS protocol

Create New Upload

An empty POST request is used to create a new upload resource. The Upload-Length header indicates the size of the entire upload in bytes.

Responses

Response samples

Content type
application/json
null

Tus Server Information

Gather information about the Server’s current configuration such as enabled extensions, version...

path Parameters
required
Upload Id (string) or Upload Id (null) (Upload Id)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Upload Information

Get information about a current download (completed upload size)

path Parameters
upload_id
required
string (Upload Id)

Responses

Response samples

Content type
application/json
null

Upload Data

Upload all bytes in the requests and append them in the specifyied offset

path Parameters
upload_id
required
string (Upload Id)

Responses

Response samples

Content type
application/json
null

Training

Training API endpoints to train custom models with your data.

Download Account Predictive Model File

Download the trained model or any other generated file as a result of a training task on a Knowledge Box

path Parameters
kbid
required
string (Kbid)
model_id
required
string (Model Id)
filename
required
string (Filename)
query Parameters
account_id
required
string (Account Id)

Responses

Response samples

Content type
application/json
null

Models

Models API

Learning Configuration Schema

Get available models

path Parameters
account_id
required
string (Account Id)
dataset_id
required
string (Dataset Id)

Responses

Response samples

Content type
application/json
{ }

Learning Configuration Schema

Get trained models

path Parameters
account_id
required
string (Account Id)
model_id
required
string (Model Id)

Responses

Response samples

Content type
application/json
{ }

Model Deletion On Account

Delete specific model from account, destroying action

path Parameters
account_id
required
string (Account Id)
model_id
required
string (Model Id)

Responses

Response samples

Content type
application/json
null

Learning Configuration Models From Account

Get trained models

path Parameters
account_id
required
string (Account Id)

Responses

Response samples

Content type
application/json
{ }

Add A Model To A Kb

Add a model to a KB to be used

path Parameters
account_id
required
string (Account Id)
kbid
required
string (Kbid)
Request Body schema: application/json
required
id
required
string (Id)

Responses

Request samples

Content type
application/json
{
  • "id": "string"
}

Response samples

Content type
application/json
null

Delete A Model From A Kb

Remove from availability a model from a KB

path Parameters
kbid
required
string (Kbid)
model_id
required
string (Model Id)
account_id
required
string (Account Id)

Responses

Response samples

Content type
application/json
null

Learning Configuration Schema

Get schema for creating a KB

path Parameters
account_id
required
string (Account Id)

Responses

Response samples

Content type
application/json
{
  • "semantic_model": {
    },
  • "semantic_models": {
    },
  • "default_semantic_model": {
    },
  • "anonymization_model": {
    },
  • "visual_labeling": {
    },
  • "generative_model": {
    },
  • "ner_model": {
    },
  • "relation_model": {
    },
  • "summary_model": {
    },
  • "summary": {
    },
  • "user_keys": {
    },
  • "user_prompts": {
    },
  • "summary_prompt": {
    },
  • "prefer_markdown_generative_response": {
    }
}

Learning Configuration Schema

Get available models onprem

path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
{ }

Add A Model To A Kb Onprem

Add a model to a KB to be used

path Parameters
kbid
required
string (Kbid)
Request Body schema: application/json
required
id
required
string (Id)

Responses

Request samples

Content type
application/json
{
  • "id": "string"
}

Response samples

Content type
application/json
null

Model Configuration

Get trained models

path Parameters
kbid
required
string (Kbid)
model_id
required
string (Model Id)

Responses

Response samples

Content type
application/json
{ }

Knowledge Boxes

Knowledge Boxes API

Knowledgebox Models Configuration

Current configuration of models assigned to a knowledgebox

path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
{
  • "resource_labelers_models": [
    ],
  • "paragraph_labelers_models": [
    ],
  • "intent_models": [
    ],
  • "visual_labeling": "disabled",
  • "ner_model": "multilingual",
  • "relation_model": "base",
  • "anonymization_model": "disabled",
  • "semantic_model": "string",
  • "semantic_models": [
    ],
  • "default_semantic_model": "string",
  • "semantic_vector_similarity": "DOT",
  • "semantic_vector_size": 1024,
  • "semantic_matryoshka_dims": [ ],
  • "semantic_threshold": 0.4,
  • "generative_model": "chatgpt-azure-4o",
  • "user_keys": {
    },
  • "user_prompts": {
    },
  • "summary": "extended",
  • "summary_model": "claude-3-fast",
  • "summary_prompt": {
    },
  • "prefer_markdown_generative_response": false,
  • "semantic_model_configs": { }
}

Knowledgebox Models Add Configuration

Current configuration of models assigned to a knowledgebox

path Parameters
kbid
required
string (Kbid)
Request Body schema: application/json
required
AnonymizationModel (string) or Anonymization Model (string) (Anonymization Model)
Default: "disabled"
VisualLabeling (string) or Visual Labeling (string) (Visual Labeling)
Default: "disabled"
generative_model
string (Generative Model)
Default: "chatgpt-azure-4o"
NERModel"multilingual" (string) or Ner Model (string) (Ner Model)
Default: "multilingual"
RelationModel"base" (string) or Relation Model (string) (Relation Model)
Default: "base"
UserLearningKeys (object) or null
UserPrompts (object) or null
Summary (string) or null
Default: "simple"
summary_model
string (Summary Model)
Default: "claude-3-fast"
SummaryPrompt (object) or null
prefer_markdown_generative_response
boolean (Prefer Markdown Generative Response)
Default: false
SemanticModel (string) or null

The default vector set / semantic model to use. Must be one of the models defined in the semantic_models field. If not provided, the first model in the list will be used.

SemanticModel (string) or null
Deprecated
Array of Semantic Models (strings) or Semantic Models (null) (Semantic Models)

Responses

Request samples

Content type
application/json
{
  • "anonymization_model": "disabled",
  • "visual_labeling": "disabled",
  • "generative_model": "chatgpt-azure-4o",
  • "ner_model": "multilingual",
  • "relation_model": "base",
  • "user_keys": {
    },
  • "user_prompts": {
    },
  • "summary": "simple",
  • "summary_model": "claude-3-fast",
  • "summary_prompt": {
    },
  • "prefer_markdown_generative_response": false,
  • "default_semantic_model": "en-2024-04-24",
  • "semantic_model": "en-2024-04-24",
  • "semantic_models": [
    ]
}

Response samples

Content type
application/json
{
  • "resource_labelers_models": [
    ],
  • "paragraph_labelers_models": [
    ],
  • "intent_models": [
    ],
  • "visual_labeling": "disabled",
  • "ner_model": "multilingual",
  • "relation_model": "base",
  • "anonymization_model": "disabled",
  • "semantic_model": "string",
  • "semantic_models": [
    ],
  • "default_semantic_model": "string",
  • "semantic_vector_similarity": "DOT",
  • "semantic_vector_size": 1024,
  • "semantic_matryoshka_dims": [ ],
  • "semantic_threshold": 0.4,
  • "generative_model": "chatgpt-azure-4o",
  • "user_keys": {
    },
  • "user_prompts": {
    },
  • "summary": "extended",
  • "summary_model": "claude-3-fast",
  • "summary_prompt": {
    },
  • "prefer_markdown_generative_response": false,
  • "semantic_model_configs": { }
}

Knowledgebox Models Update Configuration

Current configuration of models assigned to a knowledgebox

path Parameters
kbid
required
string (Kbid)
Request Body schema: application/json
required
AnonymizationModel (string) or Anonymization Model (string) (Anonymization Model)
Default: "disabled"
VisualLabeling (string) or Visual Labeling (string) (Visual Labeling)
Default: "disabled"
generative_model
string (Generative Model)
Default: "chatgpt-azure-4o"
NERModel"multilingual" (string) or Ner Model (string) (Ner Model)
Default: "multilingual"
RelationModel"base" (string) or Relation Model (string) (Relation Model)
Default: "base"
UserLearningKeys (object) or null
UserPrompts (object) or null
Summary (string) or null
Default: "simple"
summary_model
string (Summary Model)
Default: "claude-3-fast"
SummaryPrompt (object) or null
prefer_markdown_generative_response
boolean (Prefer Markdown Generative Response)
Default: false
SemanticModel (string) or null

The default vector set / semantic model to use. Must be one of the models defined in the semantic_models field. If not provided, the first model in the list will be used.

Responses

Request samples

Content type
application/json
{
  • "anonymization_model": "disabled",
  • "visual_labeling": "disabled",
  • "generative_model": "chatgpt-azure-4o",
  • "ner_model": "multilingual",
  • "relation_model": "base",
  • "user_keys": {
    },
  • "user_prompts": {
    },
  • "summary": "simple",
  • "summary_model": "claude-3-fast",
  • "summary_prompt": {
    },
  • "prefer_markdown_generative_response": false,
  • "default_semantic_model": "en-2024-04-24"
}

Response samples

Content type
application/json
{
  • "resource_labelers_models": [
    ],
  • "paragraph_labelers_models": [
    ],
  • "intent_models": [
    ],
  • "visual_labeling": "disabled",
  • "ner_model": "multilingual",
  • "relation_model": "base",
  • "anonymization_model": "disabled",
  • "semantic_model": "string",
  • "semantic_models": [
    ],
  • "default_semantic_model": "string",
  • "semantic_vector_similarity": "DOT",
  • "semantic_vector_size": 1024,
  • "semantic_matryoshka_dims": [ ],
  • "semantic_threshold": 0.4,
  • "generative_model": "chatgpt-azure-4o",
  • "user_keys": {
    },
  • "user_prompts": {
    },
  • "summary": "extended",
  • "summary_model": "claude-3-fast",
  • "summary_prompt": {
    },
  • "prefer_markdown_generative_response": false,
  • "semantic_model_configs": { }
}

Knowledgebox Models Configuration

Delete a KB configuration

path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Learning Configuration Schema

Get jsonschema definition for learning_configuration field of knowledgebox creation payload

Responses

Response samples

Content type
application/json
{
  • "semantic_model": {
    },
  • "semantic_models": {
    },
  • "default_semantic_model": {
    },
  • "anonymization_model": {
    },
  • "visual_labeling": {
    },
  • "generative_model": {
    },
  • "ner_model": {
    },
  • "relation_model": {
    },
  • "summary_model": {
    },
  • "summary": {
    },
  • "user_keys": {
    },
  • "user_prompts": {
    },
  • "summary_prompt": {
    },
  • "prefer_markdown_generative_response": {
    }
}

Learning Configuration Schema

Get jsonschema definition for learning_configuration field of knowledgebox creation payload

Responses

Response samples

Content type
application/json
{
  • "semantic_model": {
    },
  • "semantic_models": {
    },
  • "default_semantic_model": {
    },
  • "anonymization_model": {
    },
  • "visual_labeling": {
    },
  • "generative_model": {
    },
  • "ner_model": {
    },
  • "relation_model": {
    },
  • "summary_model": {
    },
  • "summary": {
    },
  • "user_keys": {
    },
  • "user_prompts": {
    },
  • "summary_prompt": {
    },
  • "prefer_markdown_generative_response": {
    }
}

Learning Configuration Schema

Get jsonschema definition for learning_configuration field of knowledgebox update payload

path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
{
  • "semantic_model": {
    },
  • "semantic_models": {
    },
  • "default_semantic_model": {
    },
  • "anonymization_model": {
    },
  • "visual_labeling": {
    },
  • "generative_model": {
    },
  • "ner_model": {
    },
  • "relation_model": {
    },
  • "summary_model": {
    },
  • "summary": {
    },
  • "user_keys": {
    },
  • "user_prompts": {
    },
  • "summary_prompt": {
    },
  • "prefer_markdown_generative_response": {
    }
}

Predict

Predict API to get predictions from our models

Predict Chat

Chat interface for your NucliaDB

query Parameters
model
string (Model)
Default: "chatgpt-azure-4o"
Request Body schema: application/json
required
question
required
string (Question)
retrieval
boolean (Retrieval)
Default: true
user_id
required
string (User Id)
System (string) or System (null) (System)
Array of objects (Chat History)
Default: []
Array of objects (Context)
Default: []
Array of Query Context (strings) or Query Context (object) (Query Context)
Default: {}
object (Query Context Order)
Default: {}
Truncate (boolean) or Truncate (null) (Truncate)
Default: false
UserPrompt (object) or null
Citations (boolean) or Citations (null) (Citations)
Default: false
Citation Threshold (number) or Citation Threshold (null) (Citation Threshold)

If citations is set to True, this will be the similarity threshold. Value between 0 and 1, lower values will produce more citations. If not set, it will be set to the optimized threshold found by Nuclia.

Generative Model (string) or Generative Model (null) (Generative Model)
Max Tokens (integer) or Max Tokens (null) (Max Tokens)
Array of Query Context Images (objects) or Query Context Images (object) (Query Context Images)
Default: {}
Prefer Markdown (boolean) or Prefer Markdown (null) (Prefer Markdown)
Json Schema (object) or Json Schema (null) (Json Schema)
format_prompt
boolean (Format Prompt)
Default: true
rerank_context
boolean (Rerank Context)
Default: false

Whether to reorder the query context based on a reranker. This option will also make it so the first response will contain the scores given for each context piece.

Responses

Request samples

Content type
application/json
{
  • "question": "string",
  • "retrieval": true,
  • "user_id": "string",
  • "system": "string",
  • "chat_history": [ ],
  • "context": [ ],
  • "query_context": { },
  • "query_context_order": { },
  • "truncate": false,
  • "user_prompt": {
    },
  • "citations": false,
  • "citation_threshold": 1,
  • "generative_model": "string",
  • "max_tokens": 0,
  • "query_context_images": { },
  • "prefer_markdown": true,
  • "json_schema": { },
  • "format_prompt": true,
  • "rerank_context": false
}

Response samples

Content type
application/json
null

Predict Chat Kbid

Chat interface for your NucliaDB

path Parameters
kbid
required
string (Kbid)
Request Body schema: application/json
required
question
required
string (Question)
retrieval
boolean (Retrieval)
Default: true
user_id
required
string (User Id)
System (string) or System (null) (System)
Array of objects (Chat History)
Default: []
Array of objects (Context)
Default: []
Array of Query Context (strings) or Query Context (object) (Query Context)
Default: {}
object (Query Context Order)
Default: {}
Truncate (boolean) or Truncate (null) (Truncate)
Default: false
UserPrompt (object) or null
Citations (boolean) or Citations (null) (Citations)
Default: false
Citation Threshold (number) or Citation Threshold (null) (Citation Threshold)

If citations is set to True, this will be the similarity threshold. Value between 0 and 1, lower values will produce more citations. If not set, it will be set to the optimized threshold found by Nuclia.

Generative Model (string) or Generative Model (null) (Generative Model)
Max Tokens (integer) or Max Tokens (null) (Max Tokens)
Array of Query Context Images (objects) or Query Context Images (object) (Query Context Images)
Default: {}
Prefer Markdown (boolean) or Prefer Markdown (null) (Prefer Markdown)
Json Schema (object) or Json Schema (null) (Json Schema)
format_prompt
boolean (Format Prompt)
Default: true
rerank_context
boolean (Rerank Context)
Default: false

Whether to reorder the query context based on a reranker. This option will also make it so the first response will contain the scores given for each context piece.

Responses

Request samples

Content type
application/json
{
  • "question": "string",
  • "retrieval": true,
  • "user_id": "string",
  • "system": "string",
  • "chat_history": [ ],
  • "context": [ ],
  • "query_context": { },
  • "query_context_order": { },
  • "truncate": false,
  • "user_prompt": {
    },
  • "citations": false,
  • "citation_threshold": 1,
  • "generative_model": "string",
  • "max_tokens": 0,
  • "query_context_images": { },
  • "prefer_markdown": true,
  • "json_schema": { },
  • "format_prompt": true,
  • "rerank_context": false
}

Response samples

Content type
application/json
null

Predict Query

Get the vector of a sentence

query Parameters
Text (string) or Text (null) (Text)

Text to process

semantic_model
string (Semantic Model)
Default: "multilingual-2024-05-06"
token_model
string (Token Model)
Default: "multilingual"
generative_model
string (Generative Model)
Default: "chatgpt-azure-4o"
rephrase
boolean (Rephrase)
Default: false
Rephrase Prompt (string) or Rephrase Prompt (null) (Rephrase Prompt)
Examples: rephrase_prompt=Rephrase this question so its better for retrieval, and keep the rephrased question in the same language as the original. QUESTION: {question} Please return ONLY the question without any explanation. Just the rephrased question. rephrase_prompt=Rephrase this question so its better for retrieval, identify any part numbers and append them to the end of the question separated by a commas. QUESTION: {question} Please return ONLY the question without any explanation.

Prompt to rephrase the sentence, if not provided, the default prompt will be used. It must include the {question} placeholder. The placeholder will be replaced with the original question.

Responses

Response samples

Content type
application/json
{
  • "language": "string",
  • "stop_words": [
    ],
  • "semantic_threshold": 0,
  • "semantic_thresholds": {
    },
  • "visual_llm": true,
  • "max_context": 0,
  • "entities": {
    },
  • "sentence": {
    },
  • "query": "string"
}

Predict Query Kbid

Get the vector of a sentence

path Parameters
kbid
required
string (Kbid)
query Parameters
Text (string) or Text (null) (Text)

Text to process

Array of Semantic Models (strings) or Semantic Models (null) (Semantic Models)

Semantic models to compute the sentence vector for, if not provided, it will only compute the sentence vector for default semantic model in the Knowledge box's configuration.

generative_model
string (Generative Model)
Default: "chatgpt-azure-4o-mini"
rephrase
boolean (Rephrase)
Default: false
Rephrase Prompt (string) or Rephrase Prompt (null) (Rephrase Prompt)
Examples: rephrase_prompt=Rephrase this question so its better for retrieval, and keep the rephrased question in the same language as the original. QUESTION: {question} Please return ONLY the question without any explanation. Just the rephrased question. rephrase_prompt=Rephrase this question so its better for retrieval, identify any part numbers and append them to the end of the question separated by a commas. QUESTION: {question} Please return ONLY the question without any explanation.

Prompt to rephrase the sentence, if not provided, the default prompt will be used. It must include the {question} placeholder. The placeholder will be replaced with the original question.

Responses

Response samples

Content type
application/json
{
  • "language": "string",
  • "stop_words": [
    ],
  • "semantic_threshold": 0,
  • "semantic_thresholds": {
    },
  • "visual_llm": true,
  • "max_context": 0,
  • "entities": {
    },
  • "sentence": {
    },
  • "query": "string"
}

Predict Rephrase

Rephrase interface for your NucliaDB

query Parameters
model
string (Model)
Default: "chatgpt-azure-4o"
Request Body schema: application/json
required
question
required
string (Question)
Array of objects (Chat History)
Array of objects (Context)
Array of User Context (strings) or User Context (null) (User Context)
user_id
required
string (User Id)
Generative Model (string) or Generative Model (null) (Generative Model)
Prompt (string) or Prompt (null) (Prompt)

Prompt to send the model to rephrase the sentence, if not provided, the default prompt will be used. It must include the {question} placeholder. The placeholder will be replaced with the original question. It will only be used if no user_context is provided.

Responses

Request samples

Content type
application/json
{
  • "question": "string",
  • "chat_history": [
    ],
  • "context": [
    ],
  • "user_context": [
    ],
  • "user_id": "string",
  • "generative_model": "string",
  • "prompt": "Rephrase this question so its better for retrieval, and keep the rephrased question in the same language as the original.\nQUESTION: {question}\nPlease return ONLY the question without any explanation. Just the rephrased question."
}

Response samples

Content type
application/json
"string"

Predict Rephrase Kbid

Rephrase interface for your NucliaDB with Container

path Parameters
kbid
required
string (Kbid)
Request Body schema: application/json
required
question
required
string (Question)
Array of objects (Chat History)
Array of objects (Context)
Array of User Context (strings) or User Context (null) (User Context)
user_id
required
string (User Id)
Generative Model (string) or Generative Model (null) (Generative Model)
Prompt (string) or Prompt (null) (Prompt)

Prompt to send the model to rephrase the sentence, if not provided, the default prompt will be used. It must include the {question} placeholder. The placeholder will be replaced with the original question. It will only be used if no user_context is provided.

Responses

Request samples

Content type
application/json
{
  • "question": "string",
  • "chat_history": [
    ],
  • "context": [
    ],
  • "user_context": [
    ],
  • "user_id": "string",
  • "generative_model": "string",
  • "prompt": "Rephrase this question so its better for retrieval, and keep the rephrased question in the same language as the original.\nQUESTION: {question}\nPlease return ONLY the question without any explanation. Just the rephrased question."
}

Response samples

Content type
application/json
null

Predict Sentence

Get the vector of a sentence

query Parameters
text
required
string (Text)
model
string (Model)
Default: "multilingual-2024-05-06"

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "vectors": {
    },
  • "time": 0,
  • "timings": {
    }
}

Predict Sentence Kbid

Get the vector of a sentence

path Parameters
kbid
required
string (Kbid)
query Parameters
text
required
string (Text)
Array of Models (strings) or Models (null) (Models)

Semantic models to compute the sentence vector for, if not provided, it will only compute the sentence vector for default semantic model in the Knowledge box's configuration.

Responses

Response samples

Content type
application/json
{
  • "data": [
    ],
  • "vectors": {
    },
  • "time": 0,
  • "timings": {
    }
}

Predict Summarize

Get summarized answers via NUA

query Parameters
model
string (Model)
Default: "claude-3-fast"
Request Body schema: application/json
required
required
object (Resources)
summary_kind
string (SummaryKind)
Enum: "simple" "extended"
User Prompt (string) or User Prompt (null) (User Prompt)
Default: ""
Generative Model (string) or Generative Model (null) (Generative Model)

Responses

Request samples

Content type
application/json
{
  • "resources": {
    },
  • "summary_kind": "simple",
  • "user_prompt": "",
  • "generative_model": "string"
}

Response samples

Content type
application/json
null

Predict Summarize Kbid

Get summarized answers via NUA with Container

path Parameters
kbid
required
string (Kbid)
Request Body schema: application/json
required
required
object (Resources)
summary_kind
string (SummaryKind)
Enum: "simple" "extended"
User Prompt (string) or User Prompt (null) (User Prompt)
Default: ""
Generative Model (string) or Generative Model (null) (Generative Model)

Responses

Request samples

Content type
application/json
{
  • "resources": {
    },
  • "summary_kind": "simple",
  • "user_prompt": "",
  • "generative_model": "string"
}

Response samples

Content type
application/json
null

Predict Tokens

Get tokens of a sentence

query Parameters
text
required
string (Text)
model
string (Model)
Default: "multilingual"

Responses

Response samples

Content type
application/json
{
  • "tokens": [ ],
  • "time": 0,
  • "input_tokens": 0
}

Predict Tokens Kbid

Get tokens of a sentence with Container

path Parameters
kbid
required
string (Kbid)
query Parameters
text
required
string (Text)

Responses

Response samples

Content type
application/json
{
  • "tokens": [ ],
  • "time": 0,
  • "input_tokens": 0
}

Collector

Collector API

Feedback Avalaible Months

List of months within the last year with feedback data

path Parameters
kbid
required
string (Kbid)

Responses

Response samples

Content type
application/json
null

Get Feedback

Given a month, returns a csv with all the feedback data from it

path Parameters
kbid
required
string (Kbid)
month
required
string (Month)

Responses

Response samples

Content type
application/json
null

Datasets

Delete Dataset

Deletes a dataset

path Parameters
dataset_id
required
string (Dataset Id)
account_id
required
string (Account Id)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Get Dataset

Get a dataset

path Parameters
dataset_id
required
string (Dataset Id)
account_id
required
string (Account Id)

Responses

Response samples

Content type
application/json
{
  • "id": "string"
}

Upload Partition Account

Upload a partition of a dataset

path Parameters
dataset_id
required
string (Dataset Id)
account_id
required
string (Account Id)
partition_id
required
string (Partition Id)
header Parameters
content-length
required
integer (Content-Length)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Delete Dataset Partition

Deletes a partition of a dataset

path Parameters
dataset_id
required
string (Dataset Id)
partition_id
required
string (Partition Id) ^[a-zA-Z0-9-_]+$
account_id
required
string (Account Id)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Delete Dataset Partitions

Deletes all partitions of a dataset

path Parameters
dataset_id
required
string (Dataset Id)
account_id
required
string (Account Id)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Create Dataset Account

Creates a new dataset

path Parameters
account_id
required
string (Account Id)
Request Body schema: application/json
required
name
required
string (Name)
required
object (DatasetFilter)
type
required
string (Task)
Enum: "PARAGRAPH_CLASSIFICATION" "FIELD_CLASSIFICATION" "SENTENCE_CLASSIFICATION" "TOKEN_CLASSIFICATION" "IMAGE_CLASSIFICATION" "PARAGRAPH_STREAMING" "QUESTION_ANSWER_STREAMING" "FIELD_STREAMING"

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "filter": {
    },
  • "type": "PARAGRAPH_CLASSIFICATION"
}

Response samples

Content type
application/json
{
  • "id": "string"
}

List Datasets

Lists all datasets

path Parameters
account_id
required
string (Account Id)

Responses

Response samples

Content type
application/json
{
  • "datasets": [
    ]
}

Dataset Delete

Deletes a dataset

path Parameters
dataset_id
required
string (Dataset Id)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Upload Partition

Upload a partition of a dataset

path Parameters
dataset_id
required
string (Dataset Id)
partition_id
required
string (Partition Id)
header Parameters
content-length
required
integer (Content-Length)

Responses

Response samples

Content type
application/json
{
  • "detail": [
    ]
}

Create Dataset

Creates a new dataset

Request Body schema: application/json
required
name
required
string (Name)
required
object (DatasetFilter)
type
required
string (Task)
Enum: "PARAGRAPH_CLASSIFICATION" "FIELD_CLASSIFICATION" "SENTENCE_CLASSIFICATION" "TOKEN_CLASSIFICATION" "IMAGE_CLASSIFICATION" "PARAGRAPH_STREAMING" "QUESTION_ANSWER_STREAMING" "FIELD_STREAMING"

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "filter": {
    },
  • "type": "PARAGRAPH_CLASSIFICATION"
}

Response samples

Content type
application/json
{
  • "id": "string"
}

Task

Start Dataset Training Task

Start a train task on a dataset

path Parameters
dataset_id
required
string (Dataset Id)
Request Body schema: application/json
required
name
required
string (TaskName)
Enum: "dummy" "env" "demo-dataset" "labeler" "llm-graph" "synthetic-questions" "ask" "llm-align" "semantic-model-migrator" "llama-guard" "prompt-guard"
required
DataAugmentation (object) or SemanticModelMigrationParams (object) or Parameters (null) (Parameters)

Parameters to be passed to the task. These must match the validation field for the Task definition class

Responses

Request samples

Content type
application/json
{
  • "name": "dummy",
  • "parameters": {
    }
}

Response samples

Content type
application/json
{
  • "name": "dummy",
  • "status": "not_running",
  • "id": "string"
}

Delete Dataset Task

Delete a task from a Dataset

path Parameters
dataset_id
required
string (Dataset Id)
task_id
required
string (Task Id)

Responses

Response samples

Content type
application/json
null

Inspect Dataset Training Task

Get the status of a train task on a dataset

path Parameters
dataset_id
required
string (Dataset Id)
task_id
required
string (Task Id)

Responses

Response samples

Content type
application/json
{
  • "task": {
    },
  • "source": "nucliadb",
  • "kbid": "string",
  • "dataset_id": "string",
  • "account_id": "string",
  • "nua_client_id": "string",
  • "user_id": "string",
  • "id": "string",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "scheduled": false,
  • "completed": false,
  • "stopped": false,
  • "scheduled_at": "2019-08-24T14:15:22Z",
  • "completed_at": "2019-08-24T14:15:22Z",
  • "stopped_at": "2019-08-24T14:15:22Z",
  • "failed": false,
  • "retries": 0,
  • "parameters": {
    },
  • "log": "string"
}

Stop Dataset Training Task

Stop a train task on a dataset

path Parameters
dataset_id
required
string (Dataset Id)
task_id
required
string (Task Id)

Responses

Response samples

Content type
application/json
{
  • "name": "dummy",
  • "status": "not_running",
  • "id": "string"
}

List Account Possible Tasks

Get the available tasks on a KB

path Parameters
dataset_id
required
string (Dataset Id)
query Parameters
count
integer (Count)
Default: 10

How many finished tasks to return

Responses

Response samples

Content type
application/json
{
  • "tasks": [
    ],
  • "running": [
    ],
  • "configs": [
    ],
  • "done": [
    ]
}

Start Knowledge Box Training Task

Start a train task on a knowledge box

path Parameters
kb_uuid
required
string (Kb Uuid)
Request Body schema: application/json
required
name
required
string (TaskName)
Enum: "dummy" "env" "demo-dataset" "labeler" "llm-graph" "synthetic-questions" "ask" "llm-align" "semantic-model-migrator" "llama-guard" "prompt-guard"
required
DataAugmentation (object) or SemanticModelMigrationParams (object) or Parameters (null) (Parameters)

Parameters to be passed to the task. These must match the validation field for the Task definition class

apply
string (ApplyOptions)
Enum: "EXISTING" "NEW" "ALL"

Defines how the tasks should be applied to the existing data.

  • EXSITING: Only apply to existing data (starts a worker that executes the task)
  • NEW: Only apply to new data (enables the task at processing time)
  • ALL: Apply to all data (both of the above)

Responses

Request samples

Content type
application/json
{
  • "name": "dummy",
  • "parameters": {
    },
  • "apply": "EXISTING"
}

Response samples

Content type
application/json
{
  • "name": "dummy",
  • "status": "not_running",
  • "id": "string"
}

Delete Knowledge Box Training Task

Delete a task from a Knowledge Box

path Parameters
kb_uuid
required
string (Kb Uuid)
task_id
required
string (Task Id)

Responses

Response samples

Content type
application/json
null

Inspect Knowledge Box Training Task

Get the status of a task on a knowledge box

path Parameters
kb_uuid
required
string (Kb Uuid)
task_id
required
string (Task Id)

Responses

Response samples

Content type
application/json
{
  • "request": {
    },
  • "config": {
    }
}

Restart Knowledge Box Training Task

Stop a train task on a knowledge box

path Parameters
kb_uuid
required
string (Kb Uuid)
task_id
required
string (Task Id)

Responses

Response samples

Content type
application/json
{
  • "name": "dummy",
  • "status": "not_running",
  • "id": "string"
}

Stop Knowledge Box Training Task

Stop a train task on a knowledge box

path Parameters
kb_uuid
required
string (Kb Uuid)
task_id
required
string (Task Id)

Responses

Response samples

Content type
application/json
{
  • "name": "dummy",
  • "status": "not_running",
  • "id": "string"
}

Inspect Knowledge Box Training Task Worker Config

Get the worker config of a task on a knowledge box

path Parameters
task_id
required
string (Task Id)

Responses

Response samples

Content type
application/json
{
  • "task": {
    },
  • "source": "nucliadb",
  • "kbid": "string",
  • "dataset_id": "string",
  • "dataset_path": "string",
  • "account_id": "string",
  • "account_type": "string",
  • "nua_client_id": "string",
  • "user_id": "string",
  • "parameters": {
    },
  • "id": "string",
  • "timestamp": "2019-08-24T14:15:22Z",
  • "scheduled": false,
  • "completed": false,
  • "stopped": false,
  • "scheduled_at": "2019-08-24T14:15:22Z",
  • "completed_at": "2019-08-24T14:15:22Z",
  • "stopped_at": "2019-08-24T14:15:22Z",
  • "failed": false,
  • "retries": 0,
  • "token": "string",
  • "key_id": "string",
  • "ndb_token": "string",
  • "log": "string"
}

List Knowledge Box Possible Tasks

Get the available tasks on a KB

path Parameters
kb_uuid
required
string (Kb Uuid)
query Parameters
count
integer (Count)
Default: 10

How many finished tasks to return

Responses

Response samples

Content type
application/json
{
  • "tasks": [
    ],
  • "running": [
    ],
  • "configs": [
    ],
  • "done": [
    ]
}