feat: add HuoShanV3 HTTP Chunked TTS adapter#579
Open
shenenqing wants to merge 1 commit intoLianjiaTech:developfrom
Open
feat: add HuoShanV3 HTTP Chunked TTS adapter#579shenenqing wants to merge 1 commit intoLianjiaTech:developfrom
shenenqing wants to merge 1 commit intoLianjiaTech:developfrom
Conversation
Collaborator
|
@claude 检查提交的代码,使用中文回复 |
Collaborator
|
Claude finished @szl97's task —— View job 火山引擎 V3 TTS 适配器代码审查报告
总体评价这个 PR 实现了火山引擎 V3 HTTP Chunked TTS 适配器,代码架构合理,遵循了现有的适配器模式。整体实现质量较高,但有几个方面需要注意和改进。 具体审查意见🟢 优点
🟡 需要注意的问题
🟠 潜在改进点
🔵 具体修改建议HuoShanV3Adaptor.java // 第36行和第46行
HuoShanV3Request v3Request = HuoShanV3Request.from(request, property);HuoShanV3StreamTtsCallback.java // 第70-73行,改进错误处理
if (!response.isSuccess()) {
log.warn("HuoShanV3 stream error: code={}, message={}", response.getCode(), response.getMessage());
HttpStatus status = mapErrorCode(response.getCode()); // 需要添加此方法或注入适配器
BellaException error = new BellaException.ChannelException(status.value(), status.getReasonPhrase(), response.getMessage());
finish(error);
return;
}HuoShanV3Property.java @Data
@EqualsAndHashCode(callSuper = true)
public class HuoShanV3Property extends TtsProperty {
@NotNull
String appId;
@NotNull
String accessKey;
@NotNull
String resourceId;
}安全性检查✅ 没有发现明显的安全漏洞 结论这是一个高质量的实现,代码结构合理,功能完整。主要问题是一些小的命名不一致和错误处理细节。建议在合并前修复这些小问题,整体上可以合并。 |
实现火山引擎 V3 HTTP Chunked 流式 TTS 适配器,对接 openspeech.bytedance.com/api/v3/tts/unidirectional 接口。 支持流式和非流式 TTS,使用 X-Api-* 自定义 Header 认证。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f4283ff to
3dd6d1e
Compare
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.
Summary
openspeech.bytedance.com/api/v3/tts/unidirectional接口X-Api-*自定义 Header 认证BellaStreamCallback实现 HTTP Chunked 逐行 JSON 解析和 base64 音频解码新增文件
HuoShanV3Property.java— channel 配置 DTO(appId, accessKey, resourceId)HuoShanV3Request.java— V3 请求体结构,支持 extra_body 透传HuoShanV3Response.java— V3 响应体,含错误码映射HuoShanV3Adaptor.java— TTS 适配器(Component:HuoShanV3Tts)HuoShanV3StreamTtsCallback.java— 流式回调,按行拆分 JSON 并解码音频🤖 Generated with Claude Code