@@ -647,6 +647,10 @@ pub fn transform_json(
647647inputs : default ! ( Vec <& str >, "ARRAY[]::TEXT[]" ) ,
648648cache : default ! ( bool , false ) ,
649649) ->JsonB {
650+ if let Err ( err) =crate :: bindings:: transformers:: whitelist:: verify_task ( & task. 0 ) {
651+ error ! ( "{err}" ) ;
652+ }
653+
650654match crate :: bindings:: transformers:: transform ( & task. 0 , & args. 0 , inputs) {
651655Ok ( output) =>JsonB ( output) ,
652656Err ( e) =>error ! ( "{e}" ) ,
@@ -663,6 +667,9 @@ pub fn transform_string(
663667cache : default ! ( bool , false ) ,
664668) ->JsonB {
665669let task_json =json ! ( { "task" : task} ) ;
670+ if let Err ( err) =crate :: bindings:: transformers:: whitelist:: verify_task ( & task_json) {
671+ error ! ( "{err}" ) ;
672+ }
666673match crate :: bindings:: transformers:: transform ( & task_json, & args. 0 , inputs) {
667674Ok ( output) =>JsonB ( output) ,
668675Err ( e) =>error ! ( "{e}" ) ,
@@ -681,6 +688,9 @@ pub fn transform_conversational_json(
681688if !task. 0 [ "task" ] . as_str ( ) . is_some_and ( |v| v =="conversational" ) {
682689error ! ( "ARRAY[]::JSONB inputs for transform should only be used with a conversational task" ) ;
683690}
691+ if let Err ( err) =crate :: bindings:: transformers:: whitelist:: verify_task ( & task. 0 ) {
692+ error ! ( "{err}" ) ;
693+ }
684694match crate :: bindings:: transformers:: transform ( & task. 0 , & args. 0 , inputs) {
685695Ok ( output) =>JsonB ( output) ,
686696Err ( e) =>error ! ( "{e}" ) ,
@@ -700,6 +710,9 @@ pub fn transform_conversational_string(
700710error ! ( "ARRAY[]::JSONB inputs for transform should only be used with a conversational task" ) ;
701711}
702712let task_json =json ! ( { "task" : task} ) ;
713+ if let Err ( err) =crate :: bindings:: transformers:: whitelist:: verify_task ( & task_json) {
714+ error ! ( "{err}" ) ;
715+ }
703716match crate :: bindings:: transformers:: transform ( & task_json, & args. 0 , inputs) {
704717Ok ( output) =>JsonB ( output) ,
705718Err ( e) =>error ! ( "{e}" ) ,