From dfad0abd9b96a26bcbba0b1109a0b593fcca0e38 Mon Sep 17 00:00:00 2001 From: Evgenii Lazarev Date: Fri, 1 May 2026 13:01:16 +0300 Subject: [PATCH 1/4] =?UTF-8?q?Add=20tutorial:=20AI-=D1=81=D0=B5=D1=80?= =?UTF-8?q?=D0=B2=D0=B8=D1=81=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82?= =?UTF-8?q?=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=B8=D1=85=20=D0=BE=D1=82=D0=B2?= =?UTF-8?q?=D0=B5=D1=82=D0=BE=D0=B2=20=D0=BD=D0=B0=20=D0=BE=D1=82=D0=B7?= =?UTF-8?q?=D1=8B=D0=B2=D1=8B=20Wildberries?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds a new tutorial showing how to deploy an open-source service that auto-responds to Wildberries marketplace reviews using Cloud Functions and YandexGPT, triggered by a timer. Files: - ru/_tutorials/_tutorials_includes/wildberries-review-responder/{index,console,paid-resources}.md — actual tutorial body (overview, full step-by-step, paid resources list) - ru/functions/tutorials/wildberries-review-responder/{index,console}.md — entry shells under the Cloud Functions section - ru/tutorials/serverless/wildberries-review-responder/{index,console}.md — top-level shells under Tutorials -> Serverless - ru/functions/toc.yaml, ru/tutorials/toc.yaml — registration in both TOCs (mirrors the video-converting-queue pattern) The tutorial supports two deployment paths via a tabs block: 1. Serverless Framework (recommended) — one `serverless deploy` command creates the function, both service accounts (ai.languageModels.user for the function, functions.functionInvoker for the trigger) and the timer trigger from the manifest in serverless.yml. 2. Console — manual flow that creates the service accounts, function (uploaded as a zip), and timer trigger separately. Source code, tests, Dockerfile and Helm chart for the service live at https://github.com/eslazarev/ai-wildberries-review-responder (MIT). I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en --- .../wildberries-review-responder/console.md | 173 ++++++++++++++++++ .../wildberries-review-responder/index.md | 20 ++ .../paid-resources.md | 7 + ru/functions/toc.yaml | 6 + .../wildberries-review-responder/console.md | 11 ++ .../wildberries-review-responder/index.md | 8 + .../wildberries-review-responder/console.md | 11 ++ .../wildberries-review-responder/index.md | 8 + ru/tutorials/toc.yaml | 12 ++ 9 files changed, 256 insertions(+) create mode 100644 ru/_tutorials/_tutorials_includes/wildberries-review-responder/console.md create mode 100644 ru/_tutorials/_tutorials_includes/wildberries-review-responder/index.md create mode 100644 ru/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md create mode 100644 ru/functions/tutorials/wildberries-review-responder/console.md create mode 100644 ru/functions/tutorials/wildberries-review-responder/index.md create mode 100644 ru/tutorials/serverless/wildberries-review-responder/console.md create mode 100644 ru/tutorials/serverless/wildberries-review-responder/index.md diff --git a/ru/_tutorials/_tutorials_includes/wildberries-review-responder/console.md b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/console.md new file mode 100644 index 0000000000..ed0a2f88d3 --- /dev/null +++ b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/console.md @@ -0,0 +1,173 @@ +Чтобы развернуть сервис автоматических ответов на отзывы Wildberries: + +1. [Подготовьте облако к работе](#before-begin). +1. [Получите API-токен Wildberries](#wb-token). +1. [Подготовьте код](#prepare-code). +1. [Разверните сервис](#deploy) — одним из способов: через Serverless Framework (быстро, всё создаётся автоматически) или поэтапно через консоль управления (вручную). +1. [Проверьте работу сервиса](#test). + +Если созданные ресурсы вам больше не нужны, [удалите их](#clear-out). + + +## Подготовьте облако к работе {#before-begin} + +{% include [before-you-begin](../../../_tutorials/_tutorials_includes/before-you-begin.md) %} + + +### Необходимые платные ресурсы {#paid-resources} + +{% include [paid-resources](paid-resources.md) %} + + +## Получите API-токен Wildberries {#wb-token} + +API-токен Wildberries даёт сервису доступ к разделу отзывов в кабинете продавца. + +1. Перейдите в [кабинет продавца Wildberries](https://seller.wildberries.ru/). +1. Откройте раздел **Профиль** → **Настройки** → **Доступ к API**. +1. Создайте новый ключ с областью **Отзывы и вопросы** (Feedbacks). +1. Сохраните токен — он понадобится при развёртывании. + +Подробнее о токенах Wildberries см. в [официальной документации Wildberries для разработчиков](https://dev.wildberries.ru/openapi/api-information). + + +## Подготовьте код {#prepare-code} + +Клонируйте [репозиторий](https://github.com/eslazarev/ai-wildberries-review-responder) с исходным кодом сервиса: + +```bash +git clone https://github.com/eslazarev/ai-wildberries-review-responder.git +cd ai-wildberries-review-responder +``` + +В репозитории уже есть всё необходимое для развёртывания: + +* `src/` — исходный код приложения, построенный по гексагональной архитектуре. +* `requirements.txt` — список Python-зависимостей. +* `settings.yaml` — конфигурация по умолчанию: базовые URL, размер пачки отзывов, период запуска, шаблон промпта и системные инструкции для модели. +* `serverless.yml` — манифест Serverless Framework: описывает функцию, cron-триггер и оба сервисных аккаунта (`ai.languageModels.user` для функции и `{{ roles-functions-invoker }}` для триггера). + +Точка входа для {{ sf-name }} — `src.entrypoints.yandex_cloud_function.handler`. Внутри функции: + +1. Загружаются настройки из `settings.yaml` и переменных окружения. +1. Если переменная `LLM__API_KEY` пуста или равна `null`, в качестве токена для {{ yagpt-full-name }} используется IAM-токен сервисного аккаунта из `context.token`. +1. Wildberries-клиент получает список неотвеченных отзывов. +1. Для каждого отзыва строится промпт по шаблону из `settings.yaml`. +1. LLM возвращает текст ответа. +1. Wildberries-клиент публикует ответ. + + +## Разверните сервис {#deploy} + +Выберите подходящий способ развёртывания. + +{% list tabs group=instructions %} + +- Serverless Framework {#serverless} + + Этот способ создаёт **все** ресурсы — функцию, cron-триггер и оба сервисных аккаунта (`wb-responder-function-service-account` с ролью `ai.languageModels.user` и `wb-responder-trigger-service-account` с ролью `{{ roles-functions-invoker }}`) — одной командой согласно манифесту `serverless.yml`. + + Требуется установленный [Node.js 18+](https://nodejs.org) и [Serverless Framework 3](https://www.serverless.com/framework/docs/getting-started). + + 1. В корне клонированного репозитория установите зависимости: + + ```bash + npm install + ``` + + 1. Запустите развёртывание, передав API-токен Wildberries из шага [Получите API-токен Wildberries](#wb-token): + + ```bash + WILDBERRIES__API_TOKEN='ваш_wb_token' serverless deploy + ``` + + На этом развёртывание завершено. Переменная `LLM__API_KEY` по умолчанию равна `null` — функция использует IAM-токен сервисного аккаунта, создаваемого в этой же команде. + + 1. Чтобы изменить периодичность запуска, передайте переменную `WILDBERRIES__CHECK_EVERY_MINUTES` (значение в минутах, по умолчанию 30): + + ```bash + WILDBERRIES__CHECK_EVERY_MINUTES='15' WILDBERRIES__API_TOKEN='ваш_wb_token' serverless deploy + ``` + + 1. Чтобы использовать вместо {{ yagpt-name }} другую OpenAI-совместимую модель (OpenAI, Ollama и т. п.), задайте также `LLM__API_KEY`, при необходимости — `LLM__MODEL` и `LLM__BASE_URL`: + + ```bash + LLM__API_KEY='ваш_llm_api_key' WILDBERRIES__API_TOKEN='ваш_wb_token' serverless deploy + ``` + +- Консоль управления {#console} + + Если хочется собрать инфраструктуру вручную, повторите шаги ниже. Через консоль все ресурсы создаются по отдельности. + + **1. Создайте сервисные аккаунты.** + + 1. [Создайте](../../../iam/operations/sa/create.md) сервисный аккаунт с именем `wb-responder-function-sa` и [назначьте](../../../iam/operations/sa/assign-role-for-sa.md) ему роль `ai.languageModels.user` — функция использует его IAM-токен для обращения к {{ yagpt-name }}. + 1. [Создайте](../../../iam/operations/sa/create.md) второй сервисный аккаунт с именем `wb-responder-trigger-sa` и [назначьте](../../../iam/operations/sa/assign-role-for-sa.md) ему роль `{{ roles-functions-invoker }}` — от его имени cron-триггер будет вызывать функцию. + + **2. Создайте функцию.** + + 1. В [консоли управления]({{ link-console-main }}) перейдите в каталог, в котором хотите создать функцию. + 1. В списке сервисов выберите **{{ ui-key.yacloud.iam.folder.dashboard.label_serverless-functions }}**. + 1. Нажмите кнопку **{{ ui-key.yacloud.serverless-functions.list.button_create }}** и задайте имя `wb-responder-function`. + 1. В корне клонированного репозитория соберите ZIP-архив с папкой `src/` и файлами `requirements.txt`, `settings.yaml`: + + ```bash + zip -r wb-responder.zip src requirements.txt settings.yaml + ``` + + 1. Создайте версию функции с параметрами: + + * **{{ ui-key.yacloud.serverless-functions.item.editor.field_runtime }}** — `python312`. + * **{{ ui-key.yacloud.serverless-functions.item.editor.field_entry }}** — `src.entrypoints.yandex_cloud_function.handler`. + * **{{ ui-key.yacloud.serverless-functions.item.editor.field_resources-memory }}** — `512 {{ ui-key.yacloud.common.units.label_megabyte }}`. + * **{{ ui-key.yacloud.serverless-functions.item.editor.field_timeout }}** — `30`. + * **{{ ui-key.yacloud.serverless-functions.item.editor.field_code-source }}** — **{{ ui-key.yacloud.serverless-functions.item.editor.value_method-zip-file }}**, загрузите `wb-responder.zip`. + * **{{ ui-key.yacloud.forms.label_service-account-select }}** — `wb-responder-function-sa`. + + 1. Добавьте переменные окружения: + + * `WILDBERRIES__API_TOKEN` — токен Wildberries из шага [Получите API-токен Wildberries](#wb-token). + * `LLM__API_KEY` — оставьте пустым или задайте `null`, чтобы функция использовала IAM-токен сервисного аккаунта при работе с {{ yagpt-name }}. + + 1. Сохраните версию. + + **3. Создайте триггер-таймер.** + + 1. На странице сервиса **{{ ui-key.yacloud.iam.folder.dashboard.label_serverless-functions }}** перейдите на вкладку **{{ ui-key.yacloud.serverless-functions.switch_list-triggers }}** и нажмите **{{ ui-key.yacloud.serverless-functions.triggers.list.button_create }}**. + 1. В блоке **{{ ui-key.yacloud.serverless-functions.triggers.form.section_base }}** задайте: + + * Имя триггера — `wb-responder-trigger`. + * **{{ ui-key.yacloud.serverless-functions.triggers.form.field_type }}** — `{{ ui-key.yacloud.serverless-functions.triggers.form.label_timer }}`. + + 1. В блоке **Таймер** укажите cron-выражение, например `*/30 * * * ? *` — запуск каждые 30 минут. + 1. В блоке **{{ ui-key.yacloud.serverless-functions.triggers.form.section_function }}** выберите функцию `wb-responder-function`, тег версии `$latest` и сервисный аккаунт `wb-responder-trigger-sa`. + 1. Нажмите кнопку **{{ ui-key.yacloud.serverless-functions.triggers.form.button_create-trigger }}**. + +{% endlist %} + + +## Проверьте работу сервиса {#test} + +1. В кабинете продавца Wildberries убедитесь, что есть хотя бы один неотвеченный отзыв. +1. В [консоли управления]({{ link-console-main }}) откройте функцию `wb-responder-function` и нажмите **{{ ui-key.yacloud.serverless-functions.item.test-action.button_test-version }}** — функция выполнится разово, без ожидания триггера. +1. Откройте вкладку **{{ ui-key.yacloud.serverless-functions.item.switch_logs }}** и убедитесь, что в логах нет ошибок и видны записи о том, что отзывы обработаны. +1. Через несколько минут вернитесь в кабинет продавца Wildberries и проверьте, что у обработанных отзывов появились ответы. + +Если в логах появляются ошибки авторизации Wildberries (`401 Unauthorized`), убедитесь, что переменная окружения `WILDBERRIES__API_TOKEN` содержит токен с областью **Отзывы и вопросы**. + + +## Как удалить созданные ресурсы {#clear-out} + +Чтобы перестать платить за созданные ресурсы: + +1. Если разворачивали через Serverless Framework, удалите всё одной командой: + + ```bash + serverless remove + ``` + + В этом случае оставшиеся шаги выполнять не нужно. + +1. [Удалите](../../../functions/operations/trigger/trigger-delete.md) триггер `wb-responder-trigger`. +1. [Удалите](../../../functions/operations/function/function-delete.md) функцию `wb-responder-function`. +1. [Удалите](../../../iam/operations/sa/delete.md) сервисные аккаунты `wb-responder-function-sa` и `wb-responder-trigger-sa`. diff --git a/ru/_tutorials/_tutorials_includes/wildberries-review-responder/index.md b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/index.md new file mode 100644 index 0000000000..63adf16230 --- /dev/null +++ b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/index.md @@ -0,0 +1,20 @@ +# AI-сервис автоматических ответов на отзывы Wildberries + +Из этого руководства вы узнаете, как развернуть в {{ sf-full-name }} сервис, который автоматически отвечает на отзывы покупателей в кабинете продавца Wildberries с помощью большой языковой модели — например, [{{ yagpt-full-name }}]({{ yagpt-full-name }}). + +Сервис запускается по расписанию с помощью [таймера](../../../functions/concepts/trigger/timer.md): на каждом тике функция получает пачку неотвеченных отзывов через Wildberries Feedbacks API, генерирует индивидуальный ответ через LLM и публикует его обратно в Wildberries. + +Решение распространяется по лицензии MIT и доступно [в открытом репозитории](https://github.com/eslazarev/ai-wildberries-review-responder). Сервис работает на ваших ключах и не передаёт API-токен Wildberries третьим сторонам. + +Архитектура: + +* **{{ sf-name }}** выполняет код по расписанию, без необходимости держать постоянно работающий сервер. +* **Триггер-таймер** запускает функцию каждые N минут (по умолчанию 30). +* **{{ yagpt-full-name }}** генерирует тексты ответов — внутри {{ sf-name }} достаточно использовать IAM-токен сервисного аккаунта; явный API-ключ не требуется. +* **Wildberries Feedbacks API** — внешний источник данных и приёмник ответов. + +Развернуть сервис можно следующими способами: + +* [Консоль управления](console.md) — пошаговый сценарий через консоль {{ yandex-cloud }} или одной командой через Serverless Framework. + +> Чтобы узнать о ресурсах, которые тарифицируются при работе сервиса, см. раздел [Необходимые платные ресурсы](console.md#paid-resources). diff --git a/ru/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md new file mode 100644 index 0000000000..57343e1cd2 --- /dev/null +++ b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md @@ -0,0 +1,7 @@ +В стоимость поддержки сервиса входит: + +* плата за вызовы [функций](../../../functions/concepts/function.md) (см. [тарифы {{ sf-full-name }}](../../../functions/pricing.md)); +* плата за использование выбранной языковой модели (см. [тарифы {{ yagpt-full-name }}](../../../foundation-models/pricing.md)); +* плата за исходящий трафик из {{ sf-name }} (см. [тарифы {{ sf-full-name }}](../../../functions/pricing.md)). + +Wildberries Feedbacks API при работе в пределах лимитов кабинета продавца не тарифицируется. diff --git a/ru/functions/toc.yaml b/ru/functions/toc.yaml index 1ccb996e35..b44150f78b 100644 --- a/ru/functions/toc.yaml +++ b/ru/functions/toc.yaml @@ -431,6 +431,12 @@ items: href: tutorials/video-converting-queue/console.md - name: '{{ TF }}' href: tutorials/video-converting-queue/terraform.md + - name: AI-автоответчик на отзывы Wildberries + items: + - name: Обзор + href: tutorials/wildberries-review-responder/index.md + - name: Консоль управления + href: tutorials/wildberries-review-responder/console.md - name: Разработка пользовательской интеграции href: tutorials/api-gw-integration.md - name: Сокращатель ссылок diff --git a/ru/functions/tutorials/wildberries-review-responder/console.md b/ru/functions/tutorials/wildberries-review-responder/console.md new file mode 100644 index 0000000000..32553b5610 --- /dev/null +++ b/ru/functions/tutorials/wildberries-review-responder/console.md @@ -0,0 +1,11 @@ +--- +canonical: '{{ link-docs }}/tutorials/serverless/wildberries-review-responder/console' +noIndex: true +--- + +# AI-сервис автоматических ответов на отзывы Wildberries с помощью консоли управления + + +Чтобы развернуть [AI-сервис автоматических ответов на отзывы Wildberries](index.md) с помощью консоли управления {{ yandex-cloud }} или Serverless Framework: + +{% include [console](../../../_tutorials/_tutorials_includes/wildberries-review-responder/console.md) %} diff --git a/ru/functions/tutorials/wildberries-review-responder/index.md b/ru/functions/tutorials/wildberries-review-responder/index.md new file mode 100644 index 0000000000..58c6154599 --- /dev/null +++ b/ru/functions/tutorials/wildberries-review-responder/index.md @@ -0,0 +1,8 @@ +--- +canonical: '{{ link-docs }}/tutorials/serverless/wildberries-review-responder/' +noIndex: true +--- + +{% include [wildberries-review-responder](../../../_tutorials/_tutorials_includes/wildberries-review-responder/index.md) %} + +* [Консоль управления](console.md) — пошаговый сценарий через консоль управления {{ yandex-cloud }} или одной командой через Serverless Framework. diff --git a/ru/tutorials/serverless/wildberries-review-responder/console.md b/ru/tutorials/serverless/wildberries-review-responder/console.md new file mode 100644 index 0000000000..8378ac6d41 --- /dev/null +++ b/ru/tutorials/serverless/wildberries-review-responder/console.md @@ -0,0 +1,11 @@ +--- +title: AI-сервис автоматических ответов на отзывы Wildberries с помощью консоли управления +description: Следуя данному руководству, вы сможете развернуть AI-сервис автоматических ответов на отзывы Wildberries с помощью консоли управления {{ yandex-cloud }} или Serverless Framework. +--- + +# AI-сервис автоматических ответов на отзывы Wildberries с помощью консоли управления + + +Чтобы развернуть [AI-сервис автоматических ответов на отзывы Wildberries](index.md) с помощью консоли управления {{ yandex-cloud }} или Serverless Framework: + +{% include [console](../../../_tutorials/_tutorials_includes/wildberries-review-responder/console.md) %} diff --git a/ru/tutorials/serverless/wildberries-review-responder/index.md b/ru/tutorials/serverless/wildberries-review-responder/index.md new file mode 100644 index 0000000000..5f44776b8a --- /dev/null +++ b/ru/tutorials/serverless/wildberries-review-responder/index.md @@ -0,0 +1,8 @@ +--- +title: AI-сервис автоматических ответов на отзывы Wildberries +description: Следуя данному руководству, вы сможете развернуть в {{ sf-full-name }} сервис, который автоматически отвечает на отзывы покупателей в кабинете продавца Wildberries с помощью большой языковой модели — например, {{ yagpt-full-name }}. +--- + +{% include [wildberries-review-responder](../../../_tutorials/_tutorials_includes/wildberries-review-responder/index.md) %} + +* [Консоль управления](console.md) — пошаговый сценарий через консоль управления {{ yandex-cloud }} или одной командой через Serverless Framework. diff --git a/ru/tutorials/toc.yaml b/ru/tutorials/toc.yaml index 1227ee7ff1..11f7475123 100644 --- a/ru/tutorials/toc.yaml +++ b/ru/tutorials/toc.yaml @@ -927,6 +927,12 @@ items: href: serverless/video-converting-queue/console.md - name: '{{ TF }}' href: serverless/video-converting-queue/terraform.md + - name: AI-автоответчик на отзывы Wildberries + items: + - name: Обзор + href: serverless/wildberries-review-responder/index.md + - name: Консоль управления + href: serverless/wildberries-review-responder/console.md - name: >- Настройка печати с {{ cloud-desktop-name }} на локальный принтер в Linux @@ -1633,6 +1639,12 @@ items: href: serverless/video-converting-queue/console.md - name: Terraform href: serverless/video-converting-queue/terraform.md + - name: AI-автоответчик на отзывы Wildberries + items: + - name: Обзор + href: serverless/wildberries-review-responder/index.md + - name: Консоль управления + href: serverless/wildberries-review-responder/console.md - name: Разработка пользовательской интеграции в {{ api-gw-name }} href: serverless/api-gw-integration.md - name: Сокращатель ссылок From 43bf58c85188d9b7a39fd2425f7e9328d9082403 Mon Sep 17 00:00:00 2001 From: Evgenii Lazarev Date: Fri, 1 May 2026 13:10:03 +0300 Subject: [PATCH 2/4] Add EN mirror for the Wildberries review responder tutorial Mirrors the RU version added in the previous commit: - en/_tutorials/_tutorials_includes/wildberries-review-responder/{index,console,paid-resources}.md - en/functions/tutorials/wildberries-review-responder/{index,console}.md - en/tutorials/serverless/wildberries-review-responder/{index,console}.md - en/functions/toc.yaml + en/tutorials/toc.yaml registration in both Serverless backend sections (mirroring the video-converting-queue layout). --- .../wildberries-review-responder/console.md | 173 ++++++++++++++++++ .../wildberries-review-responder/index.md | 20 ++ .../paid-resources.md | 7 + en/functions/toc.yaml | 6 + .../wildberries-review-responder/console.md | 11 ++ .../wildberries-review-responder/index.md | 8 + .../wildberries-review-responder/console.md | 11 ++ .../wildberries-review-responder/index.md | 8 + en/tutorials/toc.yaml | 12 ++ 9 files changed, 256 insertions(+) create mode 100644 en/_tutorials/_tutorials_includes/wildberries-review-responder/console.md create mode 100644 en/_tutorials/_tutorials_includes/wildberries-review-responder/index.md create mode 100644 en/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md create mode 100644 en/functions/tutorials/wildberries-review-responder/console.md create mode 100644 en/functions/tutorials/wildberries-review-responder/index.md create mode 100644 en/tutorials/serverless/wildberries-review-responder/console.md create mode 100644 en/tutorials/serverless/wildberries-review-responder/index.md diff --git a/en/_tutorials/_tutorials_includes/wildberries-review-responder/console.md b/en/_tutorials/_tutorials_includes/wildberries-review-responder/console.md new file mode 100644 index 0000000000..3cfc21d075 --- /dev/null +++ b/en/_tutorials/_tutorials_includes/wildberries-review-responder/console.md @@ -0,0 +1,173 @@ +To deploy the auto-reply service for Wildberries reviews: + +1. [Get your cloud ready](#before-begin). +1. [Get a Wildberries API token](#wb-token). +1. [Get the source code](#prepare-code). +1. [Deploy the service](#deploy) — pick one of two paths: through the Serverless Framework (recommended, creates everything automatically) or step by step through the management console. +1. [Test the service](#test). + +If you no longer need the resources, [delete them](#clear-out). + + +## Get your cloud ready {#before-begin} + +{% include [before-you-begin](../../../_tutorials/_tutorials_includes/before-you-begin.md) %} + + +### Required paid resources {#paid-resources} + +{% include [paid-resources](paid-resources.md) %} + + +## Get a Wildberries API token {#wb-token} + +The Wildberries API token grants the service access to the reviews section of your seller dashboard. + +1. Go to the [Wildberries seller dashboard](https://seller.wildberries.ru/). +1. Open **Profile** → **Settings** → **API access**. +1. Create a new key with the **Reviews and questions** (Feedbacks) scope. +1. Save the token — you will need it during deployment. + +For more details about Wildberries tokens, see the [official Wildberries developer documentation](https://dev.wildberries.ru/openapi/api-information). + + +## Get the source code {#prepare-code} + +Clone the [repository](https://github.com/eslazarev/ai-wildberries-review-responder) with the service source code: + +```bash +git clone https://github.com/eslazarev/ai-wildberries-review-responder.git +cd ai-wildberries-review-responder +``` + +The repository already contains everything required for deployment: + +* `src/` — the application source code, organized as a hexagonal architecture. +* `requirements.txt` — Python dependency list. +* `settings.yaml` — default configuration: base URLs, review batch size, run interval, prompt template, and system instructions for the model. +* `serverless.yml` — Serverless Framework manifest describing the function, the cron trigger, and both service accounts (`ai.languageModels.user` for the function and `{{ roles-functions-invoker }}` for the trigger). + +The {{ sf-name }} entry point is `src.entrypoints.yandex_cloud_function.handler`. Inside the function: + +1. Settings are loaded from `settings.yaml` and environment variables. +1. If the `LLM__API_KEY` variable is empty or `null`, the IAM token of the service account from `context.token` is used as the {{ yagpt-full-name }} token. +1. The Wildberries client fetches the list of unanswered reviews. +1. For each review, a prompt is rendered from the template in `settings.yaml`. +1. The LLM returns the reply text. +1. The Wildberries client publishes the reply. + + +## Deploy the service {#deploy} + +Pick the deployment path that fits you. + +{% list tabs group=instructions %} + +- Serverless Framework {#serverless} + + This path provisions **all** resources — the function, the cron trigger, and both service accounts (`wb-responder-function-service-account` with the `ai.languageModels.user` role and `wb-responder-trigger-service-account` with the `{{ roles-functions-invoker }}` role) — with a single command, following the manifest in `serverless.yml`. + + Requires [Node.js 18+](https://nodejs.org) and [Serverless Framework 3](https://www.serverless.com/framework/docs/getting-started). + + 1. From the root of the cloned repository install the dependencies: + + ```bash + npm install + ``` + + 1. Run the deployment, passing the Wildberries API token from the [Get a Wildberries API token](#wb-token) step: + + ```bash + WILDBERRIES__API_TOKEN='your_wb_token' serverless deploy + ``` + + The deployment is now complete. The `LLM__API_KEY` variable defaults to `null`, so the function will use the IAM token of the service account created by the same command. + + 1. To change the run interval, pass the `WILDBERRIES__CHECK_EVERY_MINUTES` variable (in minutes, default `30`): + + ```bash + WILDBERRIES__CHECK_EVERY_MINUTES='15' WILDBERRIES__API_TOKEN='your_wb_token' serverless deploy + ``` + + 1. To use an OpenAI-compatible model (OpenAI, Ollama, etc.) instead of {{ yagpt-name }}, also pass `LLM__API_KEY` and, if needed, `LLM__MODEL` and `LLM__BASE_URL`: + + ```bash + LLM__API_KEY='your_llm_api_key' WILDBERRIES__API_TOKEN='your_wb_token' serverless deploy + ``` + +- Management console {#console} + + Use this path to assemble the infrastructure manually. Each resource is created separately. + + **1. Create the service accounts.** + + 1. [Create](../../../iam/operations/sa/create.md) a service account named `wb-responder-function-sa` and [assign](../../../iam/operations/sa/assign-role-for-sa.md) it the `ai.languageModels.user` role — the function uses its IAM token to call {{ yagpt-name }}. + 1. [Create](../../../iam/operations/sa/create.md) a second service account named `wb-responder-trigger-sa` and [assign](../../../iam/operations/sa/assign-role-for-sa.md) it the `{{ roles-functions-invoker }}` role — the cron trigger will use it to invoke the function. + + **2. Create the function.** + + 1. In the [management console]({{ link-console-main }}), open the folder where you want to create the function. + 1. From the list of services, select **{{ ui-key.yacloud.iam.folder.dashboard.label_serverless-functions }}**. + 1. Click **{{ ui-key.yacloud.serverless-functions.list.button_create }}** and set the name to `wb-responder-function`. + 1. From the root of the cloned repository, build a ZIP archive containing the `src/` folder and the `requirements.txt`, `settings.yaml` files: + + ```bash + zip -r wb-responder.zip src requirements.txt settings.yaml + ``` + + 1. Create a function version with the following parameters: + + * **{{ ui-key.yacloud.serverless-functions.item.editor.field_runtime }}**: `python312`. + * **{{ ui-key.yacloud.serverless-functions.item.editor.field_entry }}**: `src.entrypoints.yandex_cloud_function.handler`. + * **{{ ui-key.yacloud.serverless-functions.item.editor.field_resources-memory }}**: `512 {{ ui-key.yacloud.common.units.label_megabyte }}`. + * **{{ ui-key.yacloud.serverless-functions.item.editor.field_timeout }}**: `30`. + * **{{ ui-key.yacloud.serverless-functions.item.editor.field_code-source }}**: **{{ ui-key.yacloud.serverless-functions.item.editor.value_method-zip-file }}**, upload `wb-responder.zip`. + * **{{ ui-key.yacloud.forms.label_service-account-select }}**: `wb-responder-function-sa`. + + 1. Add the environment variables: + + * `WILDBERRIES__API_TOKEN` — the Wildberries token from the [Get a Wildberries API token](#wb-token) step. + * `LLM__API_KEY` — leave empty or set to `null` so that the function uses the IAM token of the service account when calling {{ yagpt-name }}. + + 1. Save the version. + + **3. Create the timer trigger.** + + 1. On the **{{ ui-key.yacloud.iam.folder.dashboard.label_serverless-functions }}** service page, switch to the **{{ ui-key.yacloud.serverless-functions.switch_list-triggers }}** tab and click **{{ ui-key.yacloud.serverless-functions.triggers.list.button_create }}**. + 1. Under **{{ ui-key.yacloud.serverless-functions.triggers.form.section_base }}**, set: + + * Trigger name: `wb-responder-trigger`. + * **{{ ui-key.yacloud.serverless-functions.triggers.form.field_type }}**: `{{ ui-key.yacloud.serverless-functions.triggers.form.label_timer }}`. + + 1. Under **Timer**, specify a cron expression, for example `*/30 * * * ? *` for a run every 30 minutes. + 1. Under **{{ ui-key.yacloud.serverless-functions.triggers.form.section_function }}**, choose the function `wb-responder-function`, the version tag `$latest`, and the service account `wb-responder-trigger-sa`. + 1. Click **{{ ui-key.yacloud.serverless-functions.triggers.form.button_create-trigger }}**. + +{% endlist %} + + +## Test the service {#test} + +1. In the Wildberries seller dashboard, make sure there is at least one unanswered review. +1. In the [management console]({{ link-console-main }}), open the `wb-responder-function` function and click **{{ ui-key.yacloud.serverless-functions.item.test-action.button_test-version }}** — the function will run once without waiting for the trigger. +1. Open the **{{ ui-key.yacloud.serverless-functions.item.switch_logs }}** tab and verify that the logs contain no errors and show entries for processed reviews. +1. After a few minutes, return to the Wildberries seller dashboard and check that the processed reviews now have replies. + +If you see Wildberries authorization errors (`401 Unauthorized`) in the logs, make sure the `WILDBERRIES__API_TOKEN` environment variable contains a token with the **Reviews and questions** scope. + + +## How to delete the resources you created {#clear-out} + +To stop paying for the resources you created: + +1. If you used the Serverless Framework, delete everything with one command: + + ```bash + serverless remove + ``` + + In this case, you can skip the remaining steps. + +1. [Delete](../../../functions/operations/trigger/trigger-delete.md) the `wb-responder-trigger` trigger. +1. [Delete](../../../functions/operations/function/function-delete.md) the `wb-responder-function` function. +1. [Delete](../../../iam/operations/sa/delete.md) the service accounts `wb-responder-function-sa` and `wb-responder-trigger-sa`. diff --git a/en/_tutorials/_tutorials_includes/wildberries-review-responder/index.md b/en/_tutorials/_tutorials_includes/wildberries-review-responder/index.md new file mode 100644 index 0000000000..228479bb41 --- /dev/null +++ b/en/_tutorials/_tutorials_includes/wildberries-review-responder/index.md @@ -0,0 +1,20 @@ +# An AI service for auto-replying to Wildberries reviews + +This tutorial explains how to deploy a service to {{ sf-full-name }} that automatically replies to customer reviews in your Wildberries seller dashboard using a large language model — for example, [{{ yagpt-full-name }}]({{ yagpt-full-name }}). + +The service runs on a schedule via a [timer](../../../functions/concepts/trigger/timer.md): on every tick the function fetches a batch of unanswered reviews through the Wildberries Feedbacks API, generates an individual reply through an LLM, and posts it back to Wildberries. + +The solution is open source under the MIT license and is available [in a public repository](https://github.com/eslazarev/ai-wildberries-review-responder). The service runs on your own credentials and never shares your Wildberries API token with third parties. + +Architecture: + +* **{{ sf-name }}** runs the code on a schedule with no need for a persistent server. +* **The timer trigger** invokes the function every N minutes (every 30 minutes by default). +* **{{ yagpt-full-name }}** generates the replies — inside {{ sf-name }} the function authenticates with the IAM token of its service account; an explicit API key is not required. +* **The Wildberries Feedbacks API** is the external source of input data and the destination for replies. + +You can deploy the service the following way: + +* [Management console](console.md) — a step-by-step scenario through the {{ yandex-cloud }} management console or a single command via the Serverless Framework. + +> To learn about the resources you will be billed for, see the [Required paid resources](console.md#paid-resources) section. diff --git a/en/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md b/en/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md new file mode 100644 index 0000000000..f67f4d523e --- /dev/null +++ b/en/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md @@ -0,0 +1,7 @@ +The service support cost includes: + +* Fee for invoking [functions](../../../functions/concepts/function.md) (see [{{ sf-full-name }} pricing](../../../functions/pricing.md)). +* Fee for using the chosen language model (see [{{ yagpt-full-name }} pricing](../../../foundation-models/pricing.md)). +* Fee for outbound traffic from {{ sf-name }} (see [{{ sf-full-name }} pricing](../../../functions/pricing.md)). + +The Wildberries Feedbacks API is not billed when used within the seller account limits. diff --git a/en/functions/toc.yaml b/en/functions/toc.yaml index 0df58dce28..a5e225aa5d 100644 --- a/en/functions/toc.yaml +++ b/en/functions/toc.yaml @@ -427,6 +427,12 @@ items: href: tutorials/video-converting-queue/console.md - name: '{{ TF }}' href: tutorials/video-converting-queue/terraform.md + - name: AI auto-replier for Wildberries reviews + items: + - name: Overview + href: tutorials/wildberries-review-responder/index.md + - name: Management console + href: tutorials/wildberries-review-responder/console.md - name: Developing a custom integration href: tutorials/api-gw-integration.md - name: URL shortener diff --git a/en/functions/tutorials/wildberries-review-responder/console.md b/en/functions/tutorials/wildberries-review-responder/console.md new file mode 100644 index 0000000000..26893204d7 --- /dev/null +++ b/en/functions/tutorials/wildberries-review-responder/console.md @@ -0,0 +1,11 @@ +--- +canonical: '{{ link-docs }}/tutorials/serverless/wildberries-review-responder/console' +noIndex: true +--- + +# An AI service for auto-replying to Wildberries reviews using the management console + + +To deploy [an AI service for auto-replying to Wildberries reviews](index.md) through the {{ yandex-cloud }} management console or the Serverless Framework: + +{% include [console](../../../_tutorials/_tutorials_includes/wildberries-review-responder/console.md) %} diff --git a/en/functions/tutorials/wildberries-review-responder/index.md b/en/functions/tutorials/wildberries-review-responder/index.md new file mode 100644 index 0000000000..a67a142aa6 --- /dev/null +++ b/en/functions/tutorials/wildberries-review-responder/index.md @@ -0,0 +1,8 @@ +--- +canonical: '{{ link-docs }}/tutorials/serverless/wildberries-review-responder/' +noIndex: true +--- + +{% include [wildberries-review-responder](../../../_tutorials/_tutorials_includes/wildberries-review-responder/index.md) %} + +* [Management console](console.md) — a step-by-step scenario through the {{ yandex-cloud }} management console or a single command via the Serverless Framework. diff --git a/en/tutorials/serverless/wildberries-review-responder/console.md b/en/tutorials/serverless/wildberries-review-responder/console.md new file mode 100644 index 0000000000..04905425f2 --- /dev/null +++ b/en/tutorials/serverless/wildberries-review-responder/console.md @@ -0,0 +1,11 @@ +--- +title: An AI service for auto-replying to Wildberries reviews using the management console +description: Following this tutorial, you will deploy an AI service for auto-replying to Wildberries reviews through the {{ yandex-cloud }} management console or the Serverless Framework. +--- + +# An AI service for auto-replying to Wildberries reviews using the management console + + +To deploy [an AI service for auto-replying to Wildberries reviews](index.md) through the {{ yandex-cloud }} management console or the Serverless Framework: + +{% include [console](../../../_tutorials/_tutorials_includes/wildberries-review-responder/console.md) %} diff --git a/en/tutorials/serverless/wildberries-review-responder/index.md b/en/tutorials/serverless/wildberries-review-responder/index.md new file mode 100644 index 0000000000..83aec907a2 --- /dev/null +++ b/en/tutorials/serverless/wildberries-review-responder/index.md @@ -0,0 +1,8 @@ +--- +title: An AI service for auto-replying to Wildberries reviews +description: Following this tutorial, you will deploy a service to {{ sf-full-name }} that automatically replies to customer reviews in your Wildberries seller dashboard using a large language model — for example, {{ yagpt-full-name }}. +--- + +{% include [wildberries-review-responder](../../../_tutorials/_tutorials_includes/wildberries-review-responder/index.md) %} + +* [Management console](console.md) — a step-by-step scenario through the {{ yandex-cloud }} management console or a single command via the Serverless Framework. diff --git a/en/tutorials/toc.yaml b/en/tutorials/toc.yaml index 0323a9eb25..dbb5764f8e 100644 --- a/en/tutorials/toc.yaml +++ b/en/tutorials/toc.yaml @@ -891,6 +891,12 @@ items: href: serverless/video-converting-queue/console.md - name: '{{ TF }}' href: serverless/video-converting-queue/terraform.md + - name: AI auto-replier for Wildberries reviews + items: + - name: Overview + href: serverless/wildberries-review-responder/index.md + - name: Management console + href: serverless/wildberries-review-responder/console.md - name: >- Configuring printing from {{ cloud-desktop-name }} to a local printer in Linux @@ -1589,6 +1595,12 @@ items: href: serverless/video-converting-queue/console.md - name: Terraform href: serverless/video-converting-queue/terraform.md + - name: AI auto-replier for Wildberries reviews + items: + - name: Overview + href: serverless/wildberries-review-responder/index.md + - name: Management console + href: serverless/wildberries-review-responder/console.md - name: Developing a custom integration in {{ api-gw-name }} href: serverless/api-gw-integration.md - name: URL shortener From b6fc874c7c0d625179f3cd48a97e8d867006898a Mon Sep 17 00:00:00 2001 From: Evgenii Lazarev Date: Fri, 1 May 2026 13:19:35 +0300 Subject: [PATCH 3/4] Fix YFM validation errors in wildberries-review-responder tutorial MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Three issues caught by the YFM validator: 1. `[{{ yagpt-full-name }}]({{ yagpt-full-name }})` was a self-referential markdown link with the variable used both as the visible text and as the URL — the URL resolved to plain text "YandexGPT API" which is not a link. Replace the URL with `{{ link-docs-ai }}ai-studio/concepts/generation/index`, matching the pattern already used in tracker-yandexgpt-postbox-integrations.md. 2. `../../../foundation-models/pricing.md` resolved to a non-existent file (`foundation-models/` is not a top-level docs directory). Replace with `{{ link-docs-ai }}ai-studio/pricing`. 3. The "Test version" button was referenced via a non-existent UI key `ui-key.yacloud.serverless-functions.item.test-action.button_test-version`. The canonical flow uses the Testing tab + Run test button + result fields, as in applied/datalens.md. Rewrite the test step accordingly. Same fixes applied to the EN mirror. --- .../wildberries-review-responder/console.md | 11 ++++++----- .../wildberries-review-responder/index.md | 2 +- .../wildberries-review-responder/paid-resources.md | 2 +- .../wildberries-review-responder/console.md | 11 ++++++----- .../wildberries-review-responder/index.md | 2 +- .../wildberries-review-responder/paid-resources.md | 2 +- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/en/_tutorials/_tutorials_includes/wildberries-review-responder/console.md b/en/_tutorials/_tutorials_includes/wildberries-review-responder/console.md index 3cfc21d075..208d4632bb 100644 --- a/en/_tutorials/_tutorials_includes/wildberries-review-responder/console.md +++ b/en/_tutorials/_tutorials_includes/wildberries-review-responder/console.md @@ -45,7 +45,7 @@ The repository already contains everything required for deployment: * `src/` — the application source code, organized as a hexagonal architecture. * `requirements.txt` — Python dependency list. * `settings.yaml` — default configuration: base URLs, review batch size, run interval, prompt template, and system instructions for the model. -* `serverless.yml` — Serverless Framework manifest describing the function, the cron trigger, and both service accounts (`ai.languageModels.user` for the function and `{{ roles-functions-invoker }}` for the trigger). +* `serverless.yml` — Serverless Framework manifest describing the function, the cron trigger, and both service accounts (`{{ roles-yagpt-user }}` for the function and `{{ roles-functions-invoker }}` for the trigger). The {{ sf-name }} entry point is `src.entrypoints.yandex_cloud_function.handler`. Inside the function: @@ -65,7 +65,7 @@ Pick the deployment path that fits you. - Serverless Framework {#serverless} - This path provisions **all** resources — the function, the cron trigger, and both service accounts (`wb-responder-function-service-account` with the `ai.languageModels.user` role and `wb-responder-trigger-service-account` with the `{{ roles-functions-invoker }}` role) — with a single command, following the manifest in `serverless.yml`. + This path provisions **all** resources — the function, the cron trigger, and both service accounts (`wb-responder-function-service-account` with the `{{ roles-yagpt-user }}` role and `wb-responder-trigger-service-account` with the `{{ roles-functions-invoker }}` role) — with a single command, following the manifest in `serverless.yml`. Requires [Node.js 18+](https://nodejs.org) and [Serverless Framework 3](https://www.serverless.com/framework/docs/getting-started). @@ -101,7 +101,7 @@ Pick the deployment path that fits you. **1. Create the service accounts.** - 1. [Create](../../../iam/operations/sa/create.md) a service account named `wb-responder-function-sa` and [assign](../../../iam/operations/sa/assign-role-for-sa.md) it the `ai.languageModels.user` role — the function uses its IAM token to call {{ yagpt-name }}. + 1. [Create](../../../iam/operations/sa/create.md) a service account named `wb-responder-function-sa` and [assign](../../../iam/operations/sa/assign-role-for-sa.md) it the `{{ roles-yagpt-user }}` role — the function uses its IAM token to call {{ yagpt-name }}. 1. [Create](../../../iam/operations/sa/create.md) a second service account named `wb-responder-trigger-sa` and [assign](../../../iam/operations/sa/assign-role-for-sa.md) it the `{{ roles-functions-invoker }}` role — the cron trigger will use it to invoke the function. **2. Create the function.** @@ -149,8 +149,9 @@ Pick the deployment path that fits you. ## Test the service {#test} 1. In the Wildberries seller dashboard, make sure there is at least one unanswered review. -1. In the [management console]({{ link-console-main }}), open the `wb-responder-function` function and click **{{ ui-key.yacloud.serverless-functions.item.test-action.button_test-version }}** — the function will run once without waiting for the trigger. -1. Open the **{{ ui-key.yacloud.serverless-functions.item.switch_logs }}** tab and verify that the logs contain no errors and show entries for processed reviews. +1. In the [management console]({{ link-console-main }}), open the `wb-responder-function` function and switch to the **{{ ui-key.yacloud.serverless-functions.item.switch_testing }}** tab. +1. Click **{{ ui-key.yacloud.serverless-functions.item.testing.button_run-test }}** — the function will run once without waiting for the trigger. The **{{ ui-key.yacloud.serverless-functions.item.testing.field_execution-result }}** field should show **{{ ui-key.yacloud.serverless-functions.item.testing.label_result-success }}**. +1. Switch to the **{{ ui-key.yacloud.serverless-functions.item.switch_logs }}** tab and verify that the logs contain no errors and show entries for processed reviews. 1. After a few minutes, return to the Wildberries seller dashboard and check that the processed reviews now have replies. If you see Wildberries authorization errors (`401 Unauthorized`) in the logs, make sure the `WILDBERRIES__API_TOKEN` environment variable contains a token with the **Reviews and questions** scope. diff --git a/en/_tutorials/_tutorials_includes/wildberries-review-responder/index.md b/en/_tutorials/_tutorials_includes/wildberries-review-responder/index.md index 228479bb41..5f8e95689c 100644 --- a/en/_tutorials/_tutorials_includes/wildberries-review-responder/index.md +++ b/en/_tutorials/_tutorials_includes/wildberries-review-responder/index.md @@ -1,6 +1,6 @@ # An AI service for auto-replying to Wildberries reviews -This tutorial explains how to deploy a service to {{ sf-full-name }} that automatically replies to customer reviews in your Wildberries seller dashboard using a large language model — for example, [{{ yagpt-full-name }}]({{ yagpt-full-name }}). +This tutorial explains how to deploy a service to {{ sf-full-name }} that automatically replies to customer reviews in your Wildberries seller dashboard using a large language model — for example, [{{ yagpt-full-name }}]({{ link-docs-ai }}ai-studio/concepts/generation/index). The service runs on a schedule via a [timer](../../../functions/concepts/trigger/timer.md): on every tick the function fetches a batch of unanswered reviews through the Wildberries Feedbacks API, generates an individual reply through an LLM, and posts it back to Wildberries. diff --git a/en/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md b/en/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md index f67f4d523e..57812cae9c 100644 --- a/en/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md +++ b/en/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md @@ -1,7 +1,7 @@ The service support cost includes: * Fee for invoking [functions](../../../functions/concepts/function.md) (see [{{ sf-full-name }} pricing](../../../functions/pricing.md)). -* Fee for using the chosen language model (see [{{ yagpt-full-name }} pricing](../../../foundation-models/pricing.md)). +* Fee for using the chosen language model (see [{{ ai-studio-full-name }} pricing]({{ link-docs-ai }}ai-studio/pricing)). * Fee for outbound traffic from {{ sf-name }} (see [{{ sf-full-name }} pricing](../../../functions/pricing.md)). The Wildberries Feedbacks API is not billed when used within the seller account limits. diff --git a/ru/_tutorials/_tutorials_includes/wildberries-review-responder/console.md b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/console.md index ed0a2f88d3..e7a052da30 100644 --- a/ru/_tutorials/_tutorials_includes/wildberries-review-responder/console.md +++ b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/console.md @@ -45,7 +45,7 @@ cd ai-wildberries-review-responder * `src/` — исходный код приложения, построенный по гексагональной архитектуре. * `requirements.txt` — список Python-зависимостей. * `settings.yaml` — конфигурация по умолчанию: базовые URL, размер пачки отзывов, период запуска, шаблон промпта и системные инструкции для модели. -* `serverless.yml` — манифест Serverless Framework: описывает функцию, cron-триггер и оба сервисных аккаунта (`ai.languageModels.user` для функции и `{{ roles-functions-invoker }}` для триггера). +* `serverless.yml` — манифест Serverless Framework: описывает функцию, cron-триггер и оба сервисных аккаунта (`{{ roles-yagpt-user }}` для функции и `{{ roles-functions-invoker }}` для триггера). Точка входа для {{ sf-name }} — `src.entrypoints.yandex_cloud_function.handler`. Внутри функции: @@ -65,7 +65,7 @@ cd ai-wildberries-review-responder - Serverless Framework {#serverless} - Этот способ создаёт **все** ресурсы — функцию, cron-триггер и оба сервисных аккаунта (`wb-responder-function-service-account` с ролью `ai.languageModels.user` и `wb-responder-trigger-service-account` с ролью `{{ roles-functions-invoker }}`) — одной командой согласно манифесту `serverless.yml`. + Этот способ создаёт **все** ресурсы — функцию, cron-триггер и оба сервисных аккаунта (`wb-responder-function-service-account` с ролью `{{ roles-yagpt-user }}` и `wb-responder-trigger-service-account` с ролью `{{ roles-functions-invoker }}`) — одной командой согласно манифесту `serverless.yml`. Требуется установленный [Node.js 18+](https://nodejs.org) и [Serverless Framework 3](https://www.serverless.com/framework/docs/getting-started). @@ -101,7 +101,7 @@ cd ai-wildberries-review-responder **1. Создайте сервисные аккаунты.** - 1. [Создайте](../../../iam/operations/sa/create.md) сервисный аккаунт с именем `wb-responder-function-sa` и [назначьте](../../../iam/operations/sa/assign-role-for-sa.md) ему роль `ai.languageModels.user` — функция использует его IAM-токен для обращения к {{ yagpt-name }}. + 1. [Создайте](../../../iam/operations/sa/create.md) сервисный аккаунт с именем `wb-responder-function-sa` и [назначьте](../../../iam/operations/sa/assign-role-for-sa.md) ему роль `{{ roles-yagpt-user }}` — функция использует его IAM-токен для обращения к {{ yagpt-name }}. 1. [Создайте](../../../iam/operations/sa/create.md) второй сервисный аккаунт с именем `wb-responder-trigger-sa` и [назначьте](../../../iam/operations/sa/assign-role-for-sa.md) ему роль `{{ roles-functions-invoker }}` — от его имени cron-триггер будет вызывать функцию. **2. Создайте функцию.** @@ -149,8 +149,9 @@ cd ai-wildberries-review-responder ## Проверьте работу сервиса {#test} 1. В кабинете продавца Wildberries убедитесь, что есть хотя бы один неотвеченный отзыв. -1. В [консоли управления]({{ link-console-main }}) откройте функцию `wb-responder-function` и нажмите **{{ ui-key.yacloud.serverless-functions.item.test-action.button_test-version }}** — функция выполнится разово, без ожидания триггера. -1. Откройте вкладку **{{ ui-key.yacloud.serverless-functions.item.switch_logs }}** и убедитесь, что в логах нет ошибок и видны записи о том, что отзывы обработаны. +1. В [консоли управления]({{ link-console-main }}) откройте функцию `wb-responder-function` и перейдите на вкладку **{{ ui-key.yacloud.serverless-functions.item.switch_testing }}**. +1. Нажмите кнопку **{{ ui-key.yacloud.serverless-functions.item.testing.button_run-test }}** — функция выполнится разово, без ожидания триггера. В поле **{{ ui-key.yacloud.serverless-functions.item.testing.field_execution-result }}** должен появиться статус **{{ ui-key.yacloud.serverless-functions.item.testing.label_result-success }}**. +1. Перейдите на вкладку **{{ ui-key.yacloud.serverless-functions.item.switch_logs }}** и убедитесь, что в логах нет ошибок и видны записи о том, что отзывы обработаны. 1. Через несколько минут вернитесь в кабинет продавца Wildberries и проверьте, что у обработанных отзывов появились ответы. Если в логах появляются ошибки авторизации Wildberries (`401 Unauthorized`), убедитесь, что переменная окружения `WILDBERRIES__API_TOKEN` содержит токен с областью **Отзывы и вопросы**. diff --git a/ru/_tutorials/_tutorials_includes/wildberries-review-responder/index.md b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/index.md index 63adf16230..8701df850f 100644 --- a/ru/_tutorials/_tutorials_includes/wildberries-review-responder/index.md +++ b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/index.md @@ -1,6 +1,6 @@ # AI-сервис автоматических ответов на отзывы Wildberries -Из этого руководства вы узнаете, как развернуть в {{ sf-full-name }} сервис, который автоматически отвечает на отзывы покупателей в кабинете продавца Wildberries с помощью большой языковой модели — например, [{{ yagpt-full-name }}]({{ yagpt-full-name }}). +Из этого руководства вы узнаете, как развернуть в {{ sf-full-name }} сервис, который автоматически отвечает на отзывы покупателей в кабинете продавца Wildberries с помощью большой языковой модели — например, [{{ yagpt-full-name }}]({{ link-docs-ai }}ai-studio/concepts/generation/index). Сервис запускается по расписанию с помощью [таймера](../../../functions/concepts/trigger/timer.md): на каждом тике функция получает пачку неотвеченных отзывов через Wildberries Feedbacks API, генерирует индивидуальный ответ через LLM и публикует его обратно в Wildberries. diff --git a/ru/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md index 57343e1cd2..39a70741ba 100644 --- a/ru/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md +++ b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/paid-resources.md @@ -1,7 +1,7 @@ В стоимость поддержки сервиса входит: * плата за вызовы [функций](../../../functions/concepts/function.md) (см. [тарифы {{ sf-full-name }}](../../../functions/pricing.md)); -* плата за использование выбранной языковой модели (см. [тарифы {{ yagpt-full-name }}](../../../foundation-models/pricing.md)); +* плата за использование выбранной языковой модели (см. [тарифы {{ ai-studio-full-name }}]({{ link-docs-ai }}ai-studio/pricing)); * плата за исходящий трафик из {{ sf-name }} (см. [тарифы {{ sf-full-name }}](../../../functions/pricing.md)). Wildberries Feedbacks API при работе в пределах лимитов кабинета продавца не тарифицируется. From dcee719546bd52ee9b9be254c886270b5be3d688 Mon Sep 17 00:00:00 2001 From: Evgenii Lazarev Date: Fri, 1 May 2026 13:30:10 +0300 Subject: [PATCH 4/4] Move sibling-shell links out of the include into wrappers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The include _tutorials/_tutorials_includes/wildberries-review-responder/index.md referenced sibling files (`console.md` and `console.md#paid-resources`). YFM resolves these relative to the include's own location, where they exist as files but are not declared in any TOC, so YFM003 reported the link as unreachable from each of the four wrapper index.md files (ru/en × functions/tutorials and tutorials/serverless). Match the video-converting-queue layout: keep the include focused on shared narrative, and place the deployment-method bullet and the paid-resources note in each wrapper, where the relative paths resolve to the wrapper's own console.md. --- .../_tutorials_includes/wildberries-review-responder/index.md | 4 ---- en/functions/tutorials/wildberries-review-responder/index.md | 2 ++ en/tutorials/serverless/wildberries-review-responder/index.md | 2 ++ .../_tutorials_includes/wildberries-review-responder/index.md | 4 ---- ru/functions/tutorials/wildberries-review-responder/index.md | 2 ++ ru/tutorials/serverless/wildberries-review-responder/index.md | 2 ++ 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/en/_tutorials/_tutorials_includes/wildberries-review-responder/index.md b/en/_tutorials/_tutorials_includes/wildberries-review-responder/index.md index 5f8e95689c..b7716f099f 100644 --- a/en/_tutorials/_tutorials_includes/wildberries-review-responder/index.md +++ b/en/_tutorials/_tutorials_includes/wildberries-review-responder/index.md @@ -14,7 +14,3 @@ Architecture: * **The Wildberries Feedbacks API** is the external source of input data and the destination for replies. You can deploy the service the following way: - -* [Management console](console.md) — a step-by-step scenario through the {{ yandex-cloud }} management console or a single command via the Serverless Framework. - -> To learn about the resources you will be billed for, see the [Required paid resources](console.md#paid-resources) section. diff --git a/en/functions/tutorials/wildberries-review-responder/index.md b/en/functions/tutorials/wildberries-review-responder/index.md index a67a142aa6..07f8664fc4 100644 --- a/en/functions/tutorials/wildberries-review-responder/index.md +++ b/en/functions/tutorials/wildberries-review-responder/index.md @@ -6,3 +6,5 @@ noIndex: true {% include [wildberries-review-responder](../../../_tutorials/_tutorials_includes/wildberries-review-responder/index.md) %} * [Management console](console.md) — a step-by-step scenario through the {{ yandex-cloud }} management console or a single command via the Serverless Framework. + +> To learn about the resources you will be billed for, see the [Required paid resources](console.md#paid-resources) section. diff --git a/en/tutorials/serverless/wildberries-review-responder/index.md b/en/tutorials/serverless/wildberries-review-responder/index.md index 83aec907a2..ea11fda226 100644 --- a/en/tutorials/serverless/wildberries-review-responder/index.md +++ b/en/tutorials/serverless/wildberries-review-responder/index.md @@ -6,3 +6,5 @@ description: Following this tutorial, you will deploy a service to {{ sf-full-na {% include [wildberries-review-responder](../../../_tutorials/_tutorials_includes/wildberries-review-responder/index.md) %} * [Management console](console.md) — a step-by-step scenario through the {{ yandex-cloud }} management console or a single command via the Serverless Framework. + +> To learn about the resources you will be billed for, see the [Required paid resources](console.md#paid-resources) section. diff --git a/ru/_tutorials/_tutorials_includes/wildberries-review-responder/index.md b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/index.md index 8701df850f..41ccbd9f2b 100644 --- a/ru/_tutorials/_tutorials_includes/wildberries-review-responder/index.md +++ b/ru/_tutorials/_tutorials_includes/wildberries-review-responder/index.md @@ -14,7 +14,3 @@ * **Wildberries Feedbacks API** — внешний источник данных и приёмник ответов. Развернуть сервис можно следующими способами: - -* [Консоль управления](console.md) — пошаговый сценарий через консоль {{ yandex-cloud }} или одной командой через Serverless Framework. - -> Чтобы узнать о ресурсах, которые тарифицируются при работе сервиса, см. раздел [Необходимые платные ресурсы](console.md#paid-resources). diff --git a/ru/functions/tutorials/wildberries-review-responder/index.md b/ru/functions/tutorials/wildberries-review-responder/index.md index 58c6154599..fa099e8a94 100644 --- a/ru/functions/tutorials/wildberries-review-responder/index.md +++ b/ru/functions/tutorials/wildberries-review-responder/index.md @@ -6,3 +6,5 @@ noIndex: true {% include [wildberries-review-responder](../../../_tutorials/_tutorials_includes/wildberries-review-responder/index.md) %} * [Консоль управления](console.md) — пошаговый сценарий через консоль управления {{ yandex-cloud }} или одной командой через Serverless Framework. + +> Чтобы узнать о ресурсах, которые тарифицируются при работе сервиса, см. раздел [Необходимые платные ресурсы](console.md#paid-resources). diff --git a/ru/tutorials/serverless/wildberries-review-responder/index.md b/ru/tutorials/serverless/wildberries-review-responder/index.md index 5f44776b8a..a76fc7dc79 100644 --- a/ru/tutorials/serverless/wildberries-review-responder/index.md +++ b/ru/tutorials/serverless/wildberries-review-responder/index.md @@ -6,3 +6,5 @@ description: Следуя данному руководству, вы сможе {% include [wildberries-review-responder](../../../_tutorials/_tutorials_includes/wildberries-review-responder/index.md) %} * [Консоль управления](console.md) — пошаговый сценарий через консоль управления {{ yandex-cloud }} или одной командой через Serverless Framework. + +> Чтобы узнать о ресурсах, которые тарифицируются при работе сервиса, см. раздел [Необходимые платные ресурсы](console.md#paid-resources).