Heyhey! I was wondering if/when the documentation for this endpoint will be updated: https://develop
Heyhey!
I was wondering if/when the documentation for this endpoint will be updated:
https://developers.cloudflare.com/api/operations/workers-ai-post-run-model
The responses are not correct.
Successful responses return more than result, they also return a success, errors and messages code where I can only assume that the errors and messages content is strings (thou it might very well be status codes of some sort) and the result contains a model-specific response.
For example for the M2M100-1.2B translation model it is translated_text (which is somewhat documented in the api schema definition of the worker: https://developers.cloudflare.com/workers-ai/models/m2m100-1.2b/)
For unsuccessful responses thou, the result is really weird. On wrong input I got this for example:
{
"result": {
"translated_text": "ERROR: invalid source_lang (English)"
},
"success": true,
"errors": [],
"messages": []
}
which is, very confusing and odd to use. It says success, even thou there's an error. The errors section is empty. The messages section is empty and the message itsself is in the model result. :/
It is also unclear which input values for this model are allowed.
I found this (https://github.com/cloudflare/cloudflare-docs/blob/production/content/workers-ai/models/m2m100-1.2b.md), but it doesnt seem to list all languages.
I also found this (https://github.com/ikergarcia1996/Easy-Translate/blob/main/supported_languages.md#supported-languages-m2m100), but the cloudflare version only seems to work with flatcase conventions and the "ld" abbreviations. It's also unclear if these abbreviations follow ISO 639, some other standard or if they are arbitrary.
I was wondering if/when the documentation for this endpoint will be updated:
https://developers.cloudflare.com/api/operations/workers-ai-post-run-model
The responses are not correct.
Successful responses return more than result, they also return a success, errors and messages code where I can only assume that the errors and messages content is strings (thou it might very well be status codes of some sort) and the result contains a model-specific response.
For example for the M2M100-1.2B translation model it is translated_text (which is somewhat documented in the api schema definition of the worker: https://developers.cloudflare.com/workers-ai/models/m2m100-1.2b/)
For unsuccessful responses thou, the result is really weird. On wrong input I got this for example:
{
"result": {
"translated_text": "ERROR: invalid source_lang (English)"
},
"success": true,
"errors": [],
"messages": []
}
which is, very confusing and odd to use. It says success, even thou there's an error. The errors section is empty. The messages section is empty and the message itsself is in the model result. :/
It is also unclear which input values for this model are allowed.
I found this (https://github.com/cloudflare/cloudflare-docs/blob/production/content/workers-ai/models/m2m100-1.2b.md), but it doesnt seem to list all languages.
I also found this (https://github.com/ikergarcia1996/Easy-Translate/blob/main/supported_languages.md#supported-languages-m2m100), but the cloudflare version only seems to work with flatcase conventions and the "ld" abbreviations. It's also unclear if these abbreviations follow ISO 639, some other standard or if they are arbitrary.
Interact with Cloudflare's products and services via the Cloudflare API
GitHub
Easy-Translate is a script for translating large text files with a SINGLE COMMAND. Easy-Translate is designed to be as easy as possible for beginners and as seamlesscustomizable and as possible fo...