Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

将主线的更改同步到分叉仓库 #10

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
- name: Build and push to DockerHub
uses: docker/build-push-action@v2
with:
context: .
Expand All @@ -61,20 +61,20 @@ jobs:
${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-dingtalk:${{ env.GITHUB_REF_NAME }}
${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-dingtalk:latest

# 镜像推送到 ghcr
# - name: Login to the GitHub Container Registry
# uses: docker/login-action@v2
# with:
# registry: ghcr.io
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# 镜像推送到 阿里云仓库
- name: Login to the Ali Registry
uses: docker/login-action@v2
with:
registry: registry.cn-hangzhou.aliyuncs.com
username: ${{ secrets.ALIHUB_USERNAME }}
password: ${{ secrets.ALIHUB_TOKEN }}

# - name: Build and push image:latest
# uses: docker/build-push-action@v3
# with:
# context: .
# push: true
# platforms: linux/amd64,linux/arm64
# tags: |
# ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-dingtalk:${{ env.GITHUB_REF_NAME }}
# ghcr.io/${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-dingtalk:latest
- name: Build and push to Ali
uses: docker/build-push-action@v3
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: |
registry.cn-hangzhou.aliyuncs.com/${{ secrets.ALIHUB_USERNAME }}/chatgpt-dingtalk:${{ env.GITHUB_REF_NAME }}
registry.cn-hangzhou.aliyuncs.com/${{ secrets.ALIHUB_USERNAME }}/chatgpt-dingtalk:latest
48 changes: 30 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<br>

<p align='center'>
www.qiniai.com
www.connectai-e.com
</p>
</p>

Expand All @@ -29,7 +29,7 @@
<img src="https://camo.githubusercontent.com/82291b0fe831bfc6781e07fc5090cbd0a8b912bb8b8d4fec0696c881834f81ac/68747470733a2f2f70726f626f742e6d656469612f394575424971676170492e676966" width="800" height="3">
</div><br>

<a href='https://qiniai.com' target="_blank" rel="noopener noreferrer">
<a href='https://www.connectai-e.com' target="_blank" rel="noopener noreferrer">
<img src='https://user-images.githubusercontent.com/33259379/223607306-2ac836a2-7ce5-4a12-a16e-bec40b22d8d6.png' alt='' />
</a>

Expand All @@ -40,7 +40,7 @@
如果开源版无法满足您公司的需求,推荐您尝试目前正在内测的商业交付版本。

<p align='center'>
<a href='https://qiniai.com' target="_blank" rel="noopener noreferrer">
<a href='https://www.connectai-e.com' target="_blank" rel="noopener noreferrer">
<img src='https://user-images.githubusercontent.com/50035229/239670160-7178f68e-2e97-46a6-b692-a2c43191b45b.png' alt='' width='800'/>
</a>
</p>
Expand All @@ -66,8 +66,10 @@
- 专人技术支持: 配备专业部署交付人员与后期一对一维护服务
- 同时提供在线Saas版/企业级私有部署

企业咨询:15623677720
企业客户咨询: 15623677720

<img width="300" src="https://github.com/ConnectAI-E/Feishu-OpenAI/assets/110169811/e4350e7f-cf1f-4499-932d-7a0ee2385e11">
<img width="300" src="https://github.com/ConnectAI-E/Feishu-OpenAI/assets/110169811/ef313ce0-158e-4314-a932-e6b1180cc750">

---

Expand Down Expand Up @@ -124,12 +126,12 @@

⚗️ openai官方提供了一个 **[状态页](https://status.openai.com/)** 来呈现当前openAI服务的状态,同时如果有问题发布公告也会在这个页面,如果你感觉它有问题了,可以在这个页面看看。

| <div style="width:200px">AI</div> | <img width=110> SDK <img width=110> | Application |
| <div style="width:200px">AI</div> | <img width=120> SDK <img width=120> | Application |
| :-------------------------------: | :----------------------------------------------------------: | :----------------------------------------------------------: |
| 🎒OpenAI | [Go-OpenAI](https://github.com/ConnectAI-E/Go-OpenAI) | [🏅Feishu-OpenAI](https://github.com/ConnectAI-E/Feishu-OpenAI), [🎖Lark-OpenAI](https://github.com/ConnectAI-E/Lark-OpenAI), [Feishu-EX-ChatGPT](https://github.com/ConnectAI-E/Feishu-EX-ChatGPT), [🎖Feishu-OpenAI-Stream-Chatbot](https://github.com/ConnectAI-E/Feishu-OpenAI-Stream-Chatbot), [Feishu-TLDR](https://github.com/ConnectAI-E/Feishu-TLDR),[Feishu-OpenAI-Amazing](https://github.com/ConnectAI-E/Feishu-OpenAI-Amazing), [Feishu-Oral-Friend](https://github.com/ConnectAI-E/Feishu-Oral-Friend), [Feishu-OpenAI-Base-Helper](https://github.com/ConnectAI-E/Feishu-OpenAI-Base-Helper), [Feishu-Vector-Knowledge-Management](https://github.com/ConnectAI-E/Feishu-Vector-Knowledge-Management), [Feishu-OpenAI-PDF-Helper](https://github.com/ConnectAI-E/Feishu-OpenAI-PDF-Helper), [🏅Dingtalk-OpenAI](https://github.com/ConnectAI-E/Dingtalk-OpenAI), [Wework-OpenAI](https://github.com/ConnectAI-E/Wework-OpenAI), [WeWork-OpenAI-Node](https://github.com/ConnectAI-E/WeWork-OpenAI-Node), [llmplugin](https://github.com/ConnectAI-E/llmplugin) |
| 🤖 AutoGPT | ------ | [🏅AutoGPT-Next-Web](https://github.com/ConnectAI-E/AutoGPT-Next-Web) |
| 🎭 Stablediffusion | ------ | [🎖Feishu-Stablediffusion](https://github.com/ConnectAI-E/Feishu-Stablediffusion) |
| 🍎 Midjourney | [Go-Midjourney](https://github.com/ConnectAI-E/Feishu-Midjourney/tree/main/midjourney) | [🏅Feishu-Midjourney](https://github.com/ConnectAI-E/Feishu-Midjourney), [MidJourney-Web](https://github.com/ConnectAI-E/MidJourney-Web), [Dingtalk-Midjourney](https://github.com/ConnectAI-E/Dingtalk-Midjourney) |
| 🍎 Midjourney | [Go-Midjourney](https://github.com/ConnectAI-E/Go-Midjourney) | [🏅Feishu-Midjourney](https://github.com/ConnectAI-E/Feishu-Midjourney), [🔥MidJourney-Web](https://github.com/ConnectAI-E/MidJourney-Web), [Dingtalk-Midjourney](https://github.com/ConnectAI-E/Dingtalk-Midjourney) |
| 🍍 文心一言 | [Go-Wenxin](https://github.com/ConnectAI-E/Go-Wenxin) | [Feishu-Wenxin](https://github.com/ConnectAI-E/Feishu-Wenxin), [Dingtalk-Wenxin](https://github.com/ConnectAI-E/Dingtalk-Wenxin), [Wework-Wenxin](https://github.com/ConnectAI-E/Wework-Wenxin) |
| 💸 Minimax | [Go-Minimax](https://github.com/ConnectAI-E/Go-Minimax) | [Feishu-Minimax](https://github.com/ConnectAI-E/Feishu-Minimax), [Dingtalk-Minimax](https://github.com/ConnectAI-E/Dingtalk-Minimax), [Wework-Minimax](https://github.com/ConnectAI-E/Wework-Minimax) |
| ⛳️ CLAUDE | [Go-Claude](https://github.com/ConnectAI-E/Go-Claude) | [Feishu-Claude](https://github.com/ConnectAI-E/Feishu-Claude), [DingTalk-Claude](https://github.com/ConnectAI-E/DingTalk-Claude), [Wework-Claude](https://github.com/ConnectAI-E/Wework-Claude) |
Expand All @@ -142,6 +144,9 @@






## 功能介绍

- 🚀 帮助菜单:通过发送 `帮助` 将看到帮助列表,[🖼 查看示例](#%E5%B8%AE%E5%8A%A9%E5%88%97%E8%A1%A8)
Expand Down Expand Up @@ -182,7 +187,7 @@ $ docker run -itd --name chatgpt -p 8090:8090 \
-v ./data:/app/data --add-host="host.docker.internal:host-gateway" \
-e LOG_LEVEL="info" -e APIKEY=换成你的key -e BASE_URL="" \
-e MODEL="gpt-3.5-turbo" -e SESSION_TIMEOUT=600 \
-e MAX_QUESTION_LENL=4096 -e MAX_ANSWER_LEN=4096 -e MAX_TEXT=4096 \
-e MAX_QUESTION_LENL=2048 -e MAX_ANSWER_LEN=2048 -e MAX_TEXT=4096 \
-e HTTP_PROXY="http://host.docker.internal:15732" \
-e DEFAULT_MODE="单聊" -e MAX_REQUEST=0 -e PORT=8090 \
-e SERVICE_URL="你当前服务外网可访问的URL" -e CHAT_TYPE="0" \
Expand All @@ -193,7 +198,7 @@ $ docker run -itd --name chatgpt -p 8090:8090 \
-e DINGTALK_CREDENTIALS="your_client_id1:secret1,your_client_id2:secret2" \
-e HELP="欢迎使用本工具\n\n你可以查看:[用户指南](https://github.com/eryajf/chatgpt-dingtalk/blob/main/docs/userGuide.md)\n\n这是一个[开源项目](https://github.com/eryajf/chatgpt-dingtalk/)
,觉得不错你可以来波素质三连." \
--restart=always dockerproxy.com/eryajf/chatgpt-dingtalk:latest
--restart=always registry.cn-hangzhou.aliyuncs.com/ali_eryajf/chatgpt-dingtalk
```

> 运行命令中映射的配置文件参考下边的[配置文件说明](#%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E8%AF%B4%E6%98%8E)。
Expand All @@ -210,7 +215,7 @@ $ docker run -itd --name chatgpt -p 8090:8090 \
$ cp config.example.yml config.yml # 其中 config.example.yml 从项目的根目录获取

# 运行项目
$ docker run -itd --name chatgpt -p 8090:8090 -v `pwd`/config.yml:/app/config.yml --restart=always dockerproxy.com/eryajf/chatgpt-dingtalk:latest
$ docker run -itd --name chatgpt -p 8090:8090 -v `pwd`/config.yml:/app/config.yml --restart=always registry.cn-hangzhou.aliyuncs.com/ali_eryajf/chatgpt-dingtalk
```

其中配置文件参考下边的配置文件说明。
Expand Down Expand Up @@ -395,14 +400,14 @@ run_mode: "stream"
api_key: "xxxxxxxxx"
# 如果你使用官方的接口地址 https://api.openai.com,则留空即可,如果你想指定请求url的地址,可通过这个参数进行配置,注意需要带上 http 协议,如果你是用的是azure,则该配置项可以留空或者直接忽略
base_url: ""
# 指定模型,默认为 gpt-3.5-turbo , 可选参数有: "gpt-4-0314", "gpt-4", "gpt-3.5-turbo-0301", "gpt-3.5-turbo",如果使用gpt-4,请确认自己是否有接口调用白名单,如果你是用的是azure,则该配置项可以留空或者直接忽略
# 指定模型,默认为 gpt-3.5-turbo , 可选参数有: "gpt-4-32k-0613", "gpt-4-32k-0314", "gpt-4-32k", "gpt-4-0613", "gpt-4-0314", "gpt-4", "gpt-3.5-turbo-16k-0613", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-0301", "gpt-3.5-turbo",如果使用gpt-4,请确认自己是否有接口调用白名单,如果你是用的是azure,则该配置项可以留空或者直接忽略
model: "gpt-3.5-turbo"
# 会话超时时间,默认600秒,在会话时间内所有发送给机器人的信息会作为上下文
session_timeout: 600
# 最大问题长度
max_question_len: 4096
max_question_len: 2048
# 最大回答长度
max_answer_len: 4096
max_answer_len: 2048
# 最大上下文文本长度,通常该参数可设置为与模型Token限制相同
max_text: 4096
# 指定请求时使用的代理,如果为空,则不使用代理,注意需要带上 http 协议 或 socks5 协议,如果你是用的是azure,则该配置项可以留空或者直接忽略
Expand Down Expand Up @@ -512,17 +517,17 @@ credentials:
</a>
</td>
<td align="center">
<a href="https://github.com/Leizhenpeng">
<img src="https://avatars.githubusercontent.com/u/50035229?v=4" width="75;" alt="Leizhenpeng"/>
<a href="https://github.com/ffinly">
<img src="https://avatars.githubusercontent.com/u/29793346?v=4" width="75;" alt="ffinly"/>
<br />
<sub><b>RiverRay</b></sub>
<sub><b>Finly</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/ffinly">
<img src="https://avatars.githubusercontent.com/u/29793346?v=4" width="75;" alt="ffinly"/>
<a href="https://github.com/Leizhenpeng">
<img src="https://avatars.githubusercontent.com/u/50035229?v=4" width="75;" alt="Leizhenpeng"/>
<br />
<sub><b>Finly</b></sub>
<sub><b>RiverRay</b></sub>
</a>
</td>
<td align="center">
Expand Down Expand Up @@ -589,6 +594,13 @@ credentials:
<sub><b>Stoneflying</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/suyunkai">
<img src="https://avatars.githubusercontent.com/u/82149368?v=4" width="75;" alt="suyunkai"/>
<br />
<sub><b>Null</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/WinMin">
<img src="https://avatars.githubusercontent.com/u/18380453?v=4" width="75;" alt="WinMin"/>
Expand Down
6 changes: 3 additions & 3 deletions config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ run_mode: "stream"
api_key: "xxxxxxxxx"
# 如果你使用官方的接口地址 https://api.openai.com,则留空即可,如果你想指定请求url的地址,可通过这个参数进行配置,注意需要带上 http 协议,如果你是用的是azure,则该配置项可以留空或者直接忽略
base_url: ""
# 指定模型,默认为 gpt-3.5-turbo , 可选参数有: "gpt-4-0314", "gpt-4", "gpt-3.5-turbo-0301", "gpt-3.5-turbo",如果使用gpt-4,请确认自己是否有接口调用白名单,如果你是用的是azure,则该配置项可以留空或者直接忽略
# 指定模型,默认为 gpt-3.5-turbo , 可选参数有: "gpt-4-32k-0613", "gpt-4-32k-0314", "gpt-4-32k", "gpt-4-0613", "gpt-4-0314", "gpt-4", "gpt-3.5-turbo-16k-0613", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-0301", "gpt-3.5-turbo",如果使用gpt-4,请确认自己是否有接口调用白名单,如果你是用的是azure,则该配置项可以留空或者直接忽略
model: "gpt-3.5-turbo"
# 会话超时时间,默认600秒,在会话时间内所有发送给机器人的信息会作为上下文
session_timeout: 600
# 最大问题长度
max_question_len: 4096
max_question_len: 2048
# 最大回答长度
max_answer_len: 4096
max_answer_len: 2048
# 最大上下文文本长度,通常该参数可设置为与模型Token限制相同
max_text: 4096
# 指定请求时使用的代理,如果为空,则不使用代理,注意需要带上 http 协议 或 socks5 协议,如果你是用的是azure,则该配置项可以留空或者直接忽略
Expand Down
7 changes: 3 additions & 4 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type Configuration struct {
// 会话超时时间
SessionTimeout time.Duration `yaml:"session_timeout"`
// 最大问题长度
MaxQuestionLen int `yaml:"max_question_len"`
MaxQuestionLen int `yaml:"max_question_len"`
// 最大答案长度
MaxAnswerLen int `yaml:"max_answer_len"`
// 最大文本 = 问题 + 回答, 接口限制
Expand Down Expand Up @@ -224,11 +224,10 @@ func LoadConfig() *Configuration {
if azureOpenaiToken != "" {
config.AzureOpenAIToken = azureOpenaiToken
}

credentials := os.Getenv("DINGTALK_CREDENTIALS")
if credentials != "" {
if config.Credentials == nil {
config.Credentials = []Credential{}
}
config.Credentials = []Credential{}
for _, idSecret := range strings.Split(credentials, ",") {
items := strings.SplitN(idSecret, ":", 2)
if len(items) == 2 {
Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ version: '3'
services:
chatgpt:
container_name: chatgpt
image: eryajf/chatgpt-dingtalk:latest
image: registry.cn-hangzhou.aliyuncs.com/ali_eryajf/chatgpt-dingtalk
restart: always
environment:
LOG_LEVEL: "info" # 应用的日志级别 info/debug
APIKEY: xxxxxx # 你的 api_key
RUN_MODE: "stream" # 运行模式,http 或者 stream ,强烈建议你使用stream模式,通过此链接了解:https://open.dingtalk.com/document/isvapp/stream
BASE_URL: "" # 如果你使用官方的接口地址 https://api.openai.com,则留空即可,如果你想指定请求url的地址,可通过这个参数进行配置,注意需要带上 http 协议
MODEL: "gpt-3.5-turbo" # 指定模型,默认为 gpt-3.5-turbo , 可选参数有: "gpt-4-0314", "gpt-4", "gpt-3.5-turbo-0301", "gpt-3.5-turbo",如果使用gpt-4,请确认自己是否有接口调用白名单
MODEL: "gpt-3.5-turbo" # 指定模型,默认为 gpt-3.5-turbo , 可选参数有: "gpt-4-32k-0613", "gpt-4-32k-0314", "gpt-4-32k", "gpt-4-0613", "gpt-4-0314", "gpt-4", "gpt-3.5-turbo-16k-0613", "gpt-3.5-turbo-16k", "gpt-3.5-turbo-0613", "gpt-3.5-turbo-0301", "gpt-3.5-turbo",如果使用gpt-4,请确认自己是否有接口调用白名单,如果你是用的是azure,则该配置项可以留空或者直接忽略
SESSION_TIMEOUT: 600 # 会话超时时间,默认600秒,在会话时间内所有发送给机器人的信息会作为上下文
MAX_QUESTION_LEN: 4096 # 最大问题长度,默认4096 token,正常情况默认值即可,如果使用gpt4-8k或gpt4-32k,可根据模型token上限修改。
MAX_ANSWER_LEN: 4096 # 最大回答长度,默认4096 token,正常情况默认值即可,如果使用gpt4-8k或gpt4-32k,可根据模型token上限修改。
MAX_QUESTION_LEN: 2048 # 最大问题长度,默认4096 token,正常情况默认值即可,如果使用gpt4-8k或gpt4-32k,可根据模型token上限修改。
MAX_ANSWER_LEN: 2048 # 最大回答长度,默认4096 token,正常情况默认值即可,如果使用gpt4-8k或gpt4-32k,可根据模型token上限修改。
MAX_TEXT: 4096 # 最大文本 = 问题 + 回答, 接口限制,默认4096 token,正常情况默认值即可,如果使用gpt4-8k或gpt4-32k,可根据模型token上限修改。
HTTP_PROXY: http://host.docker.internal:15777 # 指定请求时使用的代理,如果为空,则不使用代理,注意需要带上 http 协议 或 socks5 协议
DEFAULT_MODE: "单聊" # 指定默认的对话模式,可根据实际需求进行自定义,如果不设置,默认为单聊,即无上下文关联的对话模式
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/go-resty/resty/v2 v2.7.0
github.com/open-dingtalk/dingtalk-stream-sdk-go v0.0.4
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/sashabaranov/go-openai v1.6.1
github.com/sashabaranov/go-openai v1.12.0
github.com/solywsh/chatgpt v0.0.14
gopkg.in/yaml.v2 v2.4.0
gorm.io/gorm v1.24.6
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
github.com/sashabaranov/go-openai v1.6.1 h1:cALA9G00gPapNqun8vVBFGsDssywpU6wys4BpQ0bWqY=
github.com/sashabaranov/go-openai v1.6.1/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
github.com/sashabaranov/go-openai v1.12.0 h1:aRNHH0gtVfrpIaEolD0sWrLLRnYQNK4cH/bIAHwL8Rk=
github.com/sashabaranov/go-openai v1.12.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
Expand Down
5 changes: 2 additions & 3 deletions pkg/chatgpt/chatgpt.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ func New(userId string) *ChatGPT {
public.Config.AzureOpenAIToken,
"https://"+public.Config.AzureResourceName+".openai."+
"azure.com/",
public.Config.AzureDeploymentName,
)
} else {
if public.Config.HttpProxy != "" {
Expand All @@ -61,8 +60,8 @@ func New(userId string) *ChatGPT {
ctx: ctx,
userId: userId,
maxQuestionLen: public.Config.MaxQuestionLen, // 最大问题长度
maxAnswerLen: public.Config.MaxAnswerLen, // 最大答案长度
maxText: public.Config.MaxText, // 最大文本 = 问题 + 回答, 接口限制
maxAnswerLen: public.Config.MaxAnswerLen, // 最大答案长度
maxText: public.Config.MaxText, // 最大文本 = 问题 + 回答, 接口限制
timeOut: public.Config.SessionTimeout,
doneChan: timeOutChan,
cancel: func() {
Expand Down
Loading