# Training

{% hint style="info" %}
**API SUBPATH**: eva-training
{% endhint %}

The Training APIs are as simple as it can be - Both contain 3 methods, one for listing, one that requests a new training, and a last one which discerns whether a training should be available as of now.\
\
If you send a trainign request while the /training-availability does not inform it's available, the training proccess will fail at the nlp.

## Standard Training

{% openapi src="/files/zuUy3RXHfis7RMp21brA" path="/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/training" method="post" %}
[eva-training-4.7.0-20241126.1830.yaml](https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2F7IYTPozkzi25uSrM4Pex%2Feva-training-4.7.0-20241126.1830.yaml?alt=media\&token=069c1b94-b1ce-4633-9b16-0209ac3313cc)
{% endopenapi %}

{% openapi src="/files/zuUy3RXHfis7RMp21brA" path="/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/training/training-availability" method="get" %}
[eva-training-4.7.0-20241126.1830.yaml](https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2F7IYTPozkzi25uSrM4Pex%2Feva-training-4.7.0-20241126.1830.yaml?alt=media\&token=069c1b94-b1ce-4633-9b16-0209ac3313cc)
{% endopenapi %}

{% openapi src="/files/zuUy3RXHfis7RMp21brA" path="/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/training/list" method="get" %}
[eva-training-4.7.0-20241126.1830.yaml](https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2F7IYTPozkzi25uSrM4Pex%2Feva-training-4.7.0-20241126.1830.yaml?alt=media\&token=069c1b94-b1ce-4633-9b16-0209ac3313cc)
{% endopenapi %}

## Knowledge AI Training

## POST /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/training/automated-learn

> Initiates training for automated learning.

```json
{"openapi":"3.0.1","info":{"title":"eva-training API Documentation","version":"4.8.0"},"tags":[{"name":"Trainings","description":"Management for finding Trainings and setting them up for training in their respectives MSs."}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/training/automated-learn":{"post":{"tags":["Trainings"],"summary":"Initiates training for automated learning.","operationId":"trainingAL","parameters":[{"name":"orgUUID","in":"path","description":"UUID of the organization","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"UUID of the environment","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"UUID of the bot","required":true,"schema":{"type":"string"}},{"name":"x-request-id","in":"header","description":"It is an identifier provided by the API client that will be used to identify distributed logs.","required":false,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KAITrainingRequestDTO"}}}},"responses":{"202":{"description":"Accepted","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TrainingAvailabilityDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"KAITrainingRequestDTO":{"type":"object","properties":{"windowsLength":{"type":"integer","description":"Optional. Maximum size of a chunk.","format":"int32"},"overlap":{"type":"integer","description":"Optional. Limit of overlapping characters between chunks. Bigger overlap preserves context but increases token usage.","format":"int32"},"filterCollectionUuids":{"type":"array","description":"Optional. A list of collectionUUIDs (Document groups) to train. If empty, it trains all documents instead.","items":{"type":"string","description":"Optional. A list of collectionUUIDs (Document groups) to train. If empty, it trains all documents instead."}},"filterDocumentIds":{"type":"array","description":"Optional. A list of documentIds to train. If empty, it trains all documents instead.","items":{"type":"string","description":"Optional. A list of documentIds to train. If empty, it trains all documents instead."}},"trainAllCollections":{"type":"boolean","description":"Flag to indicate if wants to train all collections from bot. If true, it will override filterCollectionUuids"}},"description":"Optional structure. used to add new rules into the training and bypass new fields into KAI's register-doc v2"},"TrainingAvailabilityDTO":{"type":"object","properties":{"trainingAvailable":{"type":"string","description":"It is the training state if it is possible to new train"},"currentTrainingUUID":{"type":"string","description":"The current trainingUUID if it is running any one. Null if there is not a training running"},"currentVersion":{"type":"integer","description":"The training current version","format":"int32"},"nextVersion":{"type":"integer","description":"The next number version","format":"int32"},"documentStatus":{"type":"string","description":"The document status of last training"}},"description":"Indicate if there is an ongoing training and if a new one is eligible. When a new value is eligible, the next version number and the number of last document trained will be sent"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

## GET /org/{orgUUID}/env/{envUUID}/bot/{botUUID}/training/automated-learn/availability

> Returns a TrainingAvailabilityDTO indicating wether there is an ongoing training and if a new one is elibigle. When a new value is eligible, the next version number will be sent instead.

```json
{"openapi":"3.0.1","info":{"title":"eva-training API Documentation","version":"4.8.0"},"tags":[{"name":"Trainings","description":"Management for finding Trainings and setting them up for training in their respectives MSs."}],"paths":{"/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/training/automated-learn/availability":{"get":{"tags":["Trainings"],"summary":"Returns a TrainingAvailabilityDTO indicating wether there is an ongoing training and if a new one is elibigle. When a new value is eligible, the next version number will be sent instead.","operationId":"getALAvailability","parameters":[{"name":"orgUUID","in":"path","description":"It is the organization uuid where the bot is.","required":true,"schema":{"type":"string"}},{"name":"envUUID","in":"path","description":"It is the environment uuid where the bot is.","required":true,"schema":{"type":"string"}},{"name":"botUUID","in":"path","description":"It is the identification of the bot.","required":true,"schema":{"type":"string"}},{"name":"collectionUUID","in":"query","description":"Optional collection UUID","required":false,"schema":{"type":"string"}},{"name":"anyCollection","in":"query","description":"A boolean flag indicating whether the operation should consider any collection or a specific one. When this flag is true, the collectionUUID will be disregarded","required":false,"schema":{"type":"boolean","default":false}},{"name":"checkKAIEnabled","in":"query","description":"A boolean flag indicating whether to check if the AI feature is enabled.","required":false,"schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"Ok","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TrainingAvailabilityDTO"}}}},"400":{"description":"Bad Request","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"401":{"description":"Unauthorized","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"403":{"description":"Forbidden","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"404":{"description":"Not Found","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"408":{"description":"Request Timeout","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"409":{"description":"Conflict","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}},"422":{"description":"Unprocessable Entity","content":{"*/*":{"schema":{"oneOf":[{"$ref":"#/components/schemas/ValidationError"},{"$ref":"#/components/schemas/StandardError"}]}}}},"500":{"description":"Internal Server Error","content":{"*/*":{"schema":{"$ref":"#/components/schemas/StandardError"}}}}}}}},"components":{"schemas":{"TrainingAvailabilityDTO":{"type":"object","properties":{"trainingAvailable":{"type":"string","description":"It is the training state if it is possible to new train"},"currentTrainingUUID":{"type":"string","description":"The current trainingUUID if it is running any one. Null if there is not a training running"},"currentVersion":{"type":"integer","description":"The training current version","format":"int32"},"nextVersion":{"type":"integer","description":"The next number version","format":"int32"},"documentStatus":{"type":"string","description":"The document status of last training"}},"description":"Indicate if there is an ongoing training and if a new one is eligible. When a new value is eligible, the next version number and the number of last document trained will be sent"},"StandardError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"}}},"ValidationError":{"type":"object","properties":{"timestamp":{"type":"integer","format":"int64"},"errorCode":{"type":"string"},"errorType":{"type":"string","enum":["API_ERROR","API_INFO","USER_ERROR"]},"message":{"type":"string"},"path":{"type":"string"},"details":{"type":"array","items":{"$ref":"#/components/schemas/FieldMessage"}}}},"FieldMessage":{"type":"object","properties":{"fieldName":{"type":"string"},"message":{"type":"string"},"errorCode":{"type":"string"}}}}}}
```

{% openapi src="/files/zuUy3RXHfis7RMp21brA" path="/org/{orgUUID}/env/{envUUID}/bot/{botUUID}/training/automated-learn" method="get" %}
[eva-training-4.7.0-20241126.1830.yaml](https://4008706377-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fn6zS4HeuuVpRHZEvDiFU%2Fuploads%2F7IYTPozkzi25uSrM4Pex%2Feva-training-4.7.0-20241126.1830.yaml?alt=media\&token=069c1b94-b1ce-4633-9b16-0209ac3313cc)
{% endopenapi %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.conversational-ai.syntphony.com/user-guide/api-docs/api-guidelines/management-api/instance-api/training.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
