Skip to content

Commit

Permalink
merge: 完善文档
Browse files Browse the repository at this point in the history
  • Loading branch information
TBXark authored Oct 27, 2023
2 parents a751d31 + 7acd40f commit 52b4d4c
Show file tree
Hide file tree
Showing 18 changed files with 329 additions and 260 deletions.
83 changes: 38 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,57 @@
# ChatGPT-Telegram-Workers

[English Version](./doc/en/README.md)
<h1 align="center">
ChatGPT-Telegram-Workers
</h1>

最简单快捷部署属于自己的ChatGPT Telegram机器人的方法。使用Cloudflare Workers,单文件,直接复制粘贴一把梭,无需任何依赖,无需配置本地开发环境,不用域名,免服务器。
可以自定义系统初始化信息,让你调试好的性格永远不消失。
<p align="center">
<br> English | <a href="./doc/cn/README.md">中文</a>
</p>
<p align="center">
<em>Deploy your own Telegram ChatGPT bot on Cloudflare Workers with ease.</em>
</p>

<details>
<summary>查看Demo</summary>
<img style="max-width: 600px;" alt="image" src="./doc/demo.jpg">
</details>

## 使用说明

### 分支

- [`master`](https://github.com/TBXark/ChatGPT-Telegram-Workers/tree/master) 稳定版
- [`dev`](https://github.com/TBXark/ChatGPT-Telegram-Workers/tree/dev) 开发版,可能会有一些新功能,但是不稳定。会快速修复一些bug。

### 配置

> 推荐在Workers配置界面填写环境变量, 而不是直接修改js代码中的变量
配置信息和命令使用说明,见 [配置文档](./doc/CONFIG.md)
## About

### 部署流程
The simplest and fastest way to deploy your own ChatGPT Telegram bot. Use Cloudflare Workers, single file, copy and paste directly, no dependencies required, no need to configure local development environment, no domain name required, serverless.

详情见 [部署流程](./doc/DEPLOY.md)
You can customize the system initialization information so that your debugged personality never disappears.

如果需要部署在其他平台可以查看 [多平台部署](./doc/PLATFORM.md)

### 自动更新

> 使用`Github Action`自动更新 `Cloudflare Workers`
详情见 [自动更新](./doc/ACTION.md)


## 更新日志
<details>
<summary>example</summary>
<img style="max-width: 600px;" alt="image" src="./doc/demo.jpg">
</details>

- v1.6.0
- 添加[`workers ai`](https://developers.cloudflare.com/workers-ai/)支持,具体配置查看[配置文档](./doc/CONFIG.md)
- 优化openai流模式解析器
## Features

其他更新日志见[CHANGELOG.md](./doc/CHANGELOG.md)
- Serverless deployment
- Support for multiple OpenAI keys
- Support for multiple Telegram bots
- Support for Azure OpenAI Service
- Support for Cloudflare AI (free)
- Support for streaming output
- Support for custom roles
- Support for multiple platforms deployment

## 最佳实践
## Documentation

~~新建多个机器人绑定到同一个workers,设置`TELEGRAM_AVAILABLE_TOKENS`,每个机器人赋予不同的`SYSTEM_INIT_MESSAGE`~~。开启群聊模式,新建多个群聊,每个群内只有自己个机器人,每个群的机器人由不同的`SYSTEM_INIT_MESSAGE`,比如翻译专家,文案专家,代码专家。然后每次根据自己的需求和不同的群里的机器人聊天,这样就不用经常切换配置属性。
- [Documentation](./doc/en/README.md)
- [How to deploy](./doc/en/DEPLOY.md)
- [How to set up configuration](./doc/en/CONFIG.md)
- [Automatic update](./doc/en/ACTION.md)
- [Support Platform](./doc/en/PLATFORM.md)
- [Change Log](./doc/en/CHANGELOG.md)


## 特别鸣谢
## Special thanks

![https://www.jetbrains.com/?from=tbxark](https://user-images.githubusercontent.com/9513891/236592683-1ea579cf-08ff-4703-b313-db038f62bab0.svg)

感谢 [JetBrains](https://www.jetbrains.com/?from=tbxark) 提供的开源开发许可证。
Thanks for the open-source development license provided by [JetBrains](https://www.jetbrains.com/?from=tbxark).

## 贡献者
## Contributors

这个项目存在是因为所有贡献者的帮助。[贡献](https://github.com/tbxark/ChatGPT-Telegram-Workers/graphs/contributors).
This project exists thanks to all the people who contribute. [Contribute](https://github.com/tbxark/ChatGPT-Telegram-Workers/graphs/contributors).

## 许可证
## License

**ChatGPT-Telegram-Workers** MIT 许可证的形式发布。[查看许可证](./LICENSE) 获取更多细节。
**ChatGPT-Telegram-Workers** is released under the MIT license. [See LICENSE](LICENSE) for details.
18 changes: 0 additions & 18 deletions doc/PLATFORM.md

This file was deleted.

2 changes: 1 addition & 1 deletion doc/ACTION.md → doc/cn/ACTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

1. 在 Github 仓库的 Settings -> Secrets 中添加以下 Secrets
- CF_API_TOKEN: 你的Cloudflare API TOKEN
- WRANGLER_TOML: 完整的 wrangler.toml 文件内容,可以参考[wrangler-example.toml](../wrangler-example.toml)
- WRANGLER_TOML: 完整的 wrangler.toml 文件内容,可以参考[wrangler-example.toml](../../wrangler-example.toml)
- CF_WORKERS_DOMAIN(可选): 你的Cloudflare Workers 路由(Workers 路由里你的*.workers.dev值,不带https://)
2. 在 Github 仓库的 Settings -> Actions 中,将 Actions 启用

Expand Down
4 changes: 4 additions & 0 deletions doc/CHANGELOG.md → doc/cn/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# 更新日志

- v1.6.0
- 添加workers ai支持,具体配置查看配置文档
- 优化openai流模式解析器

- v1.5.0
- perf: 调整命令顺序
- perf: openai发送请求前前发送loading消息
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions doc/DEPLOY.md → doc/cn/DEPLOY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 部署流程

[English Version](./en/DEPLOY_EN.md)
[English Version](../en/DEPLOY.md)

## 视频教程

Expand Down Expand Up @@ -36,7 +36,7 @@

1. 打开 [Cloudflare Workers](https://dash.cloudflare.com/?to=/:account/workers) 注册账号
2. 点击右上角的 `Create a Service`
3. 进入新建的workers, 选择`Quick Edit`, 将[`../dist/index.js`](../dist/index.js)代码复制到编辑器中,保存
3. 进入新建的workers, 选择`Quick Edit`, 将[`../dist/index.js`](../../dist/index.js)代码复制到编辑器中,保存


### 四. 配置环境变量
Expand Down
18 changes: 18 additions & 0 deletions doc/cn/PLATFORM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 支持平台

### 1. [Cloudflare Workers](https://workers.cloudflare.com/)

最简单的方法,本项目默认支持的部署方式,详情看[部署流程](DEPLOY.md)。免费,无需域名,无需服务器,无需配置本地开发环境。KV存储,无需数据库,但是有一定的存储限制,
> KV每天写入限制为1000次,不过对于聊天机器人来说,应该够用了。(调试模式`DEBUG_MODE`会保存最新一条消息到KV,token统计每次对话成功都会更新统计数据,所以会有一定的写入次数。如果你经常使用次数超过1000次,可以考虑关闭调试模式和者使用统计)
### 2. [Vercel](https://vercel.com/)

详情看[Vercel](../../adapter/vercel/README.md)。免费,无需域名,无需服务器。需要配置本地开发环境部署,不能通过复制粘贴部署。无存储服务,需要自己配置数据库。可以使用[Redis Cloud](https://redis.com)的免费redis。可以连接github自动部署,但是需要了解vercel的配置。

### 3. [Render](https://render.com/)

详情看[Render](../../adapter/render)。免费,无需域名,无需服务器。需要有一定的开发能力。

### 4. Local

详情看[Local](../../adapter/local/README.md)。本地的部署方式,需要配置本地开发环境,需要有一定的开发能力。
53 changes: 53 additions & 0 deletions doc/cn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<h1 align="center">
ChatGPT-Telegram-Workers
</h1>

<p align="center">
<br> <a href="../../README.md">English</a> | 中文
</p>
<p align="center">
<em>轻松在Cloudflare Workers上部署您自己的Telegram ChatGPT机器人。</em>
</p>

## 关于
最简单快捷部署属于自己的ChatGPT Telegram机器人的方法。使用Cloudflare Workers,单文件,直接复制粘贴一把梭,无需任何依赖,无需配置本地开发环境,不用域名,免服务器。 可以自定义系统初始化信息,让你调试好的性格永远不消失。

<details>
<summary>查看Demo</summary>
<img style="max-width: 600px;" alt="image" src="../demo.jpg">
</details>

## 特性

- 无服务器部署
- 支持多个OpenAI密钥
- 支持多个Telegram机器人
- 支持Azure OpenAI服务
- 支持Cloudflare AI(免费)
- 支持流式输出
- 支持自定义角色
- 支持多平台部署

## 文档

- [如何部署](./DEPLOY.md)
- [如何设置配置](./CONFIG.md)
- [自动更新](./ACTION.md)
- [支持平台](./PLATFORM.md)
- [变更日志](./CHANGELOG.md)


## 特别感谢

![https://www.jetbrains.com/?from=tbxark](https://user-images.githubusercontent.com/9513891/236592683-1ea579cf-08ff-4703-b313-db038f62bab0.svg)

感谢[JetBrains](https://www.jetbrains.com/?from=tbxark)提供的开源开发许可证。


## 贡献者

这个项目存在是因为所有贡献的人。[贡献](https://github.com/tbxark/ChatGPT-Telegram-Workers/graphs/contributors)

## 许可证

**ChatGPT-Telegram-Workers** 以 MIT 许可证发布。[详见 LICENSE](../../LICENSE) 获取详情。
2 changes: 1 addition & 1 deletion doc/en/doc/ACTION.md → doc/en/ACTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To create a Cloudflare API Token with Workers permissions, follow these steps:

1. Add the following Secrets to the Github repository's Settings -> Secrets
- CF_API_TOKEN: Your Cloudflare API TOKEN
- WRANGLER_TOML: The full content of the wrangler.toml file. Refer to [wrangler-example.toml](../../../wrangler-example.toml) for an example.
- WRANGLER_TOML: The full content of the wrangler.toml file. Refer to [wrangler-example.toml](../../wrangler-example.toml) for an example.
- CF_WORKERS_DOMAIN (optional): Your Cloudflare Workers route (the value of your *.workers.dev in the Workers route, without https://)
2. Enable Actions in the Github repository's Settings -> Actions

Expand Down
11 changes: 11 additions & 0 deletions doc/en/doc/CHANGELOG.md → doc/en/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

- v1.6.0
- Add workers AI support, please refer to the configuration document for specific settings.
- Optimize the parser for openai stream mode.

- v1.5.0
- perf: Adjust command order
- perf: Send loading message before sending request to OpenAI
- feat: Add support for streaming output. Enabled by default. Use `STREAM_MODE=false` to disable.
- feat: Add compatibility for multiple keys, randomly select a key to use.
- feat: Add shortcut buttons `/new`, `/redo`.

- v1.4.0
- Support deployment on multiple platforms
- Added `/redo` command to resend or modify the previous question
Expand Down
Loading

0 comments on commit 52b4d4c

Please sign in to comment.