Pular para o conteúdo 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"
}

Autorizações

Authorization
string
header
obrigatório

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>.

Corpo

application/json
name
string
obrigatório
schema
TableSchema · object
obrigatório

Resposta

Resposta Bem-Sucedida

table_name
string
obrigatório
schema
TableSchema · object
obrigatório
indices
IndexInfo · object[]
obrigatório