import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const chunk = await client.knowledgeBases.artifacts.chunks.create('knowledge_base_id', 'artifact_id', {
chunk_position: 0,
text: 'text',
});
console.log(chunk.id);
{
"id": "<string>",
"text": "<string>",
"artifact_id": "<string>",
"chunk_position": 123,
"metadata": {},
"user_supplied_metadata": {},
"status": "Pending",
"status_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: 'My API Key',
});
const chunk = await client.knowledgeBases.artifacts.chunks.create('knowledge_base_id', 'artifact_id', {
chunk_position: 0,
text: 'text',
});
console.log(chunk.id);
{
"id": "<string>",
"text": "<string>",
"artifact_id": "<string>",
"chunk_position": 123,
"metadata": {},
"user_supplied_metadata": {},
"status": "Pending",
"status_reason": "<string>",
"created_at": "2023-11-07T05:31:56Z"
}
Successful Response
The response is of type object
.