Commit fc44c82
committed
重构 AI 模型和翻译处理程序,使其使用安全的 API 请求
- 更新了 `loadAiModelRegistry` 和 `loadTranslationModelRegistry` 函数,使其使用 `secureApiRequest` 获取 AI 模型和翻译模型。
- 为 AI 模型和翻译模型引入了新的处理程序函数,确保请求和响应的安全处理。
- 实现了从 JSON 文件加载 AI 模型和翻译模型的配置。
- 为请求处理添加了全面的日志记录,包括 Redis 连接和无效请求的错误处理。
- 通过改进提示和重试机制,增强了翻译和摘要功能。
- 建立了用于提取响应和解析翻译的实用函数。1 parent 9c59922 commit fc44c82
15 files changed
Lines changed: 754 additions & 934 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
132 | | - | |
133 | | - | |
| 132 | + | |
| 133 | + | |
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
| 141 | + | |
| 142 | + | |
145 | 143 | | |
146 | 144 | | |
147 | 145 | | |
| |||
0 commit comments