digitalpulsebe / craft-multi-translator

Translate Entry content using external services
Other
0 stars 1 forks source link

GPT Timeouts #10

Closed wmdhosting closed 2 months ago

wmdhosting commented 2 months ago

I just started to use translation with GPT 4 >> i have paid account.

WHen translating single entry with sidebar iz works but i get often..
cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.openai.com/v1/chat/completions

When i try multiple entry .. everytime is failed.. cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.openai.com/v1/chat/completions

I then tested same API key with Content buddy plugin.. and dont get timouts..

Any idea..

wmdhosting commented 2 months ago

Tryed with google API.. too>> work ok for single entry..

Multiple entries.. goes to queue . with message translating >>> but noting translated.. and no error in queve..

DeepL didnt tested as not supoorting source lang..

JodebaDigitalPulse commented 2 months ago

Hi, can you provide some context please? What are the source and destination language? How large is the content, and what types of fields are they in?

You can enable some logging, add a file config/multi-translator.php

<?php

return [
    "debug" => true,
];

Maybe it will provide a clue.

In my tests the Chat-GPT api is always the slowest to respond, but 30s is really long.

wmdhosting commented 2 months ago

Thx for quick response..


Seems logs only works when translating with queve multiple items

Here is log for GPT. and Google. when multipel items selected..

Google says it trasnlated everythign. but data is not replaced in entry even Date updated is changed for entries.. works only in entry mode.. 1 by 1. mode

I have Title field and 2 CK editor fields.. basicly..

I translate from Croatian to English..

2024-06-12_15-52-15

As much i see from logs..

Perhaps will be great to add option to skip SEOmatic fileds.. as there is nothing to translate..

and relations fields.. Categories.. /Tags..

I use entries for that..

And skip images filed too.. as that is not translated anyway..

JodebaDigitalPulse commented 2 months ago

Hi @wmdhosting, I'll test with your data as soon as possible. But you can already delete the log file, as it contains the keys. (Best way is to use environment variables for this, by the way)

Not everything from the SEOmatic is processed in the translation, but a lot of data is just dumped by $entry->getSerializedFieldValues(), so don't worry about that.

It seems you have a lot of fields marked as translatable. Relation fields do not always need to be translatable when the related Entries are translated on their own. Just a tip, because this should not affect the translation either.

Looks like there is a lot of inline styles in the HTML field, so I'll test if that is an issue. The plugin can not process the html, so it is up to the service (ChatGPT) to process the html correctly, but I guess they'll have their limits as well.

wmdhosting commented 2 months ago

OK: thx..

I can use Google. too.. and it work well entry by entry..

But do not work by queuve .. that is much faster and better way to doit. if you have many entries..

I have started using this new.. ELemnets on CK editor but on this test translation. didnt use any in CK editor..

It just simple table.. i imported from Redactor..

JodebaDigitalPulse commented 2 months ago

Hi,

I might have a clue why translating in bulk (multiple by queue) does not work. You said you wanted to translate from Croatian to English. But in the logs I see you are translating from English (with Croatian content) to Croatian.

So beware: when translating in bulk, you should be on the source language and select the target in the dropdown. (when translating one by one, it is the other way around: you select the source on the target site)

I tested with your content, to use the Chat-GPT service, I took a long time, but never 30s. Are you ok for using the Google service, or should I go deeper in to this?

wmdhosting commented 2 months ago

Ok will use Google.

Yes. this translate buttons get me little confused.. :)

I did allready have content on english site.. but was croatian content.. waiting to be translated

So seems i tryed all inverse.. :)

JodebaDigitalPulse commented 2 months ago

Hi, @wmdhosting, so everything is working? 🙂

wmdhosting commented 2 months ago

I started to think inverse..:) so all works ok :)

With Google.