POST
/
v4
/
knowledge-bases
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 createKnowledgeBaseResponse = await client.knowledgeBases.create({
    embedding_config: { model_deployment_id: 'model_deployment_id', type: 'models_api' },
    knowledge_base_name: 'knowledge_base_name',
  });

  console.log(createKnowledgeBaseResponse.knowledge_base_id);
}

main();
{
  "knowledge_base_id": "<string>"
}

Authorizations

x-api-key
string
header
required

Body

application/json

Response

200
application/json
Successful Response

The response is of type object.