1.9.2 • Published 4 months ago

@fcodes/chat-plugins-gateway v1.9.2

Weekly downloads
-
License
-
Repository
github
Last release
4 months ago

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

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

TOC

👋 简介

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

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

🤯 使用方法

基本 URL

环境URL
PRODhttps://chat-plugins-gateway.lobehub.com
DEVhttps://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,大展身手,向我们展示你的奇思妙想。

🔗 Links

  • 🤖 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.

1.9.2

4 months ago

1.9.1

4 months ago

1.9.0

4 months ago