承接 raduhoria/openai-textgenerator-field 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

raduhoria/openai-textgenerator-field

最新稳定版本:1.0.3

Composer 安装命令:

composer require raduhoria/openai-textgenerator-field

包简介

Kirby CMS OpenAI text generator

README 文档

README

Generate text for Kirby CMS (https://getkirby.com/) articles with OpenAI APIs (field & block item).

Features:

  • Enable the OpenAI API call to retrieve generated text using text-davinci-003 model
  • Custom field with prompt (questions)
  • Block item that reuse the custom field
  • Saving the prompts (questions) for reuse its

Overview

This plugin is completely free and published under the MIT license. However, if you are using it in a commercial project and want to help me keep up with maintenance, please consider to ❤️ sponsor me for securing the continued development of the plugin.

Block item

1. Installation

This version of the plugin requires PHP 7.4 and Kirby 3.6.0 or higher. The recommended way of installing is by using Composer:

$ composer require raduhoria/openai-textgenerator-field

Alternatively, download and copy this repository to /site/plugins/openai-textgenerator-field

2. Settings

Please consult the link for getting API key: https://beta.openai.com/account/api-keys

Please consult the link for getting Organization ID: https://beta.openai.com/account/org-settings

Just edit file:

/site/config/config.php

and add the block:

'raduhoria.openai-textgenerator-field' => [
  'openaiapikey' => '', //your OpenAI API key
  'openaiorganization' => '', //your organization ID
  'max_tokens' => 4000, //max_tokens variable according with your OpenAI package
  'temperature' => 0.7,
];

Please consult the link for understand the temperature variable in completions API: https://beta.openai.com/docs/api-reference/completions/create#completions/create-temperature

Prerequisites

If you're testing locally, the plugin is using php curl function. You need to ensure that cacert.pem certificate is installed.

  1. Download the latest cacert.pem from https://curl.se/ca/cacert.pem
  2. Add the following line to php.ini:
[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = your full path\cacert.pem

(if this is shared hosting and you don't have access to php.ini then you could add this to .user.ini in public_html).

3. Setup

This field can be used in blocks fieldsets - aitext option or like a field type openaitextgeneratorfield:

fields:
    text:
        type: blocks
        fieldsets:
            - aitext
fields:
    openaitextgeneratorfield:
        type: openaitextgeneratorfield
        label: OpenAI text generator

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-01-17

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固