This page covers management of Semantic cells
Object Overview
Endpoint, URL, and Supported Methods
Objects are managed via the storage server API at [http|https]\://[hostname]\:[port]/v1.0/tenants/[tenant-guid]/vectorrepositories/[vector-repository-guid]/documents/[document-guid]/cells
.
Supported methods include: GET ``HEAD
Structure
{
"GUID": "b3f62afc-215c-45b5-88cd-678d0fe5a1e2",
"CellType": "Paragraph",
"MD5Hash": "a94a8fe5ccb19ba61c4c0873d391e987",
"SHA1Hash": "1f8ac10f23c5b5bc1167bda84b833e5c057a77d2",
"SHA256Hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
"Position": 0,
"Length": 120,
"Chunks": [],
"Children": []
}
Properties:
GUID
string
unique identifier for the semantic cell (may be auto-generated if not provided)
CellType
string
type of the semantic cell, such as Paragraph, Sentence, Section, etc.
MD5Hash
string
MD5 hash of the content within the cell
SHA1Hash
string
SHA1 hash of the content within the cell
SHA256Hash
string
SHA256 hash of the content within the cell
Position
number
starting position of the cell within the original content
Length
number
length (in characters or bytes) of the semantic cell
Chunks
array
list of content chunks within this semantic cell
Children
array
nested SemanticCell instances representing hierarchical structure
Read semantic cells
To Read semantic cells, call GET/v1.0/tenants/[tenant-guid]/vectorrepositories/[vector-repository-guid]/documents/[documentguid]/cells
curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/vectorrepositories/00000000-0000-0000-0000-000000000000/documents/00000000-0000-0000-0000-000000000000/cells' \
--header 'Authorization: ••••••' \
--data ''
import { ViewVectorProxySdk } from "view-sdk";
const vector = new ViewVectorProxySdk(
"00000000-0000-0000-0000-000000000000", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const readSematicCells = async () => {
try {
const response = await vector.retrieveSemanticCells(
"00000000-0000-0000-0000-000000000000",
"00000000-0000-0000-0000-000000000000"
);
console.log(response, "Read semantic cells response");
} catch (err) {
console.log("Error read semantic cells:", err);
}
};
readSematicCells();
Read semantic cell
To read a single semantic cell, call GET /v1.0/tenants/[tenant-guid]/vectorrepositories/[vector-repository-guid]/documents/[document-guid]/cells/[cell-guid]
curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/vectorrepositories/00000000-0000-0000-0000-000000000000/documents/00000000-0000-0000-0000-000000000000/cells/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••' \
--data ''
import { ViewVectorProxySdk } from "view-sdk";
const vector = new ViewVectorProxySdk(
"00000000-0000-0000-0000-000000000000", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const readSematicCell = async () => {
try {
const response = await vector.retrieveSemanticCell(
"00000000-0000-0000-0000-000000000000",
"00000000-0000-0000-0000-000000000000",
"00000000-0000-0000-0000-000000000000"
);
console.log(response, "Read semantic cell response");
} catch (err) {
console.log("Error read semantic cell:", err);
}
};
readSematicCell();
Semantic cell exists
To check semantic cell exist , call HEAD /v1.0/tenants/[tenant-guid]/vectorrepositories/[vector-repository-guid]/documents/[document-guid]/cells/[cell-guid]
curl --location --head 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/vectorrepositories/00000000-0000-0000-0000-000000000000/documents/00000000-0000-0000-0000-000000000000/cells/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••' \
--data ''
import { ViewVectorProxySdk } from "view-sdk";
const vector = new ViewVectorProxySdk(
"00000000-0000-0000-0000-000000000000", //tenant Id
"default", //access token
"http://localhost:8000/" //endpoint
);
const SemanticCellsExist = async () => {
try {
const response = await vector.semanticCellExists(
"00000000-0000-0000-0000-000000000000",
"00000000-0000-0000-0000-000000000000",
"00000000-0000-0000-0000-000000000000"
);
console.log(response, "Semantic cells exist response");
} catch (err) {
console.log("Error semantic cells exist:", err);
}
};
SemanticCellsExist();