Add custom validation to require either prompt or image in Embedding Generation Explorer

Created on 6 May 2025, 3 days ago

Problem/Motivation

Currently, the Embeddings Generation Explorer includes two fields: a text field for the prompt and an upload field for the image. However, no validation is in place to ensure that at least one of these fields is filled in.

This can lead to a confusing user experience where a submission is made without providing any meaningful input, resulting in unnecessary API calls or silent failures.

Steps to reproduce

1. Go to AI Explorers > Embeddings Generation Explorer
2. Leave both the 'Prompt' and 'Image' fields empty
3. Click the 'Generate Embedding' button
4. Observe that the form may submit or attempt API interaction without user input

Proposed resolution

Add a custom validation handler that checks if either the prompt or image field is filled. If both are empty, display a validation error prompting the user to provide at least one.

Expected Behavior :

  • If both fields are left empty, form submission should be blocked with a clear validation message.
  • If at least one field is filled, the form should submit as expected.

Remaining tasks

- Implement the code

User interface changes

API changes

Data model changes

✨ Feature request
Status

Active

Version

1.1

Component

AI Core module

Created by

🇮🇳India Ishani Patel

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024