Перейти к содержимому

Route Intent

POST
/v1/intent
curl --request POST \
--url https://api.cloud.agentums.ru/v1/intent \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "query": "example" }'

Понять, чего человек хочет от свободной фразы: {action, target}.

Нужно клиентам с одним полем ввода — боту, виджету, — чтобы отличить «пришли мне договор» (выдать файл) от «что в договоре» (ответить по содержимому) до того, как звать дорогие маршруты. Сам ничего не ищет и не отвечает: только классифицирует.

Модель недоступна — 503; в этом случае разумно откатиться на обычный /ask.

Media typeapplication/json
IntentRequest
object
query
required
Query
string
Examplegenerated
{
"query": "example"
}

Successful Response

Media typeapplication/json
IntentResponse
object
action
required
Action
string
fmt
Fmt
string
""
lang
Lang
string
""
target
required
Target
string
Example
{
"fmt": "",
"lang": ""
}

Validation Error

Media typeapplication/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Examplegenerated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}