Route Intent
POST
/v1/intent
const url = 'https://api.cloud.agentums.ru/v1/intent';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"query":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Заголовок раздела «Authorizations»Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typeapplication/json
IntentRequest
object
query
required
Query
string
Examplegenerated
{ "query": "example"}Responses
Заголовок раздела «Responses»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>
ValidationErrorobject
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" } ]}