Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@lobehub/chat-plugins-gateway

lobehub83.4k1.9.0TypeScript support: included

Lobe Chat Plugin Market

readme

LobeChat 插件网关

LobeChat Plugin Gateway 是一个为 LobeChat 和 LobeHub 提供 Chat 插件网关的后端服务。


English · 简体中文 · 更新日志 · 报告 Bug · 请求功能

<summary><kbd>目录</kbd></summary>

TOC

#

👋 简介

LobeChat 插件网关是一个后端服务,为 LobeChat 插件提供网关。我们使用 vercel 来部署此服务。主要 API POST /api/v1/runner 部署为Edge Function

网关服务从 LobeChat 插件 获取 Lobe 插件索引,如果您想将您的插件添加到索引中,请在 LobeChat 插件仓库中提交 PR

🤯 使用方法

基本 URL

环境 URL
PROD https://chat-plugins-gateway.lobehub.com
DEV https://chat-plugins-gateway-dev.lobehub.com

POST 插件网关

Note\ POST /api/v1/runner\ 与 LobeChat 插件进行通信的接口。此接口描述了如何使用 LobeChat 插件网关 API 发送请求和获取响应。

Body Request Parameters 请求体参数

{
  "arguments": "{\n  \"city\": \"杭州\"\n}",
  "name": "realtimeWeather"
}

Response 响应

[
  {
    "city": "杭州市",
    "adcode": "330100",
    "province": "浙江",
    "reporttime": "2023-08-17 23:32:22",
    "casts": [
      {
        "date": "2023-08-17",
        "week": "4",
        "dayweather": "小雨",
        "nightweather": "小雨",
        "daytemp": "33",
        "nighttemp": "24",
        "daywind": "东",
        "nightwind": "东",
        "daypower": "≤3",
        "nightpower": "≤3",
        "daytemp_float": "33.0",
        "nighttemp_float": "24.0"
      },
      {
        "date": "2023-08-18",
        "week": "5",
        "dayweather": "小雨",
        "nightweather": "小雨",
        "daytemp": "32",
        "nighttemp": "23",
        "daywind": "东北",
        "nightwind": "东北",
        "daypower": "4",
        "nightpower": "4",
        "daytemp_float": "32.0",
        "nighttemp_float": "23.0"
      },
      {
        "date": "2023-08-19",
        "week": "6",
        "dayweather": "小雨",
        "nightweather": "雷阵雨",
        "daytemp": "32",
        "nighttemp": "24",
        "daywind": "东",
        "nightwind": "东",
        "daypower": "4",
        "nightpower": "4",
        "daytemp_float": "32.0",
        "nighttemp_float": "24.0"
      },
      {
        "date": "2023-08-20",
        "week": "7",
        "dayweather": "雷阵雨",
        "nightweather": "多云",
        "daytemp": "33",
        "nighttemp": "25",
        "daywind": "东",
        "nightwind": "东",
        "daypower": "≤3",
        "nightpower": "≤3",
        "daytemp_float": "33.0",
        "nighttemp_float": "25.0"
      }
    ]
  }
]

更多信息请参见API 文档

🛳 自托管

如果您想自己部署此服务,可以按照以下步骤进行操作。

部署到 Vercel

点击下方按钮来部署您的私有插件网关。

使用 Vercel 部署

如果您想进行一些自定义设置,可以在部署时添加环境变量(Environment Variable):

  • PLUGINS_INDEX_URL:你可以通过该变量指定插件市场的索引地址

📦 插件生态

插件提供了扩展 LobeChat Function Calling 能力的方法。可以用于引入新的 Function Calling,甚至是新的消息结果渲染方式。如果你对插件开发感兴趣,请在 Wiki 中查阅我们的 📘 插件开发指引

  • lobe-chat-plugins:这是 LobeChat 的插件索引。它从该仓库的 index.json 中获取插件列表并显示给用户。
  • chat-plugin-template: Chat Plugin 插件开发模版,你可以通过项目模版快速新建插件项目。
  • @lobehub/chat-plugin-sdk:LobeChat 插件 SDK 可帮助您创建出色的 Lobe Chat 插件。
  • @lobehub/chat-plugins-gateway:LobeChat 插件网关是一个后端服务,作为 LobeChat 插件的网关。我们使用 Vercel 部署此服务。主要的 API POST /api/v1/runner 被部署为 Edge Function。

⌨️ Local Development

可以使用 GitHub Codespaces 进行在线开发:

或者使用以下命令进行本地开发:

$ git clone https://github.com/lobehub/chat-plugins-gateway.git
$ cd chat-plugins-gateway
$ bun install
$ bun dev

🤝 Contributing

我们非常欢迎各种形式的贡献。如果你对贡献代码感兴趣,可以查看我们的 GitHub Issues,大展身手,向我们展示你的奇思妙想。

  • 🤖 Lobe Chat - An open-source, extensible (Function Calling), high-performance chatbot framework. It supports one-click free deployment of your private ChatGPT/LLM web application.
  • 🧩 / 🏪 Plugin Index - This is the plugin index for LobeChat. It accesses index.json from this repository to display a list of available plugins for Function Calling to the user.


📝 License

Copyright © 2023 LobeHub.
This project is MIT licensed.

changelog

Changelog

Version 1.9.0

Released on 2023-12-26

✨ Features

  • misc: Support defaultPluginSettings options on Gateway.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's improved

  • misc: Support defaultPluginSettings options on Gateway (fea957e)

Version 1.8.2

Released on 2023-12-15

🐛 Bug Fixes

  • misc: Fix openapi requestBody.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: Fix openapi requestBody (4385080)

Version 1.8.1

Released on 2023-12-14

🐛 Bug Fixes

  • misc: Handling unknown error.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: Handling unknown error (e503d1f)

Version 1.8.0

Released on 2023-12-13

✨ Features

  • misc: Support node runtime.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's improved

  • misc: Support node runtime, closes #9 (28ef918)

Version 1.8.0-beta.4

Released on 2023-12-13

🐛 Bug Fixes

  • misc: Close ajv strict mode.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: Close ajv strict mode (a6eb5b6)

Version 1.8.0-beta.3

Released on 2023-12-13

🐛 Bug Fixes

  • misc: Fix ajv schema.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

Version 1.8.0-beta.2

Released on 2023-12-13

🐛 Bug Fixes

  • misc: Fix request input.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: Fix request input (1b896de)

Version 1.8.0-beta.1

Released on 2023-12-13

♻ Code Refactoring

  • misc: Refactor to the Gateway Class and add tests.

✨ Features

  • misc: Support node runtime.

<summary><kbd>Improvements and Fixes</kbd></summary>

Code refactoring

  • misc: Refactor to the Gateway Class and add tests (e8c8cb5)

What's improved

  • misc: Support node runtime (a8e2933)

Version 1.7.2

Released on 2023-12-12

🐛 Bug Fixes

  • misc: Improve PluginGatewayError error response.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: Improve PluginGatewayError error response (18b1c43)

Version 1.7.1

Released on 2023-12-12

🐛 Bug Fixes

  • misc: Fix error with openapi client init.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: Fix error with openapi client init (b652cb5)

Version 1.7.0

Released on 2023-12-11

✨ Features

  • misc: Support basic auth for OpenAPI.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's improved

  • misc: Support basic auth for OpenAPI (d3fe874)

Version 1.6.0

Released on 2023-12-11

✨ Features

  • misc: Support OpenAPI request mode.

🐛 Bug Fixes

  • misc: Fix types.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's improved

  • misc: Support OpenAPI request mode (605d947)

What's fixed

Version 1.5.3

Released on 2023-09-12

🐛 Bug Fixes

  • misc: Fix ci, Fix father version, Fix lint.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

Version 1.5.2

Released on 2023-09-08

💄 Styles

  • misc: Update lint.

<summary><kbd>Improvements and Fixes</kbd></summary>

Styles

Version 1.5.1

Released on 2023-09-05

🐛 Bug Fixes

  • misc: Fix getPluginSettingsFromRequest.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: Fix getPluginSettingsFromRequest (aad3c7a)

Version 1.5.0

Released on 2023-08-29

✨ Features

  • misc: 更新入参配置,解决跨域兼容性的问题.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's improved

  • misc: 更新入参配置,解决跨域兼容性的问题 (c02451c)

Version 1.4.3

Released on 2023-08-29

🐛 Bug Fixes

  • misc: 移除跨域限制,解决插件复用的问题.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: 移除跨域限制,解决插件复用的问题 (975b705)

Version 1.4.2

Released on 2023-08-29

🐛 Bug Fixes

  • misc: 移除跨域限制,解决插件复用的问题.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: 移除跨域限制,解决插件复用的问题 (1de6837)

Version 1.4.1

Released on 2023-08-29

🐛 Bug Fixes

  • misc: 内联默认的 索引 URL,解决外部使用问题.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: 内联默认的 索引 URL,解决外部使用问题 (54b93d2)

Version 1.4.0

Released on 2023-08-28

✨ Features

  • misc: 支持入参包含 manifest.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's improved

  • misc: 支持入参包含 manifest (b209fba)

Version 1.3.2

Released on 2023-08-26

🐛 Bug Fixes

  • misc: Change master to main.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: Change master to main (134c77f)

Version 1.3.1

Released on 2023-08-26

🐛 Bug Fixes

  • misc: Fix an error when plugin settings is undefined.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: Fix an error when plugin settings is undefined (666e503)

Version 1.3.0

Released on 2023-08-25

✨ Features

  • misc: 补充插件网关的校验逻辑.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's improved

  • misc: 补充插件网关的校验逻辑 (c6f5286)

Version 1.2.5

Released on 2023-08-25

🐛 Bug Fixes

  • misc: 修正没有呈现索引 url 的问题.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: 修正没有呈现索引 url 的问题 (75f94dd)

Version 1.2.4

Released on 2023-08-25

🐛 Bug Fixes

  • misc: 兼容 sdk 变更.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: 兼容 sdk 变更 (7ff08c8)

Version 1.2.3

Released on 2023-08-24

♻ Code Refactoring

  • misc: Refactor with new manifest schema.

<summary><kbd>Improvements and Fixes</kbd></summary>

Code refactoring

  • misc: Refactor with new manifest schema, closes #5 (583f834)

Version 1.2.2

Released on 2023-08-22

🐛 Bug Fixes

  • misc: Fix missing types.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

  • misc: Fix missing types (4d8029d)

Version 1.2.1

Released on 2023-08-22

🐛 Bug Fixes

  • misc: Fix not release.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's fixed

Version 1.2.0

Released on 2023-08-22

✨ Features

  • misc: Add reusable gateway function.

🐛 Bug Fixes

  • misc: Fix config error, fix config error.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's improved

  • misc: Add reusable gateway function (eba16ab)

What's fixed

Version 1.1.0

Released on 2023-08-20

✨ Features

  • misc: Custom market index url.

<summary><kbd>Improvements and Fixes</kbd></summary>

What's improved

  • misc: Custom market index url, closes #3 (14cd4b2)

Version 1.0.0

Released on 2023-08-19

♻ Code Refactoring

  • misc: Remove searchEngine, remove webCrawler.

✨ Features

  • misc: Chat plugin gateway 1.0, prod 生产锁定 indexURL 版本,先使用最简单的方式迁移插件服务端,初步剥离天气插件,支持 V1 manifest 版本的方案.

🐛 Bug Fixes

  • misc: Fix console time error, fix import error, fix request error, 修正动态链路的命中逻辑,修正动态链路的命中逻辑.

<summary><kbd>Improvements and Fixes</kbd></summary>

Code refactoring

  • misc: Remove searchEngine (d0fc888)
  • misc: Remove webCrawler (91663ea)

What's improved

  • misc: Chat plugin gateway 1.0, closes #2 (788a30a)
  • misc: Prod 生产锁定 indexURL 版本 (80cdafb)
  • misc: 先使用最简单的方式迁移插件服务端 (eaf26bd)
  • misc: 初步剥离天气插件,closes #1 (ecf1c4c)
  • misc: 支持 V1 manifest 版本的方案 (8f26a6c)

What's fixed

  • misc: Fix console time error (1cd882c)
  • misc: Fix import error (a9fa133)
  • misc: Fix request error (d8bb922)
  • misc: 修正动态链路的命中逻辑 (beb14eb)
  • misc: 修正动态链路的命中逻辑 (525654f)