Skip to content

Commit 23cddf9

Browse files
committed
fix: validating empty texts before run gte
- It ensures that only valid strings with content can be embeded
1 parent 69336ca commit 23cddf9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ext/ai/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ async fn run_gte(
280280
mean_pool: bool,
281281
normalize: bool,
282282
) -> Result<Vec<f32>, Error> {
283+
if prompt.is_empty() {
284+
bail!("must provide a valid prompt value, got 'empty'")
285+
}
286+
283287
let req_tx;
284288
{
285289
let op_state = state.borrow();

0 commit comments

Comments
 (0)