feat(dashscope): support video fps option for chat model - #293
feat(dashscope): support video fps option for chat model#293charliejinc wants to merge 2 commits into
Conversation
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c6b8c9db16
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (metadataFps instanceof Number num) { | ||
| return num.intValue(); |
There was a problem hiding this comment.
Preserve fractional video fps values
When callers set VIDEO_FPS to a valid fractional value such as 0.5 for a long/static video, this branch coerces any Number with intValue(), so 0.5 becomes 0, and the string path rejects "0.5" with Integer.parseInt. DashScope documents fps as a float in the range [0.1, 10] with default 2.0 (https://help.aliyun.com/zh/model-studio/qwen-api-via-dashscope), so these requests either fail validation or use the wrong sampling rate; store and serialize fps as a floating-point number instead.
Useful? React with 👍 / 👎.
Add fps (frame extraction rate) support for video content in the DashScope multimodal chat model. Changes: - Add fps field to DashScopeChatOptions for default video frame-rate configuration. - Add VIDEO_FPS metadata key to DashScopeApiConstants for per-message override. - Add fps field to DashScopeApiSpec.MediaContent so it is serialized into video content items. - Pass fps when building video content items; message metadata VIDEO_FPS takes precedence over DashScopeChatOptions.getFps(). - Add integration tests for single-video fps and message-level metadata override. - Fix DashScopeApiSpecTests class javadoc.
c6b8c9d to
d2558ae
Compare
|
I have read the CLA Document and I hereby sign the CLA |
|
Useful ,Fixed already
---- Replied Message ----
| From | ***@***.***> |
| Date | 07/20/2026 17:44 |
| To | spring-ai-alibaba/spring-ai-extensions ***@***.***> |
| Cc | Charlie ***@***.***>,
Author ***@***.***> |
| Subject | Re: [spring-ai-alibaba/spring-ai-extensions] feat(dashscope): support video fps option for chat model (PR #293) |
@chatgpt-codex-connector[bot] commented on this pull request.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:c6b8c9db16
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
Open a pull request for review
Mark a draft as ready
Comment ***@***.*** review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like ***@***.*** address that feedback".
In models/dashscope/src/main/java/com/alibaba/cloud/ai/dashscope/chat/DashScopeChatModel.java:
+ if (metadataFps instanceof Number num) {
+ return num.intValue();
Preserve fractional video fps values
When callers set VIDEO_FPS to a valid fractional value such as 0.5 for a long/static video, this branch coerces any Number with intValue(), so 0.5 becomes 0, and the string path rejects "0.5" with Integer.parseInt. DashScope documents fps as a float in the range [0.1, 10] with default 2.0 (https://help.aliyun.com/zh/model-studio/qwen-api-via-dashscope), so these requests either fail validation or use the wrong sampling rate; store and serialize fps as a floating-point number instead.
Useful? React with 👍 / 👎.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d2558ae6be
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| @JsonProperty("audio") String audio, @JsonProperty("fps") Double fps, | ||
| @JsonProperty("cache_control") Map<String, String> cacheControl) { |
There was a problem hiding this comment.
Preserve the existing MediaContent constructor
When downstream code uses the public record constructor that existed before this commit (new MediaContent(type, text, image, video, audio, cacheControl)), inserting fps before cacheControl removes the old (String, String, String, Object, String, Map) signature. Upgrading this library can therefore break source compatibility, or make already-compiled callers fail with NoSuchMethodError, even if they do not use fps; please keep an overload with the old signature that delegates with a null fps.
Useful? React with 👍 / 👎.
…ility Keep the (type, text, image, video, audio, cacheControl) overload so downstream callers compiled against the old signature don't break.
Description
Add
fps(frame extraction rate) support for video content in the DashScope multimodal chat model.Changes
fpsfield toDashScopeChatOptionsfor default video frame-rate configuration.VIDEO_FPSmetadata key toDashScopeApiConstantsfor per-message override.fpsfield toDashScopeApiSpec.MediaContentso it is serialized into video content items.DashScopeChatModelnow passes fps when building video content items; message metadataVIDEO_FPStakes precedence overDashScopeChatOptions.getFps().DashScopeApiSpecTestsclass javadoc.Usage