bold-web/statamic-ai-assistant
Composer 安装命令:
composer require bold-web/statamic-ai-assistant
包简介
Statamic 6 addon: AI text generation and refactoring in the Control Panel (Ai Text, Bard, DeepL translations). Requires statamic/cms ^6.5.
关键字:
README 文档
README
Control Panel addon for Statamic 6.5+: AI text generation and refactoring via custom fieldtypes and Bard, plus optional DeepL translation tools.
Requirements
- Statamic
^6.5(statamic/cmsis declared in Composer; installs on Statamic 5 will not resolve). - A compatible Laravel version for your Statamic release (follow Statamic’s requirements).
- Statamic 5: use the
1.xrelease line / branch, not currentmain. - Current release line:
3.x(see CHANGELOG.md for breaking changes from 2.x).
Supported API
- Infomaniak (CH, respect the data of your clients) - Default
- Groq (USA, get the speed)
- ...more to come
Features
- Allow the usage of 'Ai Textarea' custom component in Statamic
- Allow the usage of 'Ai Text' custom component in Statamic
- Upgrade Bard by adding the AI asisstant buttons (generation and translation) directly in Bard
- Multilang supported (CP panel addon translations in EN/DE/FR/IT for now)
How to Install
Install with Composer. Current releases target Statamic 6.5+ on the 3.x line:
composer require bold-web/statamic-ai-assistant:^3.0
# Statamic 5 projects only — pin the 1.x line
composer require bold-web/statamic-ai-assistant:^1
Upgrading from 2.x → 3.0
composer require bold-web/statamic-ai-assistant:^3.0php artisan vendor:publish --tag=statamic-ai-assistant-config --forcephp artisan vendor:publish --tag=statamic-ai-assistant --force- Review CHANGELOG.md — migration mode is removed; new DeepL glossary/style YAML;
ENABLE_AGENT_FOR_EDITORSgates editors only (super admins always keep the BOLD agent).
How to Use
The plugin use per default Infomaniak API, a Swiss solution🇨🇭 respecting the data of your users and the planet. However if you want to switch to a faster generation with a US based company this plugin also comes with Groq API support.
Infomaniak API
- Create an Infomaniak account and generate an API token with access to your AI Tools. Define it in your
.envfile asINFOMANIAK_API_TOKEN - Go to your dashboard computing->AI tools and define the
INFOMANIAK_PRODUCT_IDin your.envfile (or use their API to get the product id: https://developer.infomaniak.com/docs/api/get/1/ai)tips for GET request: Just use postman with your api key in the Authorization header 'Bearer your-api-key' to get the product id
Groq API
- Create a groq account and generate an API key. Define it in your
.envfile asGROQ_API_KEY - Add
STATAMIC_AI_ASSISTANT_PROVIDER_NAME='groq'in your.envfile to use groq
Translations (DeepL)
Breaking change: Translation features (Bard DeepL actions, bulk translation, and related Control Panel tools) require a DeepL API key. Add
DEEPL_API_KEYto your.envas described below. If you upgrade from an older release, configure DeepL or turn translations off withSTATAMIC_AI_ASSISTANT_TRANSLATIONS=false.
Bulk translation, Bard field translation, and related CP tools use DeepL (not the LLM provider above).
- Create a DeepL API account and copy your API authentication key.
- Add it to your application
.envfile:
DEEPL_API_KEY=your-deepl-api-key-here
- After installing or updating the addon, publish config if you need to customize language mapping or English/Portuguese variants:
php artisan vendor:publish --tag=statamic-ai-assistant --force
The key is read from config/deepl.php (DEEPL_API_KEY). Optional overrides in .env (see config/deepl.php after publishing):
# Optional: DeepL requires en-GB / en-US (not bare "en") for some targets DEEPL_ENGLISH_TARGET=en-GB DEEPL_PORTUGUESE_TARGET=pt-PT
You can disable translation features entirely with:
STATAMIC_AI_ASSISTANT_TRANSLATIONS=false
Linked entries depth (admin-only)
When an entry references other entries (entries/link fields, Bard entry links, nested replicator data), the translator can recursively create or update localized siblings so IDs point to the correct language. Editors do not choose this in the UI — it is controlled by configuration.
- Default:
1— one “hop”: linked entries directly used by the page are translated when needed; links inside those entries are not followed further. - Override: set an integer from 0 to 5 in
.env:
# Optional. Default is 1. Use 0 to only remap IDs when a translation already exists. STATAMIC_AI_ASSISTANT_LINKED_ENTRIES_MAX_DEPTH=1
Higher values increase DeepL usage and runtime (more entries may be created in one run). See config/statamic-ai-assistant.php (linked_entries_max_depth) for the full comment block.
Customization in your .env file
- You can override GROQ_MODEL with the available model you want to use / default is llama-3.1-8b-instant
- You can override INFOMANIAK_MODEL with the available model you want to use / default is mistral24b
- You can override STATAMIC_AI_ASSISTANT_PREFACE for your custom needs.
default preface of the addon: 'You are a seasoned SEO expert who writes clear, professional, seo friendly and engaging articles in plain text. Your task is to produce fully readable articles for an end user. Do not include any markdown formatting, HTML tags, header tags, meta descriptions, or any other markup. Write only the final article text in plain text, ensuring it is clear, direct, and free of extraneous formatting elements.'
- you can override STATAMIC_AI_ASSISTANT_REFACTOR_PREFACE
default refactor preface of the addon: 'You are a professional text refactoring expert. Your only task is to transform the provided text according to the specific instructions given by the user. Output solely the final refactored text in plain text, DO NOT INCLUDE the user instructions, any commentary, or any additional text. Preserve the original language and maintain a similar length to the input text unless instructed otherwise.'
- you can override STATAMIC_AI_ASSISTANT_HTML_REFACTOR_PREFACE
default refactor preface of the addon: 'You are a professional text refactoring expert. Your only task is to transform the provided HTML text according to the specific instructions given by the user. Output solely the final refactored HTML! DO NOT INCLUDE the user instructions, any commentary, or any additional text. ALWAYS RENDER the output as valid HTML. Keep all links intact unless the user specifically instructs you to modify them, and always strive to preserve the original HTML structure unless instructed otherwise.ALWAYS update lorem ipsum. Preserve the original language and maintain a similar length to the input text unless otherwise specified.'
- You can override TEMPERATURE
- You can override MAX_TOKENS
- You can disable the BOLD agent for editors only with
ENABLE_AGENT_FOR_EDITORS=false(super admins always keep access). The master switchSTATAMIC_AI_ASSISTANT_ENTRY_GENERATOR=falsedisables the agent for everyone. - DeepL translation requires
DEEPL_API_KEYin.env(see Translations (DeepL) above)
Upgrade Request
If you face issues or have improvements ideas do not hesitate to send us an email at boldwebdev+statamic@gmail.com. We’ll read all emails, but please understand that this package is maintained as a side project for us, so we may not get back to you directly. Thank you for your understanding ❤️
bold-web/statamic-ai-assistant 适用场景与选型建议
bold-web/statamic-ai-assistant 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 357 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 05 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「ai」 「statamic」 「bard」 「deepl」 「statamic-6」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bold-web/statamic-ai-assistant 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bold-web/statamic-ai-assistant 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bold-web/statamic-ai-assistant 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
DeepL API client wrapper for Laravel
A Statamic tag for creating an anchor nav for all headings generated by the bard editor.
With this Bundle you can automatically translate your content via DeepL Interface.
This extension provides option to translate content element, and tca record texts to Deepl and Google supported languages using Deepl and Googletranslate Api services.
Deepl Automated translations for Laravel lang files
A Statamic search transformer for bard and replicator fields.
统计信息
- 总下载量: 357
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 25
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2025-05-05