Relax text validation to support empty strings in multimodal scenarios #2284
RuiZhang-cn
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
code:
In DefaultChatClient.DefaultPromptUserSpec.text(), the current Assert.hasText(text) validation rejects empty strings. However, when calling the vision model, it is possible to pass an empty string to indicate that the user has only provided an image. For example, the following curl request works correctly:
Proposed Fix:
Modify the validation to allow empty strings while still rejecting null values:
Assert.notNull(text, "text cannot be null"); // Keep null check
this.text = text; // Allow empty string
Beta Was this translation helpful? Give feedback.
All reactions