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"
}Crie uma nova tabela com o esquema especificado.
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"
}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>.
Esta página foi útil?