Feature clarification: AI provider enhancements — thinking mode, vision image input, and API host normalization
还没有人认领这个 Issue。
评估
调研方向
首先跟踪模型列表端点和聊天客户端,然后沿着提供商设置继续追踪到聊天补全请求、站点信息、聊天输入和对话历史。确认涵盖了提议的三个提供商增强功能及其所述限制,使用简洁的上游错误,并且不持久化图像数据;现有的推理内容渲染路径应仍然可用。
由索引模型根据 Issue 内容生成。
描述
Background
We run a self-hosted Apache Answer as a community FAQ site, with an
OpenAI-compatible LLM gateway (SenseNova). While integrating the AI feature we
hit three concrete gaps. Following @LinkinStars's suggestion on #1594, this
issue clarifies the proposed feature set before the PR is resubmitted.
Proposed enhancements
1. API host normalization (bugfix)
The admin AI settings accept an "API host", but the model-listing endpoint
concatenates api_host + "/v1/models" while the chat client auto-appends
/v1. A base URL that already contains /v1 — the normal convention for
OpenAI-compatible gateways (SenseNova, SiliconFlow, OneAPI relays, vLLM,
SGLang...) — therefore produces /v1/v1/models and fails with the gateway's
NOT_FOUND error, which is passed through to the UI verbatim.
Proposal: a shared NormalizeAPIHost() helper (trim whitespace/trailing
slashes, append /v1 when missing, keep /v1beta/* endpoints intact) used by
both code paths, plus concise upstream error summaries instead of echoing raw
response bodies.
2. Per-provider thinking mode switch
Reasoning-capable models are increasingly common (DeepSeek V4, Qwen3,
SenseNova, ...). Proposal: an admin switch per AI provider that injects the
OpenAI-compatible enable_thinking: true flag into chat completion requests.
The existing reasoning_content streaming/rendering path already displays the
thought process, so no front-end change is required for display.
3. Per-provider vision (image input) switch
Proposal: an admin switch enabling image attachments in AI conversations —
up to 4 PNG/JPEG/WebP images (≤4 MB decoded each) sent as base64 data URLs or
HTTPS links, converted to MultiContent parts. The switch is exposed via site
info (ai_vision_enabled) so the chat input only shows the attach button for
vision-capable providers. History records keep a textual placeholder instead
of persisting image data, so no DB schema change is needed.
Scope / non-goals
- No new provider protocols (OpenAI-compatible only); Anthropic removed from
the default provider list since the backend speaks the OpenAI protocol. - No multi-provider routing or per-user model selection.
- No persistence of image attachments in conversation history.
Related
- #1594 (will be closed and resubmitted referencing this issue).
- Regarding the security reminder in #1594: the flagged constant was the base64
of a standard 1×1-pixel PNG placeholder used in a unit test, not a credential.
To avoid any misreading, the test now constructs the image at runtime from its
signature bytes and the source contains no base64 blob.
Happy to hear feedback on the scope before resubmitting. Thanks!
- 主要语言
- Go
- 星标
- 15.7k
- 派生
- 1.4k
- 平均合并
- 1 天 20 小时
- 30 天内合并 PR
- 6
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/answer 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 65/100
-
Hardening: cap the invite_user list size in UpdateQuestionInviteUser to bound notification fan-out 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 88/100
-
Gravatar hash is computed from the un-lowercased email, so mixed-case accounts render an identicon 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 70/100
-
acceptance-tests phase-coding schema-coverage testing triaged
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100