POST
/
v4
/
knowledge-bases
/
{knowledge_base_id}
/
artifacts
/
{artifact_id}
/
chunks
import SGPClient from 'sgp';

const client = new SGPClient({
  apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});

async function main() {
  const chunk = await client.knowledgeBases.artifacts.chunks.create('knowledge_base_id', 'artifact_id', {
    chunk_position: 0,
    text: 'text',
  });

  console.log(chunk.id);
}

main();
{
  "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"
}

Authorizations

x-api-key
string
header
required

Path Parameters

knowledge_base_id
string
required
artifact_id
string
required

Body

application/json

Response

200
application/json

Successful Response

The response is of type object.