Update Knowledge Base V2
curl --request PATCH \
--url https://api.example.com/v1/knowledge-bases/{knowledge_base_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"document_types": [
"<string>"
],
"error": {},
"summary": "<string>",
"summary_embedding": [
123
],
"needs_summary_update": true,
"settings_": {
"retrieval_info": "",
"retrieval_method": "hybrid_bm25",
"reranking_enabled": false,
"rerankers": [
"<string>"
],
"retrieval_top_k": 25,
"retrieval_top_k_window": [
123
],
"fts_weight": 0.7,
"semantic_weight": 0.3,
"rrf_k": 60,
"threshold_enabled": false,
"threshold": 0,
"reranker_type": "vertex",
"reranker_top_k": 10,
"reranker_threshold_enabled": false,
"reranker_threshold": 0,
"vertex_model": "semantic-ranker-512@latest",
"ingestion_info": "",
"batch_size": 8,
"default_chunk_size": 2048,
"default_chunk_overlap": 512,
"enrich_chunks_mode": "inject_summary",
"enrich_pre_made_qa": false,
"pdf_info": "",
"pdf_extract_images": true,
"pdf_chunk_size": 1024,
"pdf_chunk_overlap": 256,
"pdf_ocr_enabled": false,
"pdf_ocr_confidence": 0.7,
"pdf_ocr_language": "auto",
"text_info": "",
"text_chunking_enabled": true,
"text_chunk_size": 1024,
"text_chunk_overlap": 256,
"text_preserve_formatting": true,
"html_info": "",
"html_extract_text_only": true,
"html_include_tables": true,
"html_include_images": false,
"html_ingest_as_markdown": true,
"image_info": "",
"image_ocr_enabled": false,
"image_ocr_confidence": 0.7,
"csv_row_as_document": false,
"csv_include_headers": true,
"csv_auto_detect_delimiter": true,
"csv_delimiter": ",",
"csv_encoding": "utf-8",
"xlsx_row_as_document": false,
"xlsx_include_headers": true,
"tabular_ingest_all_rows": false,
"tabular_max_rows": 50000,
"embedding_model": [],
"embedding_dimension": 123,
"mm_embedding_model": []
},
"version": "<string>",
"meta": {}
}
'import requests
url = "https://api.example.com/v1/knowledge-bases/{knowledge_base_id}"
payload = {
"name": "<string>",
"description": "<string>",
"document_types": ["<string>"],
"error": {},
"summary": "<string>",
"summary_embedding": [123],
"needs_summary_update": True,
"settings_": {
"retrieval_info": "",
"retrieval_method": "hybrid_bm25",
"reranking_enabled": False,
"rerankers": ["<string>"],
"retrieval_top_k": 25,
"retrieval_top_k_window": [123],
"fts_weight": 0.7,
"semantic_weight": 0.3,
"rrf_k": 60,
"threshold_enabled": False,
"threshold": 0,
"reranker_type": "vertex",
"reranker_top_k": 10,
"reranker_threshold_enabled": False,
"reranker_threshold": 0,
"vertex_model": "semantic-ranker-512@latest",
"ingestion_info": "",
"batch_size": 8,
"default_chunk_size": 2048,
"default_chunk_overlap": 512,
"enrich_chunks_mode": "inject_summary",
"enrich_pre_made_qa": False,
"pdf_info": "",
"pdf_extract_images": True,
"pdf_chunk_size": 1024,
"pdf_chunk_overlap": 256,
"pdf_ocr_enabled": False,
"pdf_ocr_confidence": 0.7,
"pdf_ocr_language": "auto",
"text_info": "",
"text_chunking_enabled": True,
"text_chunk_size": 1024,
"text_chunk_overlap": 256,
"text_preserve_formatting": True,
"html_info": "",
"html_extract_text_only": True,
"html_include_tables": True,
"html_include_images": False,
"html_ingest_as_markdown": True,
"image_info": "",
"image_ocr_enabled": False,
"image_ocr_confidence": 0.7,
"csv_row_as_document": False,
"csv_include_headers": True,
"csv_auto_detect_delimiter": True,
"csv_delimiter": ",",
"csv_encoding": "utf-8",
"xlsx_row_as_document": False,
"xlsx_include_headers": True,
"tabular_ingest_all_rows": False,
"tabular_max_rows": 50000,
"embedding_model": [],
"embedding_dimension": 123,
"mm_embedding_model": []
},
"version": "<string>",
"meta": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
document_types: ['<string>'],
error: {},
summary: '<string>',
summary_embedding: [123],
needs_summary_update: true,
settings_: {
retrieval_info: '',
retrieval_method: 'hybrid_bm25',
reranking_enabled: false,
rerankers: ['<string>'],
retrieval_top_k: 25,
retrieval_top_k_window: [123],
fts_weight: 0.7,
semantic_weight: 0.3,
rrf_k: 60,
threshold_enabled: false,
threshold: 0,
reranker_type: 'vertex',
reranker_top_k: 10,
reranker_threshold_enabled: false,
reranker_threshold: 0,
vertex_model: 'semantic-ranker-512@latest',
ingestion_info: '',
batch_size: 8,
default_chunk_size: 2048,
default_chunk_overlap: 512,
enrich_chunks_mode: 'inject_summary',
enrich_pre_made_qa: false,
pdf_info: '',
pdf_extract_images: true,
pdf_chunk_size: 1024,
pdf_chunk_overlap: 256,
pdf_ocr_enabled: false,
pdf_ocr_confidence: 0.7,
pdf_ocr_language: 'auto',
text_info: '',
text_chunking_enabled: true,
text_chunk_size: 1024,
text_chunk_overlap: 256,
text_preserve_formatting: true,
html_info: '',
html_extract_text_only: true,
html_include_tables: true,
html_include_images: false,
html_ingest_as_markdown: true,
image_info: '',
image_ocr_enabled: false,
image_ocr_confidence: 0.7,
csv_row_as_document: false,
csv_include_headers: true,
csv_auto_detect_delimiter: true,
csv_delimiter: ',',
csv_encoding: 'utf-8',
xlsx_row_as_document: false,
xlsx_include_headers: true,
tabular_ingest_all_rows: false,
tabular_max_rows: 50000,
embedding_model: [],
embedding_dimension: 123,
mm_embedding_model: []
},
version: '<string>',
meta: {}
})
};
fetch('https://api.example.com/v1/knowledge-bases/{knowledge_base_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/knowledge-bases/{knowledge_base_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'document_types' => [
'<string>'
],
'error' => [
],
'summary' => '<string>',
'summary_embedding' => [
123
],
'needs_summary_update' => true,
'settings_' => [
'retrieval_info' => '',
'retrieval_method' => 'hybrid_bm25',
'reranking_enabled' => false,
'rerankers' => [
'<string>'
],
'retrieval_top_k' => 25,
'retrieval_top_k_window' => [
123
],
'fts_weight' => 0.7,
'semantic_weight' => 0.3,
'rrf_k' => 60,
'threshold_enabled' => false,
'threshold' => 0,
'reranker_type' => 'vertex',
'reranker_top_k' => 10,
'reranker_threshold_enabled' => false,
'reranker_threshold' => 0,
'vertex_model' => 'semantic-ranker-512@latest',
'ingestion_info' => '',
'batch_size' => 8,
'default_chunk_size' => 2048,
'default_chunk_overlap' => 512,
'enrich_chunks_mode' => 'inject_summary',
'enrich_pre_made_qa' => false,
'pdf_info' => '',
'pdf_extract_images' => true,
'pdf_chunk_size' => 1024,
'pdf_chunk_overlap' => 256,
'pdf_ocr_enabled' => false,
'pdf_ocr_confidence' => 0.7,
'pdf_ocr_language' => 'auto',
'text_info' => '',
'text_chunking_enabled' => true,
'text_chunk_size' => 1024,
'text_chunk_overlap' => 256,
'text_preserve_formatting' => true,
'html_info' => '',
'html_extract_text_only' => true,
'html_include_tables' => true,
'html_include_images' => false,
'html_ingest_as_markdown' => true,
'image_info' => '',
'image_ocr_enabled' => false,
'image_ocr_confidence' => 0.7,
'csv_row_as_document' => false,
'csv_include_headers' => true,
'csv_auto_detect_delimiter' => true,
'csv_delimiter' => ',',
'csv_encoding' => 'utf-8',
'xlsx_row_as_document' => false,
'xlsx_include_headers' => true,
'tabular_ingest_all_rows' => false,
'tabular_max_rows' => 50000,
'embedding_model' => [
],
'embedding_dimension' => 123,
'mm_embedding_model' => [
]
],
'version' => '<string>',
'meta' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/knowledge-bases/{knowledge_base_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"document_types\": [\n \"<string>\"\n ],\n \"error\": {},\n \"summary\": \"<string>\",\n \"summary_embedding\": [\n 123\n ],\n \"needs_summary_update\": true,\n \"settings_\": {\n \"retrieval_info\": \"\",\n \"retrieval_method\": \"hybrid_bm25\",\n \"reranking_enabled\": false,\n \"rerankers\": [\n \"<string>\"\n ],\n \"retrieval_top_k\": 25,\n \"retrieval_top_k_window\": [\n 123\n ],\n \"fts_weight\": 0.7,\n \"semantic_weight\": 0.3,\n \"rrf_k\": 60,\n \"threshold_enabled\": false,\n \"threshold\": 0,\n \"reranker_type\": \"vertex\",\n \"reranker_top_k\": 10,\n \"reranker_threshold_enabled\": false,\n \"reranker_threshold\": 0,\n \"vertex_model\": \"semantic-ranker-512@latest\",\n \"ingestion_info\": \"\",\n \"batch_size\": 8,\n \"default_chunk_size\": 2048,\n \"default_chunk_overlap\": 512,\n \"enrich_chunks_mode\": \"inject_summary\",\n \"enrich_pre_made_qa\": false,\n \"pdf_info\": \"\",\n \"pdf_extract_images\": true,\n \"pdf_chunk_size\": 1024,\n \"pdf_chunk_overlap\": 256,\n \"pdf_ocr_enabled\": false,\n \"pdf_ocr_confidence\": 0.7,\n \"pdf_ocr_language\": \"auto\",\n \"text_info\": \"\",\n \"text_chunking_enabled\": true,\n \"text_chunk_size\": 1024,\n \"text_chunk_overlap\": 256,\n \"text_preserve_formatting\": true,\n \"html_info\": \"\",\n \"html_extract_text_only\": true,\n \"html_include_tables\": true,\n \"html_include_images\": false,\n \"html_ingest_as_markdown\": true,\n \"image_info\": \"\",\n \"image_ocr_enabled\": false,\n \"image_ocr_confidence\": 0.7,\n \"csv_row_as_document\": false,\n \"csv_include_headers\": true,\n \"csv_auto_detect_delimiter\": true,\n \"csv_delimiter\": \",\",\n \"csv_encoding\": \"utf-8\",\n \"xlsx_row_as_document\": false,\n \"xlsx_include_headers\": true,\n \"tabular_ingest_all_rows\": false,\n \"tabular_max_rows\": 50000,\n \"embedding_model\": [],\n \"embedding_dimension\": 123,\n \"mm_embedding_model\": []\n },\n \"version\": \"<string>\",\n \"meta\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/v1/knowledge-bases/{knowledge_base_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"document_types\": [\n \"<string>\"\n ],\n \"error\": {},\n \"summary\": \"<string>\",\n \"summary_embedding\": [\n 123\n ],\n \"needs_summary_update\": true,\n \"settings_\": {\n \"retrieval_info\": \"\",\n \"retrieval_method\": \"hybrid_bm25\",\n \"reranking_enabled\": false,\n \"rerankers\": [\n \"<string>\"\n ],\n \"retrieval_top_k\": 25,\n \"retrieval_top_k_window\": [\n 123\n ],\n \"fts_weight\": 0.7,\n \"semantic_weight\": 0.3,\n \"rrf_k\": 60,\n \"threshold_enabled\": false,\n \"threshold\": 0,\n \"reranker_type\": \"vertex\",\n \"reranker_top_k\": 10,\n \"reranker_threshold_enabled\": false,\n \"reranker_threshold\": 0,\n \"vertex_model\": \"semantic-ranker-512@latest\",\n \"ingestion_info\": \"\",\n \"batch_size\": 8,\n \"default_chunk_size\": 2048,\n \"default_chunk_overlap\": 512,\n \"enrich_chunks_mode\": \"inject_summary\",\n \"enrich_pre_made_qa\": false,\n \"pdf_info\": \"\",\n \"pdf_extract_images\": true,\n \"pdf_chunk_size\": 1024,\n \"pdf_chunk_overlap\": 256,\n \"pdf_ocr_enabled\": false,\n \"pdf_ocr_confidence\": 0.7,\n \"pdf_ocr_language\": \"auto\",\n \"text_info\": \"\",\n \"text_chunking_enabled\": true,\n \"text_chunk_size\": 1024,\n \"text_chunk_overlap\": 256,\n \"text_preserve_formatting\": true,\n \"html_info\": \"\",\n \"html_extract_text_only\": true,\n \"html_include_tables\": true,\n \"html_include_images\": false,\n \"html_ingest_as_markdown\": true,\n \"image_info\": \"\",\n \"image_ocr_enabled\": false,\n \"image_ocr_confidence\": 0.7,\n \"csv_row_as_document\": false,\n \"csv_include_headers\": true,\n \"csv_auto_detect_delimiter\": true,\n \"csv_delimiter\": \",\",\n \"csv_encoding\": \"utf-8\",\n \"xlsx_row_as_document\": false,\n \"xlsx_include_headers\": true,\n \"tabular_ingest_all_rows\": false,\n \"tabular_max_rows\": 50000,\n \"embedding_model\": [],\n \"embedding_dimension\": 123,\n \"mm_embedding_model\": []\n },\n \"version\": \"<string>\",\n \"meta\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/knowledge-bases/{knowledge_base_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"document_types\": [\n \"<string>\"\n ],\n \"error\": {},\n \"summary\": \"<string>\",\n \"summary_embedding\": [\n 123\n ],\n \"needs_summary_update\": true,\n \"settings_\": {\n \"retrieval_info\": \"\",\n \"retrieval_method\": \"hybrid_bm25\",\n \"reranking_enabled\": false,\n \"rerankers\": [\n \"<string>\"\n ],\n \"retrieval_top_k\": 25,\n \"retrieval_top_k_window\": [\n 123\n ],\n \"fts_weight\": 0.7,\n \"semantic_weight\": 0.3,\n \"rrf_k\": 60,\n \"threshold_enabled\": false,\n \"threshold\": 0,\n \"reranker_type\": \"vertex\",\n \"reranker_top_k\": 10,\n \"reranker_threshold_enabled\": false,\n \"reranker_threshold\": 0,\n \"vertex_model\": \"semantic-ranker-512@latest\",\n \"ingestion_info\": \"\",\n \"batch_size\": 8,\n \"default_chunk_size\": 2048,\n \"default_chunk_overlap\": 512,\n \"enrich_chunks_mode\": \"inject_summary\",\n \"enrich_pre_made_qa\": false,\n \"pdf_info\": \"\",\n \"pdf_extract_images\": true,\n \"pdf_chunk_size\": 1024,\n \"pdf_chunk_overlap\": 256,\n \"pdf_ocr_enabled\": false,\n \"pdf_ocr_confidence\": 0.7,\n \"pdf_ocr_language\": \"auto\",\n \"text_info\": \"\",\n \"text_chunking_enabled\": true,\n \"text_chunk_size\": 1024,\n \"text_chunk_overlap\": 256,\n \"text_preserve_formatting\": true,\n \"html_info\": \"\",\n \"html_extract_text_only\": true,\n \"html_include_tables\": true,\n \"html_include_images\": false,\n \"html_ingest_as_markdown\": true,\n \"image_info\": \"\",\n \"image_ocr_enabled\": false,\n \"image_ocr_confidence\": 0.7,\n \"csv_row_as_document\": false,\n \"csv_include_headers\": true,\n \"csv_auto_detect_delimiter\": true,\n \"csv_delimiter\": \",\",\n \"csv_encoding\": \"utf-8\",\n \"xlsx_row_as_document\": false,\n \"xlsx_include_headers\": true,\n \"tabular_ingest_all_rows\": false,\n \"tabular_max_rows\": 50000,\n \"embedding_model\": [],\n \"embedding_dimension\": 123,\n \"mm_embedding_model\": []\n },\n \"version\": \"<string>\",\n \"meta\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"document_types": [
"<string>"
],
"size": 123,
"num_docs": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"error": {},
"total_documents": 123,
"training_documents": 123,
"trained_documents": 123,
"error_documents": 123,
"uploaded_documents": 123,
"source_types": {},
"training_source_types": [
"<string>"
],
"meta": {},
"embedding_health": {
"healthy": true,
"message": "",
"embedding_model": ""
},
"health": {
"detected_dim": 123,
"declared_dim": 123,
"message": "",
"action": ""
},
"settings_": {
"retrieval_info": "",
"retrieval_method": "hybrid_bm25",
"reranking_enabled": false,
"rerankers": [
"<string>"
],
"retrieval_top_k": 25,
"retrieval_top_k_window": [
123
],
"fts_weight": 0.7,
"semantic_weight": 0.3,
"rrf_k": 60,
"threshold_enabled": false,
"threshold": 0,
"reranker_type": "vertex",
"reranker_top_k": 10,
"reranker_threshold_enabled": false,
"reranker_threshold": 0,
"vertex_model": "semantic-ranker-512@latest",
"ingestion_info": "",
"batch_size": 8,
"default_chunk_size": 2048,
"default_chunk_overlap": 512,
"enrich_chunks_mode": "inject_summary",
"enrich_pre_made_qa": false,
"pdf_info": "",
"pdf_extract_images": true,
"pdf_chunk_size": 1024,
"pdf_chunk_overlap": 256,
"pdf_ocr_enabled": false,
"pdf_ocr_confidence": 0.7,
"pdf_ocr_language": "auto",
"text_info": "",
"text_chunking_enabled": true,
"text_chunk_size": 1024,
"text_chunk_overlap": 256,
"text_preserve_formatting": true,
"html_info": "",
"html_extract_text_only": true,
"html_include_tables": true,
"html_include_images": false,
"html_ingest_as_markdown": true,
"image_info": "",
"image_ocr_enabled": false,
"image_ocr_confidence": 0.7,
"csv_row_as_document": false,
"csv_include_headers": true,
"csv_auto_detect_delimiter": true,
"csv_delimiter": ",",
"csv_encoding": "utf-8",
"xlsx_row_as_document": false,
"xlsx_include_headers": true,
"tabular_ingest_all_rows": false,
"tabular_max_rows": 50000,
"embedding_model": [],
"embedding_dimension": 123,
"mm_embedding_model": []
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Knowledge Bases
Update Knowledge Base V2
PATCH
/
v1
/
knowledge-bases
/
{knowledge_base_id}
Update Knowledge Base V2
curl --request PATCH \
--url https://api.example.com/v1/knowledge-bases/{knowledge_base_id} \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"document_types": [
"<string>"
],
"error": {},
"summary": "<string>",
"summary_embedding": [
123
],
"needs_summary_update": true,
"settings_": {
"retrieval_info": "",
"retrieval_method": "hybrid_bm25",
"reranking_enabled": false,
"rerankers": [
"<string>"
],
"retrieval_top_k": 25,
"retrieval_top_k_window": [
123
],
"fts_weight": 0.7,
"semantic_weight": 0.3,
"rrf_k": 60,
"threshold_enabled": false,
"threshold": 0,
"reranker_type": "vertex",
"reranker_top_k": 10,
"reranker_threshold_enabled": false,
"reranker_threshold": 0,
"vertex_model": "semantic-ranker-512@latest",
"ingestion_info": "",
"batch_size": 8,
"default_chunk_size": 2048,
"default_chunk_overlap": 512,
"enrich_chunks_mode": "inject_summary",
"enrich_pre_made_qa": false,
"pdf_info": "",
"pdf_extract_images": true,
"pdf_chunk_size": 1024,
"pdf_chunk_overlap": 256,
"pdf_ocr_enabled": false,
"pdf_ocr_confidence": 0.7,
"pdf_ocr_language": "auto",
"text_info": "",
"text_chunking_enabled": true,
"text_chunk_size": 1024,
"text_chunk_overlap": 256,
"text_preserve_formatting": true,
"html_info": "",
"html_extract_text_only": true,
"html_include_tables": true,
"html_include_images": false,
"html_ingest_as_markdown": true,
"image_info": "",
"image_ocr_enabled": false,
"image_ocr_confidence": 0.7,
"csv_row_as_document": false,
"csv_include_headers": true,
"csv_auto_detect_delimiter": true,
"csv_delimiter": ",",
"csv_encoding": "utf-8",
"xlsx_row_as_document": false,
"xlsx_include_headers": true,
"tabular_ingest_all_rows": false,
"tabular_max_rows": 50000,
"embedding_model": [],
"embedding_dimension": 123,
"mm_embedding_model": []
},
"version": "<string>",
"meta": {}
}
'import requests
url = "https://api.example.com/v1/knowledge-bases/{knowledge_base_id}"
payload = {
"name": "<string>",
"description": "<string>",
"document_types": ["<string>"],
"error": {},
"summary": "<string>",
"summary_embedding": [123],
"needs_summary_update": True,
"settings_": {
"retrieval_info": "",
"retrieval_method": "hybrid_bm25",
"reranking_enabled": False,
"rerankers": ["<string>"],
"retrieval_top_k": 25,
"retrieval_top_k_window": [123],
"fts_weight": 0.7,
"semantic_weight": 0.3,
"rrf_k": 60,
"threshold_enabled": False,
"threshold": 0,
"reranker_type": "vertex",
"reranker_top_k": 10,
"reranker_threshold_enabled": False,
"reranker_threshold": 0,
"vertex_model": "semantic-ranker-512@latest",
"ingestion_info": "",
"batch_size": 8,
"default_chunk_size": 2048,
"default_chunk_overlap": 512,
"enrich_chunks_mode": "inject_summary",
"enrich_pre_made_qa": False,
"pdf_info": "",
"pdf_extract_images": True,
"pdf_chunk_size": 1024,
"pdf_chunk_overlap": 256,
"pdf_ocr_enabled": False,
"pdf_ocr_confidence": 0.7,
"pdf_ocr_language": "auto",
"text_info": "",
"text_chunking_enabled": True,
"text_chunk_size": 1024,
"text_chunk_overlap": 256,
"text_preserve_formatting": True,
"html_info": "",
"html_extract_text_only": True,
"html_include_tables": True,
"html_include_images": False,
"html_ingest_as_markdown": True,
"image_info": "",
"image_ocr_enabled": False,
"image_ocr_confidence": 0.7,
"csv_row_as_document": False,
"csv_include_headers": True,
"csv_auto_detect_delimiter": True,
"csv_delimiter": ",",
"csv_encoding": "utf-8",
"xlsx_row_as_document": False,
"xlsx_include_headers": True,
"tabular_ingest_all_rows": False,
"tabular_max_rows": 50000,
"embedding_model": [],
"embedding_dimension": 123,
"mm_embedding_model": []
},
"version": "<string>",
"meta": {}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
document_types: ['<string>'],
error: {},
summary: '<string>',
summary_embedding: [123],
needs_summary_update: true,
settings_: {
retrieval_info: '',
retrieval_method: 'hybrid_bm25',
reranking_enabled: false,
rerankers: ['<string>'],
retrieval_top_k: 25,
retrieval_top_k_window: [123],
fts_weight: 0.7,
semantic_weight: 0.3,
rrf_k: 60,
threshold_enabled: false,
threshold: 0,
reranker_type: 'vertex',
reranker_top_k: 10,
reranker_threshold_enabled: false,
reranker_threshold: 0,
vertex_model: 'semantic-ranker-512@latest',
ingestion_info: '',
batch_size: 8,
default_chunk_size: 2048,
default_chunk_overlap: 512,
enrich_chunks_mode: 'inject_summary',
enrich_pre_made_qa: false,
pdf_info: '',
pdf_extract_images: true,
pdf_chunk_size: 1024,
pdf_chunk_overlap: 256,
pdf_ocr_enabled: false,
pdf_ocr_confidence: 0.7,
pdf_ocr_language: 'auto',
text_info: '',
text_chunking_enabled: true,
text_chunk_size: 1024,
text_chunk_overlap: 256,
text_preserve_formatting: true,
html_info: '',
html_extract_text_only: true,
html_include_tables: true,
html_include_images: false,
html_ingest_as_markdown: true,
image_info: '',
image_ocr_enabled: false,
image_ocr_confidence: 0.7,
csv_row_as_document: false,
csv_include_headers: true,
csv_auto_detect_delimiter: true,
csv_delimiter: ',',
csv_encoding: 'utf-8',
xlsx_row_as_document: false,
xlsx_include_headers: true,
tabular_ingest_all_rows: false,
tabular_max_rows: 50000,
embedding_model: [],
embedding_dimension: 123,
mm_embedding_model: []
},
version: '<string>',
meta: {}
})
};
fetch('https://api.example.com/v1/knowledge-bases/{knowledge_base_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/v1/knowledge-bases/{knowledge_base_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'description' => '<string>',
'document_types' => [
'<string>'
],
'error' => [
],
'summary' => '<string>',
'summary_embedding' => [
123
],
'needs_summary_update' => true,
'settings_' => [
'retrieval_info' => '',
'retrieval_method' => 'hybrid_bm25',
'reranking_enabled' => false,
'rerankers' => [
'<string>'
],
'retrieval_top_k' => 25,
'retrieval_top_k_window' => [
123
],
'fts_weight' => 0.7,
'semantic_weight' => 0.3,
'rrf_k' => 60,
'threshold_enabled' => false,
'threshold' => 0,
'reranker_type' => 'vertex',
'reranker_top_k' => 10,
'reranker_threshold_enabled' => false,
'reranker_threshold' => 0,
'vertex_model' => 'semantic-ranker-512@latest',
'ingestion_info' => '',
'batch_size' => 8,
'default_chunk_size' => 2048,
'default_chunk_overlap' => 512,
'enrich_chunks_mode' => 'inject_summary',
'enrich_pre_made_qa' => false,
'pdf_info' => '',
'pdf_extract_images' => true,
'pdf_chunk_size' => 1024,
'pdf_chunk_overlap' => 256,
'pdf_ocr_enabled' => false,
'pdf_ocr_confidence' => 0.7,
'pdf_ocr_language' => 'auto',
'text_info' => '',
'text_chunking_enabled' => true,
'text_chunk_size' => 1024,
'text_chunk_overlap' => 256,
'text_preserve_formatting' => true,
'html_info' => '',
'html_extract_text_only' => true,
'html_include_tables' => true,
'html_include_images' => false,
'html_ingest_as_markdown' => true,
'image_info' => '',
'image_ocr_enabled' => false,
'image_ocr_confidence' => 0.7,
'csv_row_as_document' => false,
'csv_include_headers' => true,
'csv_auto_detect_delimiter' => true,
'csv_delimiter' => ',',
'csv_encoding' => 'utf-8',
'xlsx_row_as_document' => false,
'xlsx_include_headers' => true,
'tabular_ingest_all_rows' => false,
'tabular_max_rows' => 50000,
'embedding_model' => [
],
'embedding_dimension' => 123,
'mm_embedding_model' => [
]
],
'version' => '<string>',
'meta' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/knowledge-bases/{knowledge_base_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"document_types\": [\n \"<string>\"\n ],\n \"error\": {},\n \"summary\": \"<string>\",\n \"summary_embedding\": [\n 123\n ],\n \"needs_summary_update\": true,\n \"settings_\": {\n \"retrieval_info\": \"\",\n \"retrieval_method\": \"hybrid_bm25\",\n \"reranking_enabled\": false,\n \"rerankers\": [\n \"<string>\"\n ],\n \"retrieval_top_k\": 25,\n \"retrieval_top_k_window\": [\n 123\n ],\n \"fts_weight\": 0.7,\n \"semantic_weight\": 0.3,\n \"rrf_k\": 60,\n \"threshold_enabled\": false,\n \"threshold\": 0,\n \"reranker_type\": \"vertex\",\n \"reranker_top_k\": 10,\n \"reranker_threshold_enabled\": false,\n \"reranker_threshold\": 0,\n \"vertex_model\": \"semantic-ranker-512@latest\",\n \"ingestion_info\": \"\",\n \"batch_size\": 8,\n \"default_chunk_size\": 2048,\n \"default_chunk_overlap\": 512,\n \"enrich_chunks_mode\": \"inject_summary\",\n \"enrich_pre_made_qa\": false,\n \"pdf_info\": \"\",\n \"pdf_extract_images\": true,\n \"pdf_chunk_size\": 1024,\n \"pdf_chunk_overlap\": 256,\n \"pdf_ocr_enabled\": false,\n \"pdf_ocr_confidence\": 0.7,\n \"pdf_ocr_language\": \"auto\",\n \"text_info\": \"\",\n \"text_chunking_enabled\": true,\n \"text_chunk_size\": 1024,\n \"text_chunk_overlap\": 256,\n \"text_preserve_formatting\": true,\n \"html_info\": \"\",\n \"html_extract_text_only\": true,\n \"html_include_tables\": true,\n \"html_include_images\": false,\n \"html_ingest_as_markdown\": true,\n \"image_info\": \"\",\n \"image_ocr_enabled\": false,\n \"image_ocr_confidence\": 0.7,\n \"csv_row_as_document\": false,\n \"csv_include_headers\": true,\n \"csv_auto_detect_delimiter\": true,\n \"csv_delimiter\": \",\",\n \"csv_encoding\": \"utf-8\",\n \"xlsx_row_as_document\": false,\n \"xlsx_include_headers\": true,\n \"tabular_ingest_all_rows\": false,\n \"tabular_max_rows\": 50000,\n \"embedding_model\": [],\n \"embedding_dimension\": 123,\n \"mm_embedding_model\": []\n },\n \"version\": \"<string>\",\n \"meta\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.example.com/v1/knowledge-bases/{knowledge_base_id}")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"document_types\": [\n \"<string>\"\n ],\n \"error\": {},\n \"summary\": \"<string>\",\n \"summary_embedding\": [\n 123\n ],\n \"needs_summary_update\": true,\n \"settings_\": {\n \"retrieval_info\": \"\",\n \"retrieval_method\": \"hybrid_bm25\",\n \"reranking_enabled\": false,\n \"rerankers\": [\n \"<string>\"\n ],\n \"retrieval_top_k\": 25,\n \"retrieval_top_k_window\": [\n 123\n ],\n \"fts_weight\": 0.7,\n \"semantic_weight\": 0.3,\n \"rrf_k\": 60,\n \"threshold_enabled\": false,\n \"threshold\": 0,\n \"reranker_type\": \"vertex\",\n \"reranker_top_k\": 10,\n \"reranker_threshold_enabled\": false,\n \"reranker_threshold\": 0,\n \"vertex_model\": \"semantic-ranker-512@latest\",\n \"ingestion_info\": \"\",\n \"batch_size\": 8,\n \"default_chunk_size\": 2048,\n \"default_chunk_overlap\": 512,\n \"enrich_chunks_mode\": \"inject_summary\",\n \"enrich_pre_made_qa\": false,\n \"pdf_info\": \"\",\n \"pdf_extract_images\": true,\n \"pdf_chunk_size\": 1024,\n \"pdf_chunk_overlap\": 256,\n \"pdf_ocr_enabled\": false,\n \"pdf_ocr_confidence\": 0.7,\n \"pdf_ocr_language\": \"auto\",\n \"text_info\": \"\",\n \"text_chunking_enabled\": true,\n \"text_chunk_size\": 1024,\n \"text_chunk_overlap\": 256,\n \"text_preserve_formatting\": true,\n \"html_info\": \"\",\n \"html_extract_text_only\": true,\n \"html_include_tables\": true,\n \"html_include_images\": false,\n \"html_ingest_as_markdown\": true,\n \"image_info\": \"\",\n \"image_ocr_enabled\": false,\n \"image_ocr_confidence\": 0.7,\n \"csv_row_as_document\": false,\n \"csv_include_headers\": true,\n \"csv_auto_detect_delimiter\": true,\n \"csv_delimiter\": \",\",\n \"csv_encoding\": \"utf-8\",\n \"xlsx_row_as_document\": false,\n \"xlsx_include_headers\": true,\n \"tabular_ingest_all_rows\": false,\n \"tabular_max_rows\": 50000,\n \"embedding_model\": [],\n \"embedding_dimension\": 123,\n \"mm_embedding_model\": []\n },\n \"version\": \"<string>\",\n \"meta\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/knowledge-bases/{knowledge_base_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"document_types\": [\n \"<string>\"\n ],\n \"error\": {},\n \"summary\": \"<string>\",\n \"summary_embedding\": [\n 123\n ],\n \"needs_summary_update\": true,\n \"settings_\": {\n \"retrieval_info\": \"\",\n \"retrieval_method\": \"hybrid_bm25\",\n \"reranking_enabled\": false,\n \"rerankers\": [\n \"<string>\"\n ],\n \"retrieval_top_k\": 25,\n \"retrieval_top_k_window\": [\n 123\n ],\n \"fts_weight\": 0.7,\n \"semantic_weight\": 0.3,\n \"rrf_k\": 60,\n \"threshold_enabled\": false,\n \"threshold\": 0,\n \"reranker_type\": \"vertex\",\n \"reranker_top_k\": 10,\n \"reranker_threshold_enabled\": false,\n \"reranker_threshold\": 0,\n \"vertex_model\": \"semantic-ranker-512@latest\",\n \"ingestion_info\": \"\",\n \"batch_size\": 8,\n \"default_chunk_size\": 2048,\n \"default_chunk_overlap\": 512,\n \"enrich_chunks_mode\": \"inject_summary\",\n \"enrich_pre_made_qa\": false,\n \"pdf_info\": \"\",\n \"pdf_extract_images\": true,\n \"pdf_chunk_size\": 1024,\n \"pdf_chunk_overlap\": 256,\n \"pdf_ocr_enabled\": false,\n \"pdf_ocr_confidence\": 0.7,\n \"pdf_ocr_language\": \"auto\",\n \"text_info\": \"\",\n \"text_chunking_enabled\": true,\n \"text_chunk_size\": 1024,\n \"text_chunk_overlap\": 256,\n \"text_preserve_formatting\": true,\n \"html_info\": \"\",\n \"html_extract_text_only\": true,\n \"html_include_tables\": true,\n \"html_include_images\": false,\n \"html_ingest_as_markdown\": true,\n \"image_info\": \"\",\n \"image_ocr_enabled\": false,\n \"image_ocr_confidence\": 0.7,\n \"csv_row_as_document\": false,\n \"csv_include_headers\": true,\n \"csv_auto_detect_delimiter\": true,\n \"csv_delimiter\": \",\",\n \"csv_encoding\": \"utf-8\",\n \"xlsx_row_as_document\": false,\n \"xlsx_include_headers\": true,\n \"tabular_ingest_all_rows\": false,\n \"tabular_max_rows\": 50000,\n \"embedding_model\": [],\n \"embedding_dimension\": 123,\n \"mm_embedding_model\": []\n },\n \"version\": \"<string>\",\n \"meta\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"group_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"description": "<string>",
"document_types": [
"<string>"
],
"size": 123,
"num_docs": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"error": {},
"total_documents": 123,
"training_documents": 123,
"trained_documents": 123,
"error_documents": 123,
"uploaded_documents": 123,
"source_types": {},
"training_source_types": [
"<string>"
],
"meta": {},
"embedding_health": {
"healthy": true,
"message": "",
"embedding_model": ""
},
"health": {
"detected_dim": 123,
"declared_dim": 123,
"message": "",
"action": ""
},
"settings_": {
"retrieval_info": "",
"retrieval_method": "hybrid_bm25",
"reranking_enabled": false,
"rerankers": [
"<string>"
],
"retrieval_top_k": 25,
"retrieval_top_k_window": [
123
],
"fts_weight": 0.7,
"semantic_weight": 0.3,
"rrf_k": 60,
"threshold_enabled": false,
"threshold": 0,
"reranker_type": "vertex",
"reranker_top_k": 10,
"reranker_threshold_enabled": false,
"reranker_threshold": 0,
"vertex_model": "semantic-ranker-512@latest",
"ingestion_info": "",
"batch_size": 8,
"default_chunk_size": 2048,
"default_chunk_overlap": 512,
"enrich_chunks_mode": "inject_summary",
"enrich_pre_made_qa": false,
"pdf_info": "",
"pdf_extract_images": true,
"pdf_chunk_size": 1024,
"pdf_chunk_overlap": 256,
"pdf_ocr_enabled": false,
"pdf_ocr_confidence": 0.7,
"pdf_ocr_language": "auto",
"text_info": "",
"text_chunking_enabled": true,
"text_chunk_size": 1024,
"text_chunk_overlap": 256,
"text_preserve_formatting": true,
"html_info": "",
"html_extract_text_only": true,
"html_include_tables": true,
"html_include_images": false,
"html_ingest_as_markdown": true,
"image_info": "",
"image_ocr_enabled": false,
"image_ocr_confidence": 0.7,
"csv_row_as_document": false,
"csv_include_headers": true,
"csv_auto_detect_delimiter": true,
"csv_delimiter": ",",
"csv_encoding": "utf-8",
"xlsx_row_as_document": false,
"xlsx_include_headers": true,
"tabular_ingest_all_rows": false,
"tabular_max_rows": 50000,
"embedding_model": [],
"embedding_dimension": 123,
"mm_embedding_model": []
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Body
application/json
Available options:
created, trained, training, error Available options:
temporary, entity Show child attributes
Show child attributes
Response
Successful Response
Available options:
created, trained, training, error Available options:
temporary, entity Available options:
v2, v3 Show child attributes
Show child attributes
Show child attributes
Show child attributes
Structural health of a v3 knowledge base, computed at request time.
Returned on every GET /kbs/{id} so the FE can surface an inline
banner + CTA when the KB needs repair. Four concrete issues can be
detected by KBManagementService.compute_health:
vector_table_missing— pgvector table was never created or was dropped out from under us. Repair rebuilds the table at the declared dim and queues every document for re-ingestion.index_struct_missing— the pgvector table is present but the kirbyindex_structrow is absent. Repair rebuilds the struct anchored to the existing column; no documents need reprocessing.dim_drift— declared dim no longer matches the pgvector column width. Retrieval still works against the actual dim, but new INSERTs fail. Repair recreates the table at the declared dim and queues every document for re-ingestion.resolver_error— the resolver itself failed (DB outage, unexpected column type). Not a repair-able state; the user is asked to retry later. HTTP stays 200 so the FE can render the apology inline instead of a blank error page.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I