Skip to main content
POST
/
v4
/
knowledge-bases
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
)
create_knowledge_base_response = client.knowledge_bases.create(
    embedding_config={
        "model_deployment_id": "model_deployment_id",
        "type": "models_api",
    },
    knowledge_base_name="knowledge_base_name",
)
print(create_knowledge_base_response.knowledge_base_id)
{
  "knowledge_base_id": "<string>"
}

Authorizations

x-api-key
string
header
required

Body

application/json
embedding_config
EmbeddingConfigModelsAPI · object
required

The configuration of the embedding

knowledge_base_name
string
required

A unique name for the knowledge base

account_id
string

Account to create knowledge base in. If you have access to more than one account, you must specify an account_id

metadata
Metadata · object

Metadata associated with the knowledge base

kb_index_configuration
KBIndexConfiguration · object

Configuration for metadata schema in the knowledge base, including field definitions and index settings

Response

Successful Response

knowledge_base_id
string
required

The unique ID of the created knowledge base