wineater-bot 3.6.0 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wineater-chatbot.mjs +224 -224
- package/dist/wineater-chatbot.umd.js +18 -18
- package/package.json +1 -1
- package/src/js/i18n.js +2 -1
package/package.json
CHANGED
package/src/js/i18n.js
CHANGED
|
@@ -543,6 +543,7 @@ class Translator {
|
|
|
543
543
|
const config = await this.api.getStoreConfig(storeName);
|
|
544
544
|
this.storeLanguage = config.lang;
|
|
545
545
|
this.supportedLanguages = config.available_languages;
|
|
546
|
+
this.OpenAIApiKey = config.open_ai_key;
|
|
546
547
|
// ✅ Если язык уже сохранён в localStorage — использовать его
|
|
547
548
|
const storedLang = localStorage.getItem('selectedLanguage');
|
|
548
549
|
if (storedLang && this.translations[storedLang]) {
|
|
@@ -602,7 +603,7 @@ class Translator {
|
|
|
602
603
|
return textObject;
|
|
603
604
|
}
|
|
604
605
|
|
|
605
|
-
const apiKey =
|
|
606
|
+
const apiKey = this.OpenAIApiKey; // ✅ Заменить на твой реальный ключ
|
|
606
607
|
const url = 'https://api.openai.com/v1/chat/completions';
|
|
607
608
|
|
|
608
609
|
const headers = {
|