Skip to content

Conversation

@feitianbubu
Copy link
Contributor

@feitianbubu feitianbubu commented Jan 27, 2026

豆包视频支持首尾帧生视频, 增加role字段
文档: https://www.volcengine.com/docs/82379/1520757
image

Summary by CodeRabbit

  • New Features
    • Enhanced content items with role identification to better handle different media types (e.g., reference images, first frame, last frame).

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 27, 2026

Walkthrough

A new Role string field has been added to the ContentItem struct in the Doubao adaptor module. This field uses the JSON tag role,omitempty to support serialization of role values (such as reference_image, first_frame, or last_frame) for content items.

Changes

Cohort / File(s) Summary
Struct field addition
relay/channel/task/doubao/adaptor.go
Added Role string field with JSON tag role,omitempty to ContentItem struct to support role identification in content serialization

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested reviewers

  • creamlike1024

Poem

🐰 A role for each item, so fine and so clear,
With a humble omitempty, no need to fear,
The ContentItem hops with new purpose today,
Reference or frame—now it has its way! 🎬✨

🚥 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 accurately reflects the main change: adding support for first and last image frames in the doubao video feature through a new 'role' field.
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

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

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

⚠️ Outside diff range comments (1)
relay/channel/task/doubao/adaptor.go (1)

224-244: Add validation to prevent data: URLs from being used as image inputs.

Images from req.Images (lines 226-233) should be validated to prevent data: URLs, consistent with the pattern used in controller/task_video.go and vertex/adaptor.go. Data: URLs containing base64-encoded data should not be processed through the doubao API.

Additionally, the new Role field enables first/last frame video generation, but images added via req.Images don't have their Role set. Since metadata is unmarshaled directly into the requestPayload struct (line 241), users must specify content items with explicit role values through metadata rather than using req.Images.

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.

1 participant