Repository navigation
Conversation
与 1Panel-dev#135 的联网搜索工具配套:Search 负责检索, Fetch 负责抓取单个网页并转换为 Markdown 正文。 - POST https://api.deepseek.com/v1/tools/fetch - max_chars 控制正文上限,超长自动截断并标注 - 403/404 等按业务失败处理(success=false + 中文 hint),不抛异常 - api_key 作为启动参数(密码框),与输入参数分离
✅ PR 自动校验结果状态: 校验通过 |
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.
(已关闭,改用 #138,原因:本 PR 分支历史被 #135 的内容污染,且 head 分支无法通过 API 替换。)
添加 DeepSeek 网页抓取工具(Fetch)
配套 DeepSeek 联网搜索工具(#135):Search 负责检索,Fetch 负责抓正文。
功能
POST https://api.deepseek.com/v1/tools/fetchmax_chars控制正文上限(默认 8000),超长自动截断并标注title / content / markdown / truncated,同时给出# 标题 + 来源链接 + 正文的拼装结果success=false+ 中文hint,不抛异常参数
api_keyurlmax_chars错误处理
400/401/402/403/404/429/5xx分级返回提示。其中403(被安全策略拒)与404(无可提取正文)按业务失败处理,编排中可据此跳过该链接继续,而非中断流程。
推荐编排
关于描述长度
初版描述为 156 字符,导入时报
value too long for type character varying(128)(
Tool.desc在apps/tools/models/tool.py中为CharField(max_length=128))。已压缩至 89 字符,并重新生成
.tool;生成脚本已加入逐字段长度断言。验证
.tool通过RestrictedUnpickler白名单反序列化自测Tool模型max_length,无超长字段main位于代码末尾