feat(templates): use a single template for multimodals messages #3892
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request includes significant changes to the way multimodal content (images, audio, and video) is handled and templated in the backend configuration and request processing. The most important changes include consolidating individual media fields into a single
Multimodal
field, updating the request configuration to handle multiple media types more efficiently, and enhancing the templating logic to support multimodal content.As opposed to #3728 - this PR focuses on replacing the following YAML configuration:
With a simple:
that gives more granular control for each placeholder
Backend Configuration Updates:
Video
,Image
, andAudio
fields into a singleMultimodal
field in theTemplateConfig
struct incore/config/backend_config.go
.Templating Logic Improvements:
MultiModalOptions
andMultimodalContent
types, along with a default multimodal template inpkg/templates/multimodal.go
. TheTemplateMultiModal
function now uses these types to generate content placeholders dynamically.Testing Enhancements:
pkg/templates/multimodal_test.go
to ensure theTemplateMultiModal
function correctly handles various scenarios, including messages with multiple types of media.Notes for Reviewers
Signed commits