定制 gtstudio/module-ai-widgets 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gtstudio/module-ai-widgets

Composer 安装命令:

composer require gtstudio/module-ai-widgets

包简介

AI-powered admin widgets for Magento 2. Provides the floating chat assistant and PageBuilder content generation backed by Gtstudio_AiAgents.

README 文档

README

AI-powered admin widgets for Magento 2. Provides a floating chat assistant on every admin page and an AI content generator inside PageBuilder HTML blocks.

Preview

AiWidgets — floating chat assistant and PageBuilder AI content generation

AI Studio Ecosystem

Part of the AI Studio suite for Magento 2. See all modules:

Module Repository Description
Gtstudio_AiConnector module-aiconnector Core AI provider abstraction
Gtstudio_AiAgents module-ai-agents Agent & tool orchestration, cron scheduling, execution log
Gtstudio_AiWidgets (this module) Floating admin chat widget + PageBuilder AI generator
Gtstudio_AiDataQuery module-ai-data-query Natural-language store analytics (privacy-first)
Gtstudio_AiKnowledgeBase module-ai-knowledge-base Document upload & RAG retrieval for agents
Gtstudio_AiDashboard module-ai-dashboard AI-powered KPI dashboard with ML insights

What It Does

  • Floating Chat Widget — a persistent chat panel in the Magento admin, powered by the admin_assistant agent
  • PageBuilder AI Generator — an AI Generate button inside PageBuilder HTML blocks to create or rewrite content via the page_builder_generator agent
  • Token and cost estimation displayed in real time for every message

Requirements

  • Magento 2.4.4+
  • PHP 8.1+
  • Gtstudio_AiConnector enabled and configured
  • Gtstudio_AiAgents enabled
  • Magento_PageBuilder (bundled with Adobe Commerce; available as OSS extension for Community)

Installation

composer require gtstudio/module-ai-widgets
php bin/magento module:enable Gtstudio_AiWidgets
php bin/magento setup:upgrade

Setup

Admin Chat Assistant

  1. Go to AI Studio → Agents → Add New
  2. Set Code to admin_assistant
  3. Fill in Background, Steps, and Output Instructions to define the assistant's persona
  4. Save — the widget appears automatically for users with the Gtstudio_AiWidgets::management ACL resource

PageBuilder Generator

  1. Create an agent with code page_builder_generator
  2. In PageBuilder, open any HTML block — an AI Generate button appears in the toolbar
  3. Type a prompt and click Generate; the result is inserted into the block

Extensibility

Swapping the agent used by the chat widget

The agent code is hardcoded as admin_assistant in AdminChatService. Override the service via DI preference to change this or add additional logic:

<!-- etc/di.xml -->
<preference for="Gtstudio\AiWidgets\Model\Service\AdminChatService"
            type="Vendor\Module\Model\Service\CustomAdminChatService"/>

Customising the chat widget template

Override via standard Magento layout XML:

<!-- view/adminhtml/layout/default.xml -->
<page>
    <body>
        <referenceBlock name="gtstudio.ai.chat.widget">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">
                    Vendor_Module::chat/custom-widget.phtml
                </argument>
            </action>
        </referenceBlock>
    </body>
</page>

The default templates are in:

view/adminhtml/templates/chat/widget.phtml
view/adminhtml/web/js/admin-chat.js

Adding token pricing for a custom model

Extend TokenCostService via di.xml — see the Gtstudio_AiConnector README for the full pattern.

ACL Resources

Resource Controls
Gtstudio_AiWidgets::management Access to all widget features and the chat API endpoint

gtstudio/module-ai-widgets 适用场景与选型建议

gtstudio/module-ai-widgets 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 2, 最近一次更新时间为 2026 年 03 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 gtstudio/module-ai-widgets 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 gtstudio/module-ai-widgets 我们能提供哪些服务?
定制开发 / 二次开发

基于 gtstudio/module-ai-widgets 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 9
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 27
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 2
  • 开发语言: JavaScript

其他信息

  • 授权协议: BUSL-1.1
  • 更新时间: 2026-03-09