feat: 绘图API兼容URL响应 + 新增自定义接口配置#79
Merged
Merged
Conversation
在 ImageData 结构体中添加 url 字段,并在 parse_response 函数中实现对 URL 格式响应的兼容处理:
- 优先解析 b64_json 格式
- 当 b64_json 不存在时,自动从 url 下载图片数据
- 支持用户提供的响应格式:{"data":[{"url":"https://...", "revised_prompt":"..."}]}
本次提交新增了多项绘图功能配置项: 1. 支持自定义生图和编辑接口路径,适配不同服务商API 2. 新增参考图数据格式选项,支持对象数组与字符串数组两种格式 3. 可自定义图片请求参数名,适配不同API要求 4. 重构了设置面板,将基础配置与高级配置折叠展示 5. 完善了类型定义与参数校验逻辑 6. 适配后端新的API请求格式,支持自定义参数名与数据格式
Contributor
|
已按 merge-first 处理并合并此 PR。合并后我单独补了后续优化提交,覆盖审查中发现的几个遗漏点:\n\n- URL 格式图片响应下载增加 HTTP 状态、大小上限和图片内容校验,避免 404/HTML 等非图片内容被保存为成功结果。\n- 自定义图片参数名现在覆盖 multipart 路径,不再只对 base64 JSON 路径生效。\n- 补齐前端 DrawingGenerateInput 的 reference_image_param_name 类型契约,并补充相关回归测试。\n\n验证项:pnpm typecheck、绘图前端测试、aqbot-providers openai_images 测试、Tauri drawing command 测试。 |
Contributor
Author
|
看到commit了,感谢大佬帮忙完善代码细节👍 |
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.
已进行测试,测试通过