Vector Similarity Matching
Convert keywords to vectors and match to document IDs, perform vector retrieval and return top K results ranked by keyword similarity.
Request Method
POST
Request URL
https://api.gptbots.ai/v1/bot/detail
Request Authentication
See Overview for authentication details.
Request
Request Example
Request Headers
Field | Type | Description |
---|---|---|
Authorization | Bearer ${token} | Use |
Content-Type | application/json | Data type, set to |
Request Body
ld | Type | Required | Description |
---|---|---|---|
prompt | string | Yes | Keywords for vector similarity matching against documents in the bot. |
data_ids | array | No | Document IDs to match the keyword vectors against. Can specify multiple knowledge document IDs from bots. Defaults to all docs if empty. |
top_k | int | Yes | Number of top similar results to return after matching keywords to document IDs. Only 1-10 allowed. |
Response
Response Example
Success Response
Field | Type | Description |
---|---|---|
content | string | Snippet content. |
data_id | string | Source document ID. |
score | float | Similarity score. |
Failure Response
Field | Type | Description |
---|---|---|
code | int | Error code. |
message | string | Error details. |
Error Codes
ode | Message |
---|---|
40000 | Invalid parameter |
40127 | Developer authentication failed |
40332 | Documents queried cannot exceed 10 |
Last updated