feat(vlm): 支持vlm单独配置请求超时时间 - #119
Open
rranr wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat(vlm): 支持单独配置请求超时时间
背景
#107
知识库上传图片后会调用 VLM 生成图片描述。原实现直接复用全局
syncHttpClient,其读取超时为 30 秒。当 VLM 正常响应时间超过该限制时,图片分块任务会因timeout失败。修改内容
ai.vlm.timeout-ms配置,默认值为120000毫秒。ModelTarget。syncHttpClient派生 VLM 客户端,仅覆盖readTimeout和callTimeout,保留原有连接、写入及重试配置。timeout-ms时继续使用全局同步 HTTP 客户端,保持向后兼容。0或负数时,在启动阶段校验失败。配置示例
兼容性影响
syncHttpClient超时配置。验证
相关后端测试
./mvnw -pl rag -am \ -Dtest=VlmConfigValidatorTest,ModelSelectorTest,RoutingVlmServiceTest,RagentCoreApplicationTests \ -Dsurefire.failIfNoSpecifiedTests=false test结果:18 个测试全部通过。
前端类型检查与生产构建
cd frontend npx tsc --noEmit VITE_API_BASE_URL=/api/ragent npm run build结果:类型检查和生产构建通过。
截图
系统设置页面的 VLM 卡片会展示当前配置的超时时间。此处设置为
timeout-ms: 120000