Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limitation of allowed selected characters per query #13

Open
without-qualities opened this issue May 16, 2024 · 1 comment
Open

Limitation of allowed selected characters per query #13

without-qualities opened this issue May 16, 2024 · 1 comment

Comments

@without-qualities
Copy link

If I try to translate a longer section, the translation doesn't go through and following message appears:

"Please try again with a shorter text"

As far as I understand the free version of the DeepL API key allows for 500000 chars/month. Is there an additional limit per query, or this is a limitation of obsidian or the plugin?

@dario-baumberger
Copy link
Contributor

dario-baumberger commented May 21, 2024

I'm not the developer of this Plugin. I just contribute a small part. I had a look at the code.

The message "Please try again with a shorter text" is implemented by the DeepL Plugin:

case DeepLErrorCodes.PAYLOAD_TOO_LARGE:
exception.message = "Please try again with a shorter text";
break;

This message corresponds to the error code 413:

PAYLOAD_TOO_LARGE = 413,

Error code 413 is returned from DeepL API:
https://support.deepl.com/hc/en-us/articles/9773964275868-DeepL-API-error-messages:

Error 413
The request size exceeds the limit
This error occurs when the request size reaches the supported limit.
Please consult the API documentation for detailed information about size limits, particularly for document translations.
If you are trying to translate a large text in a single translation request, consider splitting it up into multiple requests, e.g., split it by paragraph.

To answer your question:
Based on the error code, the limit comes from the DeepL API. I have not seen any additional limitations from the plugin. Obsidian itself has nothing to do with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants