Documents in API requests
Use documents in AI API requests
In order to use documents in the AI Request via the API, they must be converted into plain text.
The route for this is https:api.adacor.ai/v1/documentMarkdown/
Convert file to plain text
-
Authentication: Ensure that you have a valid bearer token for authentication. It is the same as for a chat request.
-
Prepare file: Select the file you want to convert to plain text.
-
API-Call:
- Method:
PUT - URL:
https:api.adacor.ai/v1/documentMarkdown/ - Header:
Content-Type: multipart/form-dataAuthorization: Bearer <your_bearer_token>
- Body:
- Add the file as binary data in the
documentfield, as defined in themultipart/form-datastandard.
- Add the file as binary data in the
- Method:
-
Response: After successful processing, you will receive the converted text as
text/plain.
Example-Response:
Document example.txt: """example content from file as plain text"""
You can add this text to the user part of your messages in the route https://api.adacor.ai/chat/privateai/v1/chat/completions to make the contents of the file available to the model.
Examples of how to use the route with different programming languages or console commands can be found in the API description at https://docs.adacor.ai/reference/put_v1-documentmarkdown
Updated about 1 month ago