Pular para o conteúdo principal
POST
/
datastores
/
{id}
/
query
This endpoint gets the most similar document fragments for a given query.
curl --request POST \
  --url https://app.zappway.ai/api/datastores/{id}/query \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "query": "<string>",
  "topK": 123,
  "filters": {
    "custom_ids": [
      "<string>"
    ],
    "datasource_ids": [
      "<string>"
    ]
  }
}
'
[
  {
    "text": "<string>",
    "score": 123,
    "source": "<string>",
    "datasource_id": "<string>",
    "datasource_name": "<string>"
  }
]

Autorizações

Authorization
string
header
obrigatório

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

Parâmetros de caminho

id
string
obrigatório

ID of the datastore

Corpo

application/json
query
string
obrigatório

Query to ask your AI Employee.

topK
number

The maximum number of results to retrieve.

filters
object

Resposta

Success

text
string

Text of the document fragment.

score
number

Similarity score of the document fragment.

source
string

Source url of the document fragment.

datasource_id
string

ID of the datasource the document fragment belongs to.

datasource_name
string

Name of the datasource the document fragment belongs to.