@@ -320,12 +320,64 @@ def run(
320
320
model_name : str ,
321
321
* ,
322
322
account_id : str ,
323
+ prompt : str ,
324
+ frequency_penalty : float | NotGiven = NOT_GIVEN ,
323
325
lora : str | NotGiven = NOT_GIVEN ,
324
326
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 ,
327
328
raw : bool | NotGiven = NOT_GIVEN ,
329
+ repetition_penalty : float | NotGiven = NOT_GIVEN ,
330
+ seed : int | NotGiven = NOT_GIVEN ,
328
331
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 ,
329
381
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
330
382
# The extra values given here take precedence over values defined on the client or passed to this method.
331
383
extra_headers : Headers | None = None ,
@@ -478,6 +530,7 @@ def run(
478
530
["account_id" , "audio" ],
479
531
["account_id" , "image" ],
480
532
["account_id" ],
533
+ ["account_id" , "messages" ],
481
534
["account_id" , "target_lang" , "text" ],
482
535
["account_id" , "input_text" ],
483
536
)
@@ -502,16 +555,22 @@ def run(
502
555
strength : float | NotGiven = NOT_GIVEN ,
503
556
width : int | NotGiven = NOT_GIVEN ,
504
557
audio : Iterable [float ] | NotGiven = NOT_GIVEN ,
558
+ frequency_penalty : float | NotGiven = NOT_GIVEN ,
505
559
lora : str | NotGiven = NOT_GIVEN ,
506
560
max_tokens : int | NotGiven = NOT_GIVEN ,
507
- messages : Iterable [ ai_run_params . TextGenerationMessage ] | NotGiven = NOT_GIVEN ,
561
+ presence_penalty : float | NotGiven = NOT_GIVEN ,
508
562
raw : bool | NotGiven = NOT_GIVEN ,
563
+ repetition_penalty : float | NotGiven = NOT_GIVEN ,
509
564
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 ,
510
570
target_lang : str | NotGiven = NOT_GIVEN ,
511
571
source_lang : str | NotGiven = NOT_GIVEN ,
512
572
input_text : str | NotGiven = NOT_GIVEN ,
513
573
max_length : int | NotGiven = NOT_GIVEN ,
514
- temperature : float | NotGiven = NOT_GIVEN ,
515
574
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
516
575
# The extra values given here take precedence over values defined on the client or passed to this method.
517
576
extra_headers : Headers | None = None ,
@@ -825,12 +884,64 @@ async def run(
825
884
model_name : str ,
826
885
* ,
827
886
account_id : str ,
887
+ prompt : str ,
888
+ frequency_penalty : float | NotGiven = NOT_GIVEN ,
828
889
lora : str | NotGiven = NOT_GIVEN ,
829
890
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 ,
832
892
raw : bool | NotGiven = NOT_GIVEN ,
893
+ repetition_penalty : float | NotGiven = NOT_GIVEN ,
894
+ seed : int | NotGiven = NOT_GIVEN ,
833
895
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 ,
834
945
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
835
946
# The extra values given here take precedence over values defined on the client or passed to this method.
836
947
extra_headers : Headers | None = None ,
@@ -983,6 +1094,7 @@ async def run(
983
1094
["account_id" , "audio" ],
984
1095
["account_id" , "image" ],
985
1096
["account_id" ],
1097
+ ["account_id" , "messages" ],
986
1098
["account_id" , "target_lang" , "text" ],
987
1099
["account_id" , "input_text" ],
988
1100
)
@@ -1007,16 +1119,22 @@ async def run(
1007
1119
strength : float | NotGiven = NOT_GIVEN ,
1008
1120
width : int | NotGiven = NOT_GIVEN ,
1009
1121
audio : Iterable [float ] | NotGiven = NOT_GIVEN ,
1122
+ frequency_penalty : float | NotGiven = NOT_GIVEN ,
1010
1123
lora : str | NotGiven = NOT_GIVEN ,
1011
1124
max_tokens : int | NotGiven = NOT_GIVEN ,
1012
- messages : Iterable [ ai_run_params . TextGenerationMessage ] | NotGiven = NOT_GIVEN ,
1125
+ presence_penalty : float | NotGiven = NOT_GIVEN ,
1013
1126
raw : bool | NotGiven = NOT_GIVEN ,
1127
+ repetition_penalty : float | NotGiven = NOT_GIVEN ,
1014
1128
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 ,
1015
1134
target_lang : str | NotGiven = NOT_GIVEN ,
1016
1135
source_lang : str | NotGiven = NOT_GIVEN ,
1017
1136
input_text : str | NotGiven = NOT_GIVEN ,
1018
1137
max_length : int | NotGiven = NOT_GIVEN ,
1019
- temperature : float | NotGiven = NOT_GIVEN ,
1020
1138
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
1021
1139
# The extra values given here take precedence over values defined on the client or passed to this method.
1022
1140
extra_headers : Headers | None = None ,
0 commit comments