Saltar al contenido principal
POST
/
api
/
v1
/
search
/
tables
Python (SDK)
from openapi import SDK


with SDK(
    bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:

    res = sdk.search.tables.create_table(name="support_kb", schema={
        "fields": [
            {
                "name": "id",
                "nullable": False,
                "type": "string",
            },
            {
                "name": "content",
                "nullable": False,
                "type": "string",
                "index": "FTS",
            },
            {
                "name": "category",
                "nullable": False,
                "type": "string",
            },
            {
                "name": "rating",
                "nullable": True,
                "type": "float",
            },
            {
                "name": "embedding",
                "nullable": False,
                "type": "vector",
                "dimensions": 3,
            },
        ],
    })

    # Handle response
    print(res)
{
  "indices": [
    {
      "config": {
        "type": "FTS"
      },
      "field": "content",
      "index_type": "FTS"
    }
  ],
  "schema": {
    "fields": [
      {
        "name": "id",
        "nullable": false,
        "type": "string"
      },
      {
        "index": "FTS",
        "name": "content",
        "nullable": false,
        "type": "string"
      },
      {
        "name": "category",
        "nullable": false,
        "type": "string"
      },
      {
        "name": "rating",
        "nullable": true,
        "type": "float"
      },
      {
        "dimensions": 3,
        "name": "embedding",
        "nullable": false,
        "type": "vector"
      }
    ]
  },
  "table_name": "support_kb"
}

Autorizaciones

Authorization
string
header
requerido

Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.

Cuerpo

application/json
name
string
requerido
schema
TableSchema · object
requerido

Respuesta

Respuesta exitosa

table_name
string
requerido
schema
TableSchema · object
requerido
indices
IndexInfo · object[]
requerido