Skip to content

Conversation

leandrodamascena
Copy link
Contributor

Closes #1411

Summary

This pull request adds a new VideoUrl class that will enable models to use video in their agents. This also include this video support to the BedrockConverseModel

Changes

  • Added support for VideoUrl and make BedrockConverseModel aware of that
  • Updated relevant tests to cover new functionality
  • Improved documentation for video URL integration

Type of Change

  • Feature (new functionality)
  • Bug fix
  • Documentation update

Checklist

  • I have added tests
  • I have updated the documentation
  • I have performed a self-review of my own code

Hi @Kludex, I'm uploading a short video showing this working.

Screen.Recording.2025-04-10.at.08.34.16.mov

Copy link
Contributor

hyperlint-ai bot commented Apr 10, 2025

PR Change Summary

Enhanced the BedrockConverseModel to support video input through the new VideoUrl class, along with updated documentation and tests.

  • Added VideoUrl support to BedrockConverseModel
  • Updated tests to include video functionality
  • Improved documentation for video input integration

Modified Files

  • docs/input.md

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

'format': format,
'source': {'bytes': response.content},
}
content.append({'image': video}) # type: ignore - Verify
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I probably need to understand a bit more about content. It's complaining because VideoBlockTypeDef supports extra keys for S3 location.

Copy link
Member

Choose a reason for hiding this comment

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

It's because you are passing 'image' instead of 'video'.

@leandrodamascena
Copy link
Contributor Author

The CI is failing, let me see what's going on.

from ._utils import generate_tool_call_id as _generate_tool_call_id, now_utc as _now_utc
from .exceptions import UnexpectedModelBehavior

AudioMediaType: TypeAlias = Literal['audio/wav', 'audio/mpeg']
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just moved this whole block for better readability.

@leandrodamascena
Copy link
Contributor Author

I don't know why the test coverage is failing. I can't have the same scenario in the local environment, only in CI. I need guidance here.

@leandrodamascena leandrodamascena requested a review from Kludex April 10, 2025 11:56
@leandrodamascena leandrodamascena changed the title feat(bedrock): enable VideoUrl input for BedrockConverseModel feat(bedrock): add VideoUrl input for BedrockConverseModel Apr 10, 2025
'format': format,
'source': {'bytes': response.content},
}
content.append({'image': video}) # type: ignore - Verify
Copy link
Member

Choose a reason for hiding this comment

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

It's because you are passing 'image' instead of 'video'.

@leandrodamascena
Copy link
Contributor Author

Hi @Kludex, thanks for updating the PR! I forgot to update the video key, even though I have it on another local branch. I'm sorry and thanks for fixing that.

@Kludex
Copy link
Member

Kludex commented Apr 11, 2025

Thanks for this. Finally a contribution that uses VCR :)

(Maybe we need to document better how to use VCR...)

@Kludex Kludex enabled auto-merge (squash) April 11, 2025 10:40
@leandrodamascena
Copy link
Contributor Author

Thanks for this. Finally a contribution that uses VCR :)

(Maybe we need to document better how to use VCR...)

Thanks a lot for your feedback and review! I'll start working on another PR to support more Bedrock configuration fields, and I can try to improve the VCR documentation... or if you prefer, I can open another issue with that.

Valeu!!

@leandrodamascena
Copy link
Contributor Author

I think there is some random error in the pipeline. Maybe re-run will solve it.

@Kludex Kludex merged commit 925a377 into pydantic:main Apr 11, 2025
15 checks passed
@Kludex
Copy link
Member

Kludex commented Apr 11, 2025

Thanks for this. Finally a contribution that uses VCR :)
(Maybe we need to document better how to use VCR...)

Thanks a lot for your feedback and review! I'll start working on another PR to support more Bedrock configuration fields, and I can try to improve the VCR documentation... or if you prefer, I can open another issue with that.

Valeu!!

PRs welcome :)

@Kludex
Copy link
Member

Kludex commented Apr 11, 2025

I think there is some random error in the pipeline. Maybe re-run will solve it.

I'm checking. It's recent...

@kylesf kylesf mentioned this pull request Apr 24, 2025
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.

BedrockConverseModel - Add Video Support for AWS Bedrock Integration
2 participants