POST
/
knowledge
from opperai import Opper
import time

opper = Opper(http_bearer="YOUR_API_KEY")

# Create a new knowledge base
unique_name = f"company_docs_{int(time.time())}"
knowledge_base = opper.knowledge.create_base(
    name=unique_name,
    embedding_model="azure/text-embedding-3-large",
)

print(f"Created knowledge base: {knowledge_base.name}")
print(f"ID: {knowledge_base.id}")
print(f"Embedding model: {knowledge_base.embedding_model}")
print(f"Created at: {knowledge_base.created_at}")
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "name": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "embedding_model": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Response

200
application/json

Successful Response

The response is of type object.