【原创实践】开源扣子 coze-studio 安装本地插件配置:接入“今日诗词”API(获取所有古诗词)

在 Coze Studio 中配置一个简单的古诗词插件,可以通过"今日诗词"开放接口(https://v1.jinrishici.com/all.json)获取古诗词数据。下面是完整的配置步骤和文件内容。

1. gushi.yaml 文件内容

文件路径:coze-studio/backend/conf/plugin/pluginproduct/gushi.yaml

yaml 复制代码
info:
  description: gushi
  title: gushi
  version: v1
openapi: 3.0.1
paths:
  /all.json:
    get:
      operationId: all
      responses:
        "200":
          content:
            application/json:
              schema:
                properties:
                  author:
                    type: string
                  category:
                    type: string
                  content:
                    type: string
                  origin:
                    type: string
                type: object
          description: new desc
        default:
          description: ""
      summary: 获取所有古诗词
servers:
  - url: https://v1.jinrishici.com

2. plugin_meta.yaml 添加内容

plugin_meta.yaml 文件的末尾追加以下配置(注意 YAML 格式缩进,通常与文件中其他条目保持一致):

yaml 复制代码
- plugin_id: 23
  product_id: 7395041302766944276
  deprecated: false
  version: v1.0.0
  openapi_doc_file: gushi.yaml
  plugin_type: 1
  manifest:
    schema_version: v1
    name_for_model: gushi
    name_for_human: 获取所有古诗词
    description_for_model: gushi
    description_for_human: gushi
    auth:
      type: none
    logo_url: default_icon/default_app_icon.png
    api:
      type: openapi
    common_params:
      body: []
      header:
        - name: User-Agent
          value: Coze/1.0
      path: []
      query: []
  tools:
    - tool_id: 230001
      deprecated: false
      method: get
      sub_url: /all.json

3. 操作说明

复制代码
docker exec -it coze-server sh
cd /app/resources/conf/plugin/pluginproduct  
ls -lt | head -10
bash 复制代码
/app/resources/conf/plugin/pluginproduct # ls -lt | head -10
total 328
-rw-rw-r--    1 1000     1000           678 Dec 19 10:14 gushi.yaml
-rw-rw-r--    1 1000     1000         28085 Dec 19 09:12 plugin_meta.yaml
-rw-rw-r--    1 1000     1000          1825 Dec 19 05:54 gushi.yaml.bak
-rw-rw-r--    1 1000     1000         27443 Dec 19 04:51 plugin_meta.yaml.bak
-rw-rw-r--    1 1000     1000          8174 Nov 23 11:06 bocha_search.yaml
-rw-rw-r--    1 1000     1000          1385 Nov 23 11:06 chestnut_sign.yaml
-rw-rw-r--    1 1000     1000         30360 Nov 23 11:06 gaode_map.yaml
-rw-rw-r--    1 1000     1000          1767 Nov 23 11:06 image_compression.yaml
-rw-rw-r--    1 1000     1000          1952 Nov 23 11:06 lark_authentication_authorization.yaml

记得要重启

bash 复制代码
docker restart coze-server

配置说明

  • 该插件无需认证(auth.type: none)。
  • 调用接口为 GET https://v1.jinrishici.com/all.json,返回字段包括作者(author)、类别(category)、诗词内容(content)和出处(origin)。
  • 添加了自定义 User-Agent 头,便于接口方识别 Coze 请求。

配置完成后,重启或重新加载插件,即可在 Coze Bot 中使用"获取所有古诗词"工具调用该接口。

相关推荐
冬奇Lab6 小时前
一天一个开源项目(第62篇):lark-cli - 飞书/Lark 官方 CLI 与 AI Agent Skills
人工智能·开源·资讯
zt1985q6 小时前
本地部署开源元搜索引擎 SearXNG 并实现外部访问
服务器·网络协议·开源
法欧特斯卡雷特8 小时前
从 Kotlin 编译器 API 的变化开始: 2.3.20
android·后端·开源
IvorySQL8 小时前
第 6 次执行后,PostgreSQL 执行计划为何突变?
数据库·postgresql·开源
IvorySQL9 小时前
PostgreSQL 技术日报 (4月2日)|社区工具更新与内核补丁讨论速递
数据库·postgresql·开源
海兰9 小时前
【实战】Ubuntu 24.04下本地部署开源项目Higress
linux·人工智能·ubuntu·开源·银行系统
ApacheSeaTunnel11 小时前
祝贺 Apache SeaTunnel PMC 新成员张圣航!
大数据·开源·数据集成·seatunnel·技术分享
OpenCSG12 小时前
OpenCSG重磅开源|CIMD开源,打造垂类数据集
人工智能·开源·大模型·数据集·opencsg·cimd
l1o3v1e4ding12 小时前
Java网站项目集成GO-FLY开源在线客服系统功能,集成IM即时通信
java·golang·开源
张3蜂13 小时前
现在有开源的最好的矢量动画模型是什么,什么配置的电脑可以部署
开源·电脑