Skip to content

feat: kling2.6 支持有声视频生成 - #2921

Closed
feitianbubu wants to merge 5204 commits into
QuantumNous:mainfrom
feitianbubu:pr/a7cc6498f63cafe56e6efeb09b47fa96e88e2ab9
Closed

feat: kling2.6 支持有声视频生成#2921
feitianbubu wants to merge 5204 commits into
QuantumNous:mainfrom
feitianbubu:pr/a7cc6498f63cafe56e6efeb09b47fa96e88e2ab9

Conversation

@feitianbubu

@feitianbubu feitianbubu commented Feb 11, 2026

Copy link
Copy Markdown
Member

https://app.klingai.com/cn/dev/document-api/apiReference/model/textToVideo
sound=on
mode=pro
image

Summary by CodeRabbit

  • New Features
    • Added support for three new Kling model variants: v2-1-master, v2-5-turbo, and v2-6
    • Introduced sound parameter configuration (v2.6+)
    • Added watermark management functionality

RedwindA and others added 30 commits January 9, 2026 20:46
…etchModels

fix: remove Minimax from FETCHABLE channels
…tchModels

fix(gemini): fetch model list via native v1beta/models endpoint
* feat: /v1/chat/completion -> /v1/response
…-auto-disable

feat: status code auto-disable configuration
* fix: setting ui

* fix: rm global.chat_completions_to_responses_policy

* fix: rm global.chat_completions_to_responses_policy
…Names

fix: clean propertyNames for gemini function
…t-param-override

feat: channel testing supports parameter overriding
* feat: codex channel

* feat: codex channel

* feat: codex oauth flow

* feat: codex refresh cred

* feat: codex usage

* fix: codex err message detail

* fix: codex setting ui

* feat: codex refresh cred task

* fix: import err

* fix: codex store must be false

* fix: chat -> responses tool call

* fix: chat -> responses tool call
…sing Claude's rendering logs, the two approaches handle input rendering differently.
common.GetRequestBody(c) read bod is null
Calcium-Ion and others added 26 commits February 8, 2026 00:17
…fo-input-token

fix: 使用openai兼容接口调用部分渠道在最终端点为claude原生端点下还是走了openai扣减input_token的逻辑
fix: 补全 streaming message_delta 事件缺失的 input_tokens 和 cache 相关字段
…sponses

feat: /v1/messages -> /v1/responses
…ion-configurable

feat: make 5m cache-creation ratio configurable
fix: 如果模型管理有自定义配置则不合并默认配置
fix: 修复模型管理"参与官方同步"与"状态"开关无法保存的问题
…inity-tips

optimize: channel affinity tips
Replace icon-based language options with plain text labels in both the
header dropdown and preferences settings to keep the UI clean and
avoid potential controversies. Remove unused country-flag-icons dependency.
Bumps [axios](https://github.com/axios/axios) from 1.12.0 to 1.13.5.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](axios/axios@v1.12.0...v1.13.5)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.13.5
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
…nd_yarn/web/axios-1.13.5

chore(deps): bump axios from 1.12.0 to 1.13.5 in /web
* feat(localization): added zh_TW

* fixed based on @coderabbitai

* updated false translation for zh_TW

* new workflow

* revert

* fixed a lot of translations

* turned most zh to zh-CN

* fallbacklang

* bruh

* eliminate ALL _

* fix: paths and other miscs thanks @Calcium-Ion

* fixed translation and temp fix for preferencessettings.js

* fixed translation error

* fixed issue about legacy support

* reverted stupid coderabbit's suggestion
* feat: logs cache field

* feat: logs cache field

* feat: logs cache field
# Conflicts:
#	README.fr.md
#	README.ja.md
#	README.md
#	README.zh_CN.md
@coderabbitai

coderabbitai Bot commented Feb 11, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The Kling adaptor is enhanced to support new Kling v2.6+ features. A new WatermarkInfo struct is introduced alongside a Sound field in the request payload. The GetModelList method is updated to include additional Kling model variants (v2-1-master, v2-5-turbo, v2-6) beyond the existing ones.

Changes

Cohort / File(s) Summary
Kling Adaptor Enhancement
relay/channel/task/kling/adaptor.go
Added Sound field to requestPayload for audio control (v2.6+). Introduced new WatermarkInfo struct with Enabled bool field and integrated it into requestPayload. Expanded GetModelList() to support three new Kling v2 model variants in addition to existing v1 and v2-master models.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 Hop, hop, the Kling adaptor grows!
New sounds and watermarks now flow,
With v2 models fresh and bright,
Supporting v2.6's delight!
Features bloom where data goes! 🎬

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: kling2.6 支持有声视频生成' (feature: kling2.6 support for sound video generation) accurately reflects the main change: adding support for the kling-v2-6 model with sound generation capabilities.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
relay/channel/task/kling/adaptor.go (2)

5-5: 🛠️ Refactor suggestion | 🟠 Major

Direct encoding/json import violates coding guidelines.

This file imports encoding/json and uses json.Marshal/json.Unmarshal directly in multiple places (lines 165, 189, 276, 280, 349, 383) instead of the required wrapper functions. Line 410 already correctly uses common.Marshal. The new fields introduced in this PR (Sound, WatermarkInfo) are serialized through these non-compliant calls.

Suggested fix

Replace all direct json.Marshal/json.Unmarshal calls with common.Marshal/common.Unmarshal, and remove the encoding/json import (keeping only type references like json.RawMessage if needed — though none appear used here).

-	"encoding/json"
-	data, err := json.Marshal(body)
+	data, err := common.Marshal(body)
-	err = json.Unmarshal(responseBody, &kResp)
+	err = common.Unmarshal(responseBody, &kResp)
-	medaBytes, err := json.Marshal(metadata)
+	medaBytes, err := common.Marshal(metadata)
-	err = json.Unmarshal(medaBytes, &r)
+	err = common.Unmarshal(medaBytes, &r)
-	err := json.Unmarshal(respBody, &resPayload)
+	err := common.Unmarshal(respBody, &resPayload)
-	if err := json.Unmarshal(originTask.Data, &klingResp); err != nil {
+	if err := common.Unmarshal(originTask.Data, &klingResp); err != nil {

As per coding guidelines, "All JSON marshal/unmarshal operations MUST use the wrapper functions in common/json.go: common.Marshal(), common.Unmarshal() ... Do NOT directly import or call encoding/json in business code."


256-284: ⚠️ Potential issue | 🔴 Critical

Replace direct json.Marshal/json.Unmarshal calls with common.Marshal and common.Unmarshal wrappers.

Lines 276 and 280 use json.Marshal() and json.Unmarshal() directly. Per coding guidelines, all JSON operations must use the wrapper functions from common/json.go: common.Marshal() and common.Unmarshal(). Apply this fix to all JSON operations in this file.

The metadata unmarshal pattern for Sound and WatermarkInfo is correct — these fields are intentionally populated via the metadata pass-through mechanism, which is consistent with TaskSubmitReq.Metadata being map[string]interface{}.

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.