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.create(
artifact_id="artifact_id",
knowledge_base_id="knowledge_base_id",
chunk_position=0,
text="text",
)
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"
}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.create(
artifact_id="artifact_id",
knowledge_base_id="knowledge_base_id",
chunk_position=0,
text="text",
)
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"
}Successful Response
The id of the chunk
The text of the chunk as stored in the database
The id of the artifact
Chunk position
Status of the chunk. If Failed or Pending, its possible that the chunk does not reflect in OpenSearch
Pending, Completed, Failed Metadata of the chunk which is stored in OpenSearch
Metadata of the chunk which is stored in the database only provided via custom chunking.
Status reason of the chunk. May be successful
Date and time of chunk creation