Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

AI Answer stops working on 23 October: the gpt-3.5-turbo default shuts down, and its replacement rejects max_tokens

未关闭 适合新手
#402 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
api, backend

调研方向

从 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; accepts max_tokens) in ai_answer.go:109 and util.go:30.
  • Support the replacement: send the limit as max_completion_tokens for gpt-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 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

appbaseio/reactivesearch-api 的其他 Issue

查看 appbaseio/reactivesearch-api 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。