docs(comments): 注释中文化 · internal/runtime/multimodal(21 文件,纯替换)
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

- 只翻注释/文档字符串,代码零变化:go/scanner 词法流比对 21 文件 token+字面量全等,增删行数 1:1(467/467)
- 刻意保留非散文英文:JSON Schema description、工具 Description() 返回值、adapter prompt、API 路径与命令示例、环境变量名
- 逐行确认代码前缀未变,未触碰其他模块
This commit is contained in:
AskaEth committed 2026-10-04 12:28:16 +08:00
1 parent b9e042d07d
commit b0fbb8bc0d
21 files changed
+467 -467

No files matched your search

@@ -12,8 +12,8 @@ import (
"git.yeij.top/AskaEth/Cyrene_v2/internal/config"
)
// TestDashscopeCloner_Ok asserts the create_voice request body shape
// (model/action/target_model/prefix/url) and the voice_id parsing.
// TestDashscopeCloner_Ok 断言 create_voice 请求体的形状
// (model/action/target_model/prefix/url)以及 voice_id 的解析。
func TestDashscopeCloner_Ok(t *testing.T) {
t.Parallel()
var gotBody map[string]any
@@ -61,8 +61,8 @@ func TestDashscopeCloner_Ok(t *testing.T) {
}
}
// TestDashscopeCloner_DefaultPrefix asserts the empty prefix falls back to the
// configured VOICE_CLONE_PREFIX default ("cyrene").
// TestDashscopeCloner_DefaultPrefix 断言空前缀回退到
// 配置的 VOICE_CLONE_PREFIX 默认值("cyrene")。
func TestDashscopeCloner_DefaultPrefix(t *testing.T) {
t.Parallel()
var gotBody map[string]any
@@ -83,8 +83,8 @@ func TestDashscopeCloner_DefaultPrefix(t *testing.T) {
}
}
// TestDashscopeCloner_TargetModelOverride asserts target_model tracks the config
// TTSModel (must match the synthesis model).
// TestDashscopeCloner_TargetModelOverride 断言 target_model 跟随配置的
// TTSModel(必须与合成模型一致)。
func TestDashscopeCloner_TargetModelOverride(t *testing.T) {
t.Parallel()
var gotBody map[string]any
@@ -105,7 +105,7 @@ func TestDashscopeCloner_TargetModelOverride(t *testing.T) {
}
}
// TestDashscopeCloner_NotConfigured asserts a missing API key degrades.
// TestDashscopeCloner_NotConfigured 断言缺少 API key 时降级。
func TestDashscopeCloner_NotConfigured(t *testing.T) {
t.Parallel()
cloner := NewDashscopeCloner(config.VoiceConfig{})
@@ -114,7 +114,7 @@ func TestDashscopeCloner_NotConfigured(t *testing.T) {
}
}
// TestDashscopeCloner_EmptyURL asserts an empty reference URL is rejected.
// TestDashscopeCloner_EmptyURL 断言空的参考 URL 被拒绝。
func TestDashscopeCloner_EmptyURL(t *testing.T) {
t.Parallel()
cloner := NewDashscopeCloner(config.VoiceConfig{DashscopeBaseURL: "http://x", DashscopeAPIKey: "sk"})
@@ -123,8 +123,8 @@ func TestDashscopeCloner_EmptyURL(t *testing.T) {
}
}
// TestDashscopeCloner_BadPrefix asserts a non-alphanumeric or >10-char prefix is
// rejected before any request is sent.
// TestDashscopeCloner_BadPrefix 断言非字母数字或超过 10 字符的前缀
// 在发出任何请求之前就被拒绝。
func TestDashscopeCloner_BadPrefix(t *testing.T) {
t.Parallel()
cloner := NewDashscopeCloner(config.VoiceConfig{DashscopeBaseURL: "http://x", DashscopeAPIKey: "sk"})
@@ -135,8 +135,8 @@ func TestDashscopeCloner_BadPrefix(t *testing.T) {
}
}
// TestDashscopeCloner_ModelError asserts a top-level message in an HTTP 200
// response is surfaced as an error (no voice_id).
// TestDashscopeCloner_ModelError 断言 HTTP 200 响应中的顶层 message
// 会被作为错误暴露出来(此时没有 voice_id)。
func TestDashscopeCloner_ModelError(t *testing.T) {
t.Parallel()
srv := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@@ -151,8 +151,8 @@ func TestDashscopeCloner_ModelError(t *testing.T) {
}
}
// TestDashscopeTTS_Instruction_ClonedVoice asserts a cloned voice carries the
// configured instruction in the request input.
// TestDashscopeTTS_Instruction_ClonedVoice 断言复刻音色会在请求 input 中
// 携带配置的 instruction。
func TestDashscopeTTS_Instruction_ClonedVoice(t *testing.T) {
t.Parallel()
var gotBody map[string]any
@@ -182,8 +182,8 @@ func TestDashscopeTTS_Instruction_ClonedVoice(t *testing.T) {
}
}
// TestDashscopeTTS_NoInstruction_SystemVoice asserts a system voice (longxiaochun_v3)
// never receives a free-form instruction even when one is configured.
// TestDashscopeTTS_NoInstruction_SystemVoice 断言系统音色(longxiaochun_v3)
// 即使配置了 instruction 也绝不会收到自由形式的 instruction。
func TestDashscopeTTS_NoInstruction_SystemVoice(t *testing.T) {
t.Parallel()
var gotBody map[string]any
@@ -210,8 +210,8 @@ func TestDashscopeTTS_NoInstruction_SystemVoice(t *testing.T) {
}
}
// TestDashscopeTTS_Instruction_ContextOverride asserts a per-request ctx
// instruction wins over the configured one for a cloned voice.
// TestDashscopeTTS_Instruction_ContextOverride 断言对复刻音色,逐请求的 ctx
// instruction 优先于配置的 instruction。
func TestDashscopeTTS_Instruction_ContextOverride(t *testing.T) {
t.Parallel()
var gotBody map[string]any