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

Handling of the request size #5

Open
emartynov opened this issue Feb 20, 2023 · 3 comments
Open

Handling of the request size #5

emartynov opened this issue Feb 20, 2023 · 3 comments

Comments

@emartynov
Copy link

Hi people,

I've played a bit with the library and found a couple of inconveniences.

The obvious - if you pass a big text to translate, it is impossible to guess when you will get an error response that the size of the request is over the limit. I know it is 128k but the headers and other data are probably included in the calculation. As the client, I need help determining when to split the data.

@JanEbbing
Copy link
Member

Hi @emartynov , we don't have a good solution for this yet unfortunately, we are thinking about a good interface for this.
Until we release that, does it work for you to reserve a few K for the headers and send at most 128K-<estimated_header_size> of text?

@emartynov
Copy link
Author

Is there a way to estimate header section size? Do you also wrap data in some other format in the body of the request?

As for now, I just set that string for the translation should not to be more than 100K.

@JanEbbing
Copy link
Member

That is the way we currently recommend. 120k text size should be fine in our experience - it's hard to give an estimate of header sizes on our end due to proxys etc.

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