Skip to main content
GET
/
v4
/
knowledge-bases
/
{knowledge_base_id}
/
artifacts
/
{artifact_id}
/
chunks
/
{chunk_id}
Python
import os
from scale_gp import SGPClient

client = SGPClient(
    api_key=os.environ.get("SGP_API_KEY"),  # This is the default and can be omitted
)
chunk = client.knowledge_bases.artifacts.chunks.retrieve(
    chunk_id="chunk_id",
    knowledge_base_id="knowledge_base_id",
    artifact_id="artifact_id",
)
print(chunk.id)
{
  "id": "<string>",
  "text": "<string>",
  "artifact_id": "<string>",
  "chunk_position": 123,
  "status": "Pending",
  "metadata": {},
  "user_supplied_metadata": {},
  "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
chunk_id
string
required

Response

Successful Response

id
string
required

The id of the chunk

text
string
required

The text of the chunk as stored in the database

artifact_id
string
required

The id of the artifact

chunk_position
integer
required

Chunk position

status
enum<string>
required

Status of the chunk. If Failed or Pending, its possible that the chunk does not reflect in OpenSearch

Available options:
Pending,
Completed,
Failed
metadata
Metadata · object

Metadata of the chunk which is stored in OpenSearch

user_supplied_metadata
User Supplied Metadata · object

Metadata of the chunk which is stored in the database only provided via custom chunking.

status_reason
string

Status reason of the chunk. May be successful

created_at
string<date-time>

Date and time of chunk creation