Generate Document
POST
/v1/documents/generate
const url = 'https://api.cloud.agentums.ru/v1/documents/generate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"kind":"doc","prompt":"example","title":"","to":"docx"}'};
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/documents/generate \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "kind": "doc", "prompt": "example", "title": "", "to": "docx" }'Сгенерировать документ по запросу (docx по умолчанию, либо pdf).
Ставит Celery-задачу docgen.run; результат появится НОВЫМ объектом-файлом, когда
обработается (опрос /documents/status). Неизвестный формат → docx.
Authorizations
Заголовок раздела «Authorizations»Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Media typeapplication/json
DocGenRequest
Запрос на генерацию документа. kind — тип по смыслу (letter/report/contract/memo/doc);
to — формат результата (docx по умолчанию или pdf); title — заголовок (опц.).
object
kind
Kind
string
prompt
required
Prompt
string
title
Title
string
to
To
string
Responses
Заголовок раздела «Responses»Successful Response
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" } ]}