AI Answer stops working on 23 October: the gpt-3.5-turbo default shuts down, and its replacement rejects max_tokens
还没有人认领这个 Issue。
评估
调研方向
从 plugins/openai/util.go 中的 BuildChatGPTBody 开始,并检查 plugins/pipelines/ai_answer.go 中的默认值。检查 OpenAI 插件测试是否覆盖请求正文;当所选修复适用于受影响模型的默认值,或通过 gpt-5* 模型接受的参数发送 token 限制时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
When no model is set, the AI Answer pipeline stage and the OpenAI plugin default to gpt-3.5-turbo with 300 max tokens (plugins/pipelines/ai_answer.go:109-122, plugins/openai/util.go:30-32). OpenAI shuts down gpt-3.5-turbo on 23 October 2026 and names gpt-5.6-terra. BuildChatGPTBody always sends the limit as max_tokens (plugins/openai/util.go:1267), and terra replies:
Unsupported parameter: 'max_tokens' is not supported with this model. Use 'max_completion_tokens' instead.
The same applies to anyone who sets a gpt-5* model in their config today, since max_tokens is always sent.
Fix — either one (both tested live with your default prompt):
- One line each: default to
gpt-4.1-mini(not retiring; acceptsmax_tokens) inai_answer.go:109andutil.go:30. - Support the replacement: send the limit as
max_completion_tokensforgpt-5*models. With 300, terra answered normally.
// If maxTokens is passed, inject it in the request body
if maxTokens != nil {
- requestBodyAsMap["max_tokens"] = *maxTokens
+ if strings.HasPrefix(model, "gpt-5") {
+ requestBodyAsMap["max_completion_tokens"] = *maxTokens
+ } else {
+ requestBodyAsMap["max_tokens"] = *maxTokens
+ }
}
- 主要语言
- Go
- 星标
- 212
- 派生
- 29
- 平均合并
- 13 分钟
- 30 天内合并 PR
- 2
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
appbaseio/reactivesearch-api 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 30/100
appbaseio/reactivesearch-api#382 ·
-
难度 3/5 1-2 天 新手友好度 35/100
appbaseio/reactivesearch-api#377 ·
-
Internal Server Error when posting a permission while being authenticated with another permission可能重新可做 @deepjyoti30 于 1352 天前认领,目前没有进行中的 PR。 未关闭
appbaseio/reactivesearch-api#367 · 已指派 1 人 ·
-
难度 4/5 3-5 天 新手友好度 25/100
appbaseio/reactivesearch-api#151 · 4 条评论 ·
-
Add test cases for the users plugin可能重新可做 @harsh-2711 于 2584 天前认领,目前没有进行中的 PR。 未关闭
appbaseio/reactivesearch-api#19 · 1 条评论 · 已指派 1 人 ·
查看 appbaseio/reactivesearch-api 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 70/100
prime-radiant-inc/evener#3873 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 86/100
pion/interceptor#479 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 70/100
slavakurilyak/awesome-ai-agents#710 ·
维护者通常 1 天内回复
-
agent-butler-finding agent-research-recommend bug ready-for-agent
难度 2/5 1-3 小时 新手友好度 76/100
jordansmall/spindrift#4614 · 1 条评论 ·
维护者通常 1 天内回复