定制 ujamii/neos-cobot 二次开发

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

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

ujamii/neos-cobot

最新稳定版本:v0.5.2

Composer 安装命令:

composer require ujamii/neos-cobot

包简介

README 文档

README

neos cobot

This package integrates the Cobot for NEOS CMS. It offers text and image generation with the OpenAI API and the Flux API.

Installation

To install the package, you can use composer. Run the following command in your terminal:

composer require ujamii/neos-cobot

After the installation, you need to run the following command to update your database schema:

./flow doctrine:update

Configuration

You need to add the API key for the Cobot API to your Settings.yaml. You get the API key from your Cobot account settings.

# Configuration/Settings.yaml
Ujamii:
  Cobot:
    services:
      # The API key for the Cobot API
      # You can get it from your Cobot account settings
      apiKey: <your-api-key>

Usage

Text Generation

To enable Cobot Text Generation functionality within your node, add the following configuration to your YAML file. This will display the Cobot inline editing options directly in the RichTextToolbar, allowing for AI-powered content generation within text fields.

Neos.NodeTypes:Text:
    properties:
      text:
        ui:
          inline:
            formatting:
              cobot: true

Image Generation

The Cobot Image Generation feature is enabled by default, displaying the ImageGeneration button in all image editors. If you prefer to disable this feature, you can add the following configuration to your YAML file and set enabled to false.

Ujamii:
  Cobot:
    ImageEditorExtension:
      enabled: true

Alternative Text Generation

If you create alt texts in the backend, these are saved in an extra entity. To use these alt texts and bring them to the frontend, you must implement an eel helper for this. Here is an example of how you can do this:

<Neos.Neos:ImageTag asset={asset} attributes.alt={ImageExtension.getAltText(asset)} />

The method ImageExtension.getAltText is an eel helper that accepts an ImageInterface and returns the alt text.

Disable the alt text generation
If you not want to use the alt text generation, you can disable it in the settings:

Neos:
  Neos:
    modules:
      management:
          submodules:
              altTextModule:
                enabled: false

统计信息

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

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-12-04