Skip to content

Add Support for Inserting Multi-Modal Documents via the Helper Pane in the Expression Editor #1840

@dan-niles

Description

@dan-niles

Current Limitation

Currently, users need to manually type out the syntax to add multi-modal inputs - such as file, image, and audio documents - into the expression editor, when writing prompts for model providers:

${<ai:ImageDocument>{content: "https://ballerina.io/img/branding/ballerina_logo_dgrey_png.png"}}
${<ai:FileDocument>{content: "https://ballerina.io/pdf/ballerina_docs.pdf"}}
${<ai:AudioDocument>{content: "https://ballerina.io/mp3/branding/tech_talk.mp3"}}

This approach is not user-friendly for low-code users, as it requires prior knowledge of the syntax and document types.

Suggested Improvement

Enhance the expression helper pane to allow users to easily insert multi-modal document objects into the expression editor.
The helper pane currently supports inserting items like Inputs, Variables, Configurables, and Functions (as shown below).

Image

We can introduce a new section — for example, Documents — that lets users conveniently add ai:ImageDocument, ai:FileDocument, or ai:AudioDocument objects when editing an expression field of type ai:Prompt.

Version

1.5.0

Metadata

Metadata

Assignees

Labels

Area/AIIssues related to general AI features, except AI ArtifactsType/Improvement

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions