@@ -372,49 +372,14 @@ private function documentEnqueuePost(
372372 ): array {
373373 /** @var CurlHandle $ch */
374374 $ ch = $ this ->initChannel ();
375- $ postFields = ['model_id ' => $ params ->modelId ];
375+ $ postFields = $ params ->asHash ();
376+
376377 if ($ inputSource instanceof URLInputSource) {
377378 $ postFields ['url ' ] = $ inputSource ->url ;
378379 } elseif ($ inputSource instanceof LocalInputSource) {
379380 $ inputSource ->checkNeedsFix ();
380381 $ postFields ['file ' ] = $ inputSource ->fileObject ;
381382 }
382-
383- if (is_a ($ params , InferenceParameters::class)) {
384- if (isset ($ params ->rawText )) {
385- $ postFields ['raw_text ' ] = $ params ->rawText ? 'true ' : 'false ' ;
386- }
387- if (isset ($ params ->polygon )) {
388- $ postFields ['polygon ' ] = $ params ->polygon ? 'true ' : 'false ' ;
389- }
390- if (isset ($ params ->confidence )) {
391- $ postFields ['confidence ' ] = $ params ->confidence ? 'true ' : 'false ' ;
392- }
393- if (isset ($ params ->rag )) {
394- $ postFields ['rag ' ] = $ params ->rag ? 'true ' : 'false ' ;
395- }
396- if (isset ($ params ->textContext )) {
397- $ postFields ['text_context ' ] = $ params ->textContext ;
398- }
399- if (isset ($ params ->dataSchema )) {
400- $ postFields ['data_schema ' ] = strval ($ params ->dataSchema );
401- }
402- }
403- if (isset ($ params ->webhooksIds ) && count ($ params ->webhooksIds ) > 0 ) {
404- if (PHP_VERSION_ID < 80200 && count ($ params ->webhooksIds ) > 1 ) {
405- // NOTE: see https://bugs.php.net/bug.php?id=51634
406- error_log ("PHP version is too low to support webbook array destructuring.
407- \nOnly the first webhook ID will be sent to the server. " );
408- $ postFields ['webhook_ids ' ] = $ params ->webhooksIds [0 ];
409- } else {
410- foreach ($ params ->webhooksIds as $ webhookId ) {
411- $ postFields ['webhook_ids[] ' ] = $ webhookId ;
412- }
413- }
414- }
415- if (isset ($ params ->alias )) {
416- $ postFields ['alias ' ] = $ params ->alias ;
417- }
418383 $ url = $ this ->baseUrl . "/products/ {$ params ::$ slug }/enqueue " ;
419384 curl_setopt ($ ch , CURLOPT_URL , $ url );
420385 curl_setopt ($ ch , CURLOPT_POSTFIELDS , $ postFields );
0 commit comments