Skip to content

fix: some video native bug and web api doc#594

Merged
zijiren233 merged 4 commits into
labring:mainfrom
zijiren233:video-native2
May 27, 2026
Merged

fix: some video native bug and web api doc#594
zijiren233 merged 4 commits into
labring:mainfrom
zijiren233:video-native2

Conversation

@zijiren233

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the supported “mode/type” surface in the web UI (including API docs + i18n labels) and fixes native video handling by adding proper request validation/usage extraction for Ali/Doubao, plus improving how video request metadata is persisted and later used for async usage and status/content endpoints.

Changes:

  • Web: extend model type options to cover all relay modes (1–38), update UI handling for new video-native modes, and add extensive per-mode API documentation and translations.
  • Core: add request validation/usage/price controllers for AliVideo and DoubaoVideo modes; adjust consume-recording rules for new task modes.
  • Core adaptors: refine Doubao stored-metadata handling; add/adjust native video usage-context behavior and tests for Ali/Doubao async usage and native flows.

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
web/src/types/model.ts Expands mode/type option list to 1–38 and updates which modes support limits/fuzzy match.
web/src/feature/model/components/ModelForm.tsx Updates per-type UI field visibility for additional video-native modes.
web/src/feature/model/components/api-doc/ApiDoc.tsx Adds many new mode-specific API doc entries and examples.
web/public/locales/zh/translation.json Adds zh labels for new modeType keys 14–38.
web/public/locales/en/translation.json Adds en labels for new modeType keys 14–38.
core/relay/controller/video_doubao.go New Doubao native video request validation/usage/price helpers.
core/relay/controller/video_doubao_test.go Tests for Doubao native video request validation and usage context.
core/relay/controller/video_ali.go New Ali native video request validation/usage/price helpers.
core/relay/controller/video_ali_test.go Tests for Ali native video request validation and usage context.
core/relay/adaptor/doubao/video.go Switches Doubao from storing full request to storing normalized metadata; applies stored metadata to responses.
core/relay/adaptor/doubao/main_test.go Updates existing tests for new Doubao metadata storage + adds native usage-context tests.
core/relay/adaptor/doubao/doubao_video.go Improves Doubao native video request conversion + applies stored metadata; ensures native usage context uses native resolution.
core/relay/adaptor/doubao/doubao_video_test.go Updates tests for new Doubao metadata behavior and native usage-context fallback.
core/relay/adaptor/doubao/async_usage.go Adjusts succeeded-path usageContext handling for Doubao native mode.
core/relay/adaptor/ali/async_usage.go Adds Ali native async-usage wrapper to normalize usageContext to native resolution.
core/relay/adaptor/ali/ali_video.go Updates Ali native request conversion/handlers to store metadata and produce native usageContext.
core/relay/adaptor/ali/ali_video_test.go Updates and extends Ali native request/handler tests for new metadata + usageContext behavior.
core/relay/adaptor/ali/adaptor_test.go Adds Ali native async-usage tests for native resolution + fallback behavior.
core/controller/relay-controller.go Wires AliVideo and DoubaoVideo to new controller validation/usage/price functions.
core/controller/relay-controller_test.go Extends relay-controller tests to cover AliVideo and DoubaoVideo wiring.
core/common/consume/consume.go Updates consume-recording skip rules for Ali/Doubao task modes and Doubao delete 204.
core/common/consume/consume_record_test.go Adds tests covering consume-recording behavior for the new modes/status codes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +768 to +778
endpoint: '/files/{file}',
method: 'GET',
responseFormat: 'json',
requestExample: `curl --request GET \\
--url ${apiEndpoint}/v1beta/files/files/abc123 \\
--header "Authorization: Bearer $token"`,
responseExample: `{
"name": "files/abc123",
"uri": "https://generativelanguage.googleapis.com/v1beta/files/abc123",
"state": "ACTIVE"
}`
)
if size != "" {
meta.Set(metaAliVideoSize, size)
}

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 51 out of 52 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • core/docs/docs.go: Language not supported

Comment on lines +160 to +171
func doubaoNativeVideoString(node *ast.Node) string {
if node == nil || !node.Exists() || node.TypeSafe() == ast.V_NULL {
return ""
}

value, err := node.String()
if err != nil {
return ""
}

return value
}
Comment on lines +173 to +184
func doubaoNativeVideoInt(node *ast.Node) int {
if node == nil || !node.Exists() || node.TypeSafe() == ast.V_NULL {
return 0
}

value, err := node.Int64()
if err != nil {
return 0
}

return int(value)
}
@zijiren233 zijiren233 merged commit de4ade2 into labring:main May 27, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants