Repository navigation
图片链接和原样的 image_url / input_image 块转成 base64 交给 agy - #29
Merged
Merged
Conversation
…agy inline agy takes images only as base64, and upstream refuses an image by URL. The bridge now downloads an image link (same private-address guard, size cap and cache as video links) and also converts the raw OpenAI image_url / input_image part some /v1/responses requests reach the plugin with, which upstream rejected as an unknown block type. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
agy 只收 base64 图片,上游对图片链接回 400。生产上 Sub2API 一个用户 24 小时有约 1 万条 400(
a content block of type "image_url" is not supported,以及an image source other than base64)。改动(都在
Video (local patch)里)image_url/input_image块,url 是字符串或{url}):下载后按文件头识别成 PNG/JPEG/GIF/WebP,转成 base64image块;识别成视频的照旧转video块;都不是的留给上游判断。image_url块里的data:URL 直接解码成对应的块。AGY_BRIDGE_VIDEO_PRIVATE=1放开),最多 100 MB、3 次跳转,缓存一小时。测试
fork/patch-e2e.mjs17/17;新用例在AGY_BRIDGE_VIDEO=0时失败。bun test:失败项和上游快照相同(catalog、re2、usage、“config names the provider”、“a read longer than magpie waits”)。169.254.169.254链接 400。🤖 Generated with Claude Code