Skip to content

fix: 修复DashScope兼容模式音频识别400错误 - #601

Merged
AAswordman merged 1 commit into
AAswordman:mainfrom
luojiaping:fix/audio-data-url
Jun 14, 2026
Merged

fix: 修复DashScope兼容模式音频识别400错误#601
AAswordman merged 1 commit into
AAswordman:mainfrom
luojiaping:fix/audio-data-url

Conversation

@luojiaping

Copy link
Copy Markdown
Collaborator

问题

DashScope 兼容模式的 input_audio.data 字段要求 URL 格式(公网 URL 或 data URL),不接受裸 base64 字符串。

当前 Operit 将音频以裸 base64 字符串直接放入 input_audio.data,导致 DashScope 返回 400:

<400> InternalError.Algo.InvalidParameter: The provided URL does not appear to be valid.

修复

ALIYUN provider 将 base64 包装为 data:audio/{mimeType};base64,... 格式,其他 provider 保持原有裸 base64 格式不变。

测试

用 DashScope API Key 实测:

  • 裸 base64:Status 400(The provided URL does not appear to be valid)
  • data URL:Status 200 ✅(正确返回音频分析结果)

影响范围

仅影响 OpenAIProvider.ktbuildContentField 方法的音频部分,只对 ApiProviderType.ALIYUN 生效,其他 provider 不受影响。

Fixes #600

DashScope兼容模式的input_audio.data字段要求URL格式,不接受裸base64。
对ALIYUN provider将base64包装为data URL格式,其他provider不变。

Fixes AAswordman#600
@AAswordman
AAswordman merged commit 29a7f69 into AAswordman:main Jun 14, 2026
@luojiaping
luojiaping deleted the fix/audio-data-url branch June 15, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] 音频识别:OOM崩溃后文件上传链路永久损坏 + 兼容模式接口间歇403

2 participants