@@ -320,12 +320,64 @@ def run(
320320 model_name : str ,
321321 * ,
322322 account_id : str ,
323+ prompt : str ,
324+ frequency_penalty : float | NotGiven = NOT_GIVEN ,
323325 lora : str | NotGiven = NOT_GIVEN ,
324326 max_tokens : int | NotGiven = NOT_GIVEN ,
325- messages : Iterable [ai_run_params .TextGenerationMessage ] | NotGiven = NOT_GIVEN ,
326- prompt : str | NotGiven = NOT_GIVEN ,
327+ presence_penalty : float | NotGiven = NOT_GIVEN ,
327328 raw : bool | NotGiven = NOT_GIVEN ,
329+ repetition_penalty : float | NotGiven = NOT_GIVEN ,
330+ seed : int | NotGiven = NOT_GIVEN ,
328331 stream : bool | NotGiven = NOT_GIVEN ,
332+ temperature : float | NotGiven = NOT_GIVEN ,
333+ top_k : int | NotGiven = NOT_GIVEN ,
334+ top_p : float | NotGiven = NOT_GIVEN ,
335+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
336+ # The extra values given here take precedence over values defined on the client or passed to this method.
337+ extra_headers : Headers | None = None ,
338+ extra_query : Query | None = None ,
339+ extra_body : Body | None = None ,
340+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
341+ ) -> Optional [AIRunResponse ]:
342+ """
343+ This endpoint provides users with the capability to run specific AI models
344+ on-demand.
345+
346+ By submitting the required input data, users can receive real-time predictions
347+ or results generated by the chosen AI model. The endpoint supports various AI
348+ model types, ensuring flexibility and adaptability for diverse use cases.
349+
350+ Model specific inputs available in
351+ [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/).
352+
353+ Args:
354+ extra_headers: Send extra headers
355+
356+ extra_query: Add additional query parameters to the request
357+
358+ extra_body: Add additional JSON properties to the request
359+
360+ timeout: Override the client-level default timeout for this request, in seconds
361+ """
362+ ...
363+
364+ @overload
365+ def run (
366+ self ,
367+ model_name : str ,
368+ * ,
369+ account_id : str ,
370+ messages : Iterable [ai_run_params .Variant8Message ],
371+ frequency_penalty : float | NotGiven = NOT_GIVEN ,
372+ max_tokens : int | NotGiven = NOT_GIVEN ,
373+ presence_penalty : float | NotGiven = NOT_GIVEN ,
374+ repetition_penalty : float | NotGiven = NOT_GIVEN ,
375+ seed : int | NotGiven = NOT_GIVEN ,
376+ stream : bool | NotGiven = NOT_GIVEN ,
377+ temperature : float | NotGiven = NOT_GIVEN ,
378+ tools : Iterable [ai_run_params .Variant8Tool ] | NotGiven = NOT_GIVEN ,
379+ top_k : int | NotGiven = NOT_GIVEN ,
380+ top_p : float | NotGiven = NOT_GIVEN ,
329381 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
330382 # The extra values given here take precedence over values defined on the client or passed to this method.
331383 extra_headers : Headers | None = None ,
@@ -478,6 +530,7 @@ def run(
478530 ["account_id" , "audio" ],
479531 ["account_id" , "image" ],
480532 ["account_id" ],
533+ ["account_id" , "messages" ],
481534 ["account_id" , "target_lang" , "text" ],
482535 ["account_id" , "input_text" ],
483536 )
@@ -502,16 +555,22 @@ def run(
502555 strength : float | NotGiven = NOT_GIVEN ,
503556 width : int | NotGiven = NOT_GIVEN ,
504557 audio : Iterable [float ] | NotGiven = NOT_GIVEN ,
558+ frequency_penalty : float | NotGiven = NOT_GIVEN ,
505559 lora : str | NotGiven = NOT_GIVEN ,
506560 max_tokens : int | NotGiven = NOT_GIVEN ,
507- messages : Iterable [ ai_run_params . TextGenerationMessage ] | NotGiven = NOT_GIVEN ,
561+ presence_penalty : float | NotGiven = NOT_GIVEN ,
508562 raw : bool | NotGiven = NOT_GIVEN ,
563+ repetition_penalty : float | NotGiven = NOT_GIVEN ,
509564 stream : bool | NotGiven = NOT_GIVEN ,
565+ temperature : float | NotGiven = NOT_GIVEN ,
566+ top_k : int | NotGiven = NOT_GIVEN ,
567+ top_p : float | NotGiven = NOT_GIVEN ,
568+ messages : Iterable [ai_run_params .Variant8Message ] | NotGiven = NOT_GIVEN ,
569+ tools : Iterable [ai_run_params .Variant8Tool ] | NotGiven = NOT_GIVEN ,
510570 target_lang : str | NotGiven = NOT_GIVEN ,
511571 source_lang : str | NotGiven = NOT_GIVEN ,
512572 input_text : str | NotGiven = NOT_GIVEN ,
513573 max_length : int | NotGiven = NOT_GIVEN ,
514- temperature : float | NotGiven = NOT_GIVEN ,
515574 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
516575 # The extra values given here take precedence over values defined on the client or passed to this method.
517576 extra_headers : Headers | None = None ,
@@ -825,12 +884,64 @@ async def run(
825884 model_name : str ,
826885 * ,
827886 account_id : str ,
887+ prompt : str ,
888+ frequency_penalty : float | NotGiven = NOT_GIVEN ,
828889 lora : str | NotGiven = NOT_GIVEN ,
829890 max_tokens : int | NotGiven = NOT_GIVEN ,
830- messages : Iterable [ai_run_params .TextGenerationMessage ] | NotGiven = NOT_GIVEN ,
831- prompt : str | NotGiven = NOT_GIVEN ,
891+ presence_penalty : float | NotGiven = NOT_GIVEN ,
832892 raw : bool | NotGiven = NOT_GIVEN ,
893+ repetition_penalty : float | NotGiven = NOT_GIVEN ,
894+ seed : int | NotGiven = NOT_GIVEN ,
833895 stream : bool | NotGiven = NOT_GIVEN ,
896+ temperature : float | NotGiven = NOT_GIVEN ,
897+ top_k : int | NotGiven = NOT_GIVEN ,
898+ top_p : float | NotGiven = NOT_GIVEN ,
899+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
900+ # The extra values given here take precedence over values defined on the client or passed to this method.
901+ extra_headers : Headers | None = None ,
902+ extra_query : Query | None = None ,
903+ extra_body : Body | None = None ,
904+ timeout : float | httpx .Timeout | None | NotGiven = NOT_GIVEN ,
905+ ) -> Optional [AIRunResponse ]:
906+ """
907+ This endpoint provides users with the capability to run specific AI models
908+ on-demand.
909+
910+ By submitting the required input data, users can receive real-time predictions
911+ or results generated by the chosen AI model. The endpoint supports various AI
912+ model types, ensuring flexibility and adaptability for diverse use cases.
913+
914+ Model specific inputs available in
915+ [Cloudflare Docs](https://developers.cloudflare.com/workers-ai/models/).
916+
917+ Args:
918+ extra_headers: Send extra headers
919+
920+ extra_query: Add additional query parameters to the request
921+
922+ extra_body: Add additional JSON properties to the request
923+
924+ timeout: Override the client-level default timeout for this request, in seconds
925+ """
926+ ...
927+
928+ @overload
929+ async def run (
930+ self ,
931+ model_name : str ,
932+ * ,
933+ account_id : str ,
934+ messages : Iterable [ai_run_params .Variant8Message ],
935+ frequency_penalty : float | NotGiven = NOT_GIVEN ,
936+ max_tokens : int | NotGiven = NOT_GIVEN ,
937+ presence_penalty : float | NotGiven = NOT_GIVEN ,
938+ repetition_penalty : float | NotGiven = NOT_GIVEN ,
939+ seed : int | NotGiven = NOT_GIVEN ,
940+ stream : bool | NotGiven = NOT_GIVEN ,
941+ temperature : float | NotGiven = NOT_GIVEN ,
942+ tools : Iterable [ai_run_params .Variant8Tool ] | NotGiven = NOT_GIVEN ,
943+ top_k : int | NotGiven = NOT_GIVEN ,
944+ top_p : float | NotGiven = NOT_GIVEN ,
834945 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
835946 # The extra values given here take precedence over values defined on the client or passed to this method.
836947 extra_headers : Headers | None = None ,
@@ -983,6 +1094,7 @@ async def run(
9831094 ["account_id" , "audio" ],
9841095 ["account_id" , "image" ],
9851096 ["account_id" ],
1097+ ["account_id" , "messages" ],
9861098 ["account_id" , "target_lang" , "text" ],
9871099 ["account_id" , "input_text" ],
9881100 )
@@ -1007,16 +1119,22 @@ async def run(
10071119 strength : float | NotGiven = NOT_GIVEN ,
10081120 width : int | NotGiven = NOT_GIVEN ,
10091121 audio : Iterable [float ] | NotGiven = NOT_GIVEN ,
1122+ frequency_penalty : float | NotGiven = NOT_GIVEN ,
10101123 lora : str | NotGiven = NOT_GIVEN ,
10111124 max_tokens : int | NotGiven = NOT_GIVEN ,
1012- messages : Iterable [ ai_run_params . TextGenerationMessage ] | NotGiven = NOT_GIVEN ,
1125+ presence_penalty : float | NotGiven = NOT_GIVEN ,
10131126 raw : bool | NotGiven = NOT_GIVEN ,
1127+ repetition_penalty : float | NotGiven = NOT_GIVEN ,
10141128 stream : bool | NotGiven = NOT_GIVEN ,
1129+ temperature : float | NotGiven = NOT_GIVEN ,
1130+ top_k : int | NotGiven = NOT_GIVEN ,
1131+ top_p : float | NotGiven = NOT_GIVEN ,
1132+ messages : Iterable [ai_run_params .Variant8Message ] | NotGiven = NOT_GIVEN ,
1133+ tools : Iterable [ai_run_params .Variant8Tool ] | NotGiven = NOT_GIVEN ,
10151134 target_lang : str | NotGiven = NOT_GIVEN ,
10161135 source_lang : str | NotGiven = NOT_GIVEN ,
10171136 input_text : str | NotGiven = NOT_GIVEN ,
10181137 max_length : int | NotGiven = NOT_GIVEN ,
1019- temperature : float | NotGiven = NOT_GIVEN ,
10201138 # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
10211139 # The extra values given here take precedence over values defined on the client or passed to this method.
10221140 extra_headers : Headers | None = None ,
0 commit comments