@cloudflare/workers-types 4.20250407.0 → 4.20250408.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3818,6 +3818,282 @@ declare abstract class Base_Ai_Cf_Baai_Bge_Reranker_Base {
3818
3818
  inputs: Ai_Cf_Baai_Bge_Reranker_Base_Input;
3819
3819
  postProcessedOutputs: Ai_Cf_Baai_Bge_Reranker_Base_Output;
3820
3820
  }
3821
+ type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input =
3822
+ | Ai_Cf_Meta_Llama_4_Prompt
3823
+ | Ai_Cf_Meta_Llama_4_Messages;
3824
+ interface Ai_Cf_Meta_Llama_4_Prompt {
3825
+ /**
3826
+ * The input text prompt for the model to generate a response.
3827
+ */
3828
+ prompt: string;
3829
+ /**
3830
+ * JSON schema that should be fulfilled for the response.
3831
+ */
3832
+ guided_json?: object;
3833
+ /**
3834
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3835
+ */
3836
+ raw?: boolean;
3837
+ /**
3838
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3839
+ */
3840
+ stream?: boolean;
3841
+ /**
3842
+ * The maximum number of tokens to generate in the response.
3843
+ */
3844
+ max_tokens?: number;
3845
+ /**
3846
+ * Controls the randomness of the output; higher values produce more random results.
3847
+ */
3848
+ temperature?: number;
3849
+ /**
3850
+ * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
3851
+ */
3852
+ top_p?: number;
3853
+ /**
3854
+ * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
3855
+ */
3856
+ top_k?: number;
3857
+ /**
3858
+ * Random seed for reproducibility of the generation.
3859
+ */
3860
+ seed?: number;
3861
+ /**
3862
+ * Penalty for repeated tokens; higher values discourage repetition.
3863
+ */
3864
+ repetition_penalty?: number;
3865
+ /**
3866
+ * Decreases the likelihood of the model repeating the same lines verbatim.
3867
+ */
3868
+ frequency_penalty?: number;
3869
+ /**
3870
+ * Increases the likelihood of the model introducing new topics.
3871
+ */
3872
+ presence_penalty?: number;
3873
+ }
3874
+ interface Ai_Cf_Meta_Llama_4_Messages {
3875
+ /**
3876
+ * An array of message objects representing the conversation history.
3877
+ */
3878
+ messages: {
3879
+ /**
3880
+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
3881
+ */
3882
+ role?: string;
3883
+ /**
3884
+ * The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 000000001
3885
+ */
3886
+ tool_call_id?: string;
3887
+ content?:
3888
+ | string
3889
+ | {
3890
+ /**
3891
+ * Type of the content provided
3892
+ */
3893
+ type?: string;
3894
+ text?: string;
3895
+ image_url?: {
3896
+ /**
3897
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
3898
+ */
3899
+ url?: string;
3900
+ };
3901
+ }[]
3902
+ | {
3903
+ /**
3904
+ * Type of the content provided
3905
+ */
3906
+ type?: string;
3907
+ text?: string;
3908
+ image_url?: {
3909
+ /**
3910
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
3911
+ */
3912
+ url?: string;
3913
+ };
3914
+ };
3915
+ }[];
3916
+ functions?: {
3917
+ name: string;
3918
+ code: string;
3919
+ }[];
3920
+ /**
3921
+ * A list of tools available for the assistant to use.
3922
+ */
3923
+ tools?: (
3924
+ | {
3925
+ /**
3926
+ * The name of the tool. More descriptive the better.
3927
+ */
3928
+ name: string;
3929
+ /**
3930
+ * A brief description of what the tool does.
3931
+ */
3932
+ description: string;
3933
+ /**
3934
+ * Schema defining the parameters accepted by the tool.
3935
+ */
3936
+ parameters: {
3937
+ /**
3938
+ * The type of the parameters object (usually 'object').
3939
+ */
3940
+ type: string;
3941
+ /**
3942
+ * List of required parameter names.
3943
+ */
3944
+ required?: string[];
3945
+ /**
3946
+ * Definitions of each parameter.
3947
+ */
3948
+ properties: {
3949
+ [k: string]: {
3950
+ /**
3951
+ * The data type of the parameter.
3952
+ */
3953
+ type: string;
3954
+ /**
3955
+ * A description of the expected parameter.
3956
+ */
3957
+ description: string;
3958
+ };
3959
+ };
3960
+ };
3961
+ }
3962
+ | {
3963
+ /**
3964
+ * Specifies the type of tool (e.g., 'function').
3965
+ */
3966
+ type: string;
3967
+ /**
3968
+ * Details of the function tool.
3969
+ */
3970
+ function: {
3971
+ /**
3972
+ * The name of the function.
3973
+ */
3974
+ name: string;
3975
+ /**
3976
+ * A brief description of what the function does.
3977
+ */
3978
+ description: string;
3979
+ /**
3980
+ * Schema defining the parameters accepted by the function.
3981
+ */
3982
+ parameters: {
3983
+ /**
3984
+ * The type of the parameters object (usually 'object').
3985
+ */
3986
+ type: string;
3987
+ /**
3988
+ * List of required parameter names.
3989
+ */
3990
+ required?: string[];
3991
+ /**
3992
+ * Definitions of each parameter.
3993
+ */
3994
+ properties: {
3995
+ [k: string]: {
3996
+ /**
3997
+ * The data type of the parameter.
3998
+ */
3999
+ type: string;
4000
+ /**
4001
+ * A description of the expected parameter.
4002
+ */
4003
+ description: string;
4004
+ };
4005
+ };
4006
+ };
4007
+ };
4008
+ }
4009
+ )[];
4010
+ /**
4011
+ * JSON schema that should be fufilled for the response.
4012
+ */
4013
+ guided_json?: object;
4014
+ /**
4015
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4016
+ */
4017
+ raw?: boolean;
4018
+ /**
4019
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4020
+ */
4021
+ stream?: boolean;
4022
+ /**
4023
+ * The maximum number of tokens to generate in the response.
4024
+ */
4025
+ max_tokens?: number;
4026
+ /**
4027
+ * Controls the randomness of the output; higher values produce more random results.
4028
+ */
4029
+ temperature?: number;
4030
+ /**
4031
+ * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4032
+ */
4033
+ top_p?: number;
4034
+ /**
4035
+ * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4036
+ */
4037
+ top_k?: number;
4038
+ /**
4039
+ * Random seed for reproducibility of the generation.
4040
+ */
4041
+ seed?: number;
4042
+ /**
4043
+ * Penalty for repeated tokens; higher values discourage repetition.
4044
+ */
4045
+ repetition_penalty?: number;
4046
+ /**
4047
+ * Decreases the likelihood of the model repeating the same lines verbatim.
4048
+ */
4049
+ frequency_penalty?: number;
4050
+ /**
4051
+ * Increases the likelihood of the model introducing new topics.
4052
+ */
4053
+ presence_penalty?: number;
4054
+ }
4055
+ type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output =
4056
+ | {
4057
+ /**
4058
+ * The generated text response from the model
4059
+ */
4060
+ response: string;
4061
+ /**
4062
+ * Usage statistics for the inference request
4063
+ */
4064
+ usage?: {
4065
+ /**
4066
+ * Total number of tokens in input
4067
+ */
4068
+ prompt_tokens?: number;
4069
+ /**
4070
+ * Total number of tokens in output
4071
+ */
4072
+ completion_tokens?: number;
4073
+ /**
4074
+ * Total number of input and output tokens
4075
+ */
4076
+ total_tokens?: number;
4077
+ };
4078
+ /**
4079
+ * An array of tool calls requests made during the response generation
4080
+ */
4081
+ tool_calls?: {
4082
+ /**
4083
+ * The arguments passed to be passed to the tool call request
4084
+ */
4085
+ arguments?: object;
4086
+ /**
4087
+ * The name of the tool to be called
4088
+ */
4089
+ name?: string;
4090
+ }[];
4091
+ }
4092
+ | string;
4093
+ declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
4094
+ inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
4095
+ postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
4096
+ }
3821
4097
  interface AiModels {
3822
4098
  "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
3823
4099
  "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
@@ -3884,6 +4160,7 @@ interface AiModels {
3884
4160
  "@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
3885
4161
  "@cf/meta/llama-guard-3-8b": Base_Ai_Cf_Meta_Llama_Guard_3_8B;
3886
4162
  "@cf/baai/bge-reranker-base": Base_Ai_Cf_Baai_Bge_Reranker_Base;
4163
+ "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
3887
4164
  }
3888
4165
  type AiOptions = {
3889
4166
  gateway?: GatewayOptions;
@@ -3832,6 +3832,282 @@ export declare abstract class Base_Ai_Cf_Baai_Bge_Reranker_Base {
3832
3832
  inputs: Ai_Cf_Baai_Bge_Reranker_Base_Input;
3833
3833
  postProcessedOutputs: Ai_Cf_Baai_Bge_Reranker_Base_Output;
3834
3834
  }
3835
+ export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input =
3836
+ | Ai_Cf_Meta_Llama_4_Prompt
3837
+ | Ai_Cf_Meta_Llama_4_Messages;
3838
+ export interface Ai_Cf_Meta_Llama_4_Prompt {
3839
+ /**
3840
+ * The input text prompt for the model to generate a response.
3841
+ */
3842
+ prompt: string;
3843
+ /**
3844
+ * JSON schema that should be fulfilled for the response.
3845
+ */
3846
+ guided_json?: object;
3847
+ /**
3848
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
3849
+ */
3850
+ raw?: boolean;
3851
+ /**
3852
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
3853
+ */
3854
+ stream?: boolean;
3855
+ /**
3856
+ * The maximum number of tokens to generate in the response.
3857
+ */
3858
+ max_tokens?: number;
3859
+ /**
3860
+ * Controls the randomness of the output; higher values produce more random results.
3861
+ */
3862
+ temperature?: number;
3863
+ /**
3864
+ * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
3865
+ */
3866
+ top_p?: number;
3867
+ /**
3868
+ * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
3869
+ */
3870
+ top_k?: number;
3871
+ /**
3872
+ * Random seed for reproducibility of the generation.
3873
+ */
3874
+ seed?: number;
3875
+ /**
3876
+ * Penalty for repeated tokens; higher values discourage repetition.
3877
+ */
3878
+ repetition_penalty?: number;
3879
+ /**
3880
+ * Decreases the likelihood of the model repeating the same lines verbatim.
3881
+ */
3882
+ frequency_penalty?: number;
3883
+ /**
3884
+ * Increases the likelihood of the model introducing new topics.
3885
+ */
3886
+ presence_penalty?: number;
3887
+ }
3888
+ export interface Ai_Cf_Meta_Llama_4_Messages {
3889
+ /**
3890
+ * An array of message objects representing the conversation history.
3891
+ */
3892
+ messages: {
3893
+ /**
3894
+ * The role of the message sender (e.g., 'user', 'assistant', 'system', 'tool').
3895
+ */
3896
+ role?: string;
3897
+ /**
3898
+ * The tool call id. Must be supplied for tool calls for Mistral-3. If you don't know what to put here you can fall back to 000000001
3899
+ */
3900
+ tool_call_id?: string;
3901
+ content?:
3902
+ | string
3903
+ | {
3904
+ /**
3905
+ * Type of the content provided
3906
+ */
3907
+ type?: string;
3908
+ text?: string;
3909
+ image_url?: {
3910
+ /**
3911
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
3912
+ */
3913
+ url?: string;
3914
+ };
3915
+ }[]
3916
+ | {
3917
+ /**
3918
+ * Type of the content provided
3919
+ */
3920
+ type?: string;
3921
+ text?: string;
3922
+ image_url?: {
3923
+ /**
3924
+ * image uri with data (e.g. data:image/jpeg;base64,/9j/...). HTTP URL will not be accepted
3925
+ */
3926
+ url?: string;
3927
+ };
3928
+ };
3929
+ }[];
3930
+ functions?: {
3931
+ name: string;
3932
+ code: string;
3933
+ }[];
3934
+ /**
3935
+ * A list of tools available for the assistant to use.
3936
+ */
3937
+ tools?: (
3938
+ | {
3939
+ /**
3940
+ * The name of the tool. More descriptive the better.
3941
+ */
3942
+ name: string;
3943
+ /**
3944
+ * A brief description of what the tool does.
3945
+ */
3946
+ description: string;
3947
+ /**
3948
+ * Schema defining the parameters accepted by the tool.
3949
+ */
3950
+ parameters: {
3951
+ /**
3952
+ * The type of the parameters object (usually 'object').
3953
+ */
3954
+ type: string;
3955
+ /**
3956
+ * List of required parameter names.
3957
+ */
3958
+ required?: string[];
3959
+ /**
3960
+ * Definitions of each parameter.
3961
+ */
3962
+ properties: {
3963
+ [k: string]: {
3964
+ /**
3965
+ * The data type of the parameter.
3966
+ */
3967
+ type: string;
3968
+ /**
3969
+ * A description of the expected parameter.
3970
+ */
3971
+ description: string;
3972
+ };
3973
+ };
3974
+ };
3975
+ }
3976
+ | {
3977
+ /**
3978
+ * Specifies the type of tool (e.g., 'function').
3979
+ */
3980
+ type: string;
3981
+ /**
3982
+ * Details of the function tool.
3983
+ */
3984
+ function: {
3985
+ /**
3986
+ * The name of the function.
3987
+ */
3988
+ name: string;
3989
+ /**
3990
+ * A brief description of what the function does.
3991
+ */
3992
+ description: string;
3993
+ /**
3994
+ * Schema defining the parameters accepted by the function.
3995
+ */
3996
+ parameters: {
3997
+ /**
3998
+ * The type of the parameters object (usually 'object').
3999
+ */
4000
+ type: string;
4001
+ /**
4002
+ * List of required parameter names.
4003
+ */
4004
+ required?: string[];
4005
+ /**
4006
+ * Definitions of each parameter.
4007
+ */
4008
+ properties: {
4009
+ [k: string]: {
4010
+ /**
4011
+ * The data type of the parameter.
4012
+ */
4013
+ type: string;
4014
+ /**
4015
+ * A description of the expected parameter.
4016
+ */
4017
+ description: string;
4018
+ };
4019
+ };
4020
+ };
4021
+ };
4022
+ }
4023
+ )[];
4024
+ /**
4025
+ * JSON schema that should be fufilled for the response.
4026
+ */
4027
+ guided_json?: object;
4028
+ /**
4029
+ * If true, a chat template is not applied and you must adhere to the specific model's expected formatting.
4030
+ */
4031
+ raw?: boolean;
4032
+ /**
4033
+ * If true, the response will be streamed back incrementally using SSE, Server Sent Events.
4034
+ */
4035
+ stream?: boolean;
4036
+ /**
4037
+ * The maximum number of tokens to generate in the response.
4038
+ */
4039
+ max_tokens?: number;
4040
+ /**
4041
+ * Controls the randomness of the output; higher values produce more random results.
4042
+ */
4043
+ temperature?: number;
4044
+ /**
4045
+ * Adjusts the creativity of the AI's responses by controlling how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
4046
+ */
4047
+ top_p?: number;
4048
+ /**
4049
+ * Limits the AI to choose from the top 'k' most probable words. Lower values make responses more focused; higher values introduce more variety and potential surprises.
4050
+ */
4051
+ top_k?: number;
4052
+ /**
4053
+ * Random seed for reproducibility of the generation.
4054
+ */
4055
+ seed?: number;
4056
+ /**
4057
+ * Penalty for repeated tokens; higher values discourage repetition.
4058
+ */
4059
+ repetition_penalty?: number;
4060
+ /**
4061
+ * Decreases the likelihood of the model repeating the same lines verbatim.
4062
+ */
4063
+ frequency_penalty?: number;
4064
+ /**
4065
+ * Increases the likelihood of the model introducing new topics.
4066
+ */
4067
+ presence_penalty?: number;
4068
+ }
4069
+ export type Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output =
4070
+ | {
4071
+ /**
4072
+ * The generated text response from the model
4073
+ */
4074
+ response: string;
4075
+ /**
4076
+ * Usage statistics for the inference request
4077
+ */
4078
+ usage?: {
4079
+ /**
4080
+ * Total number of tokens in input
4081
+ */
4082
+ prompt_tokens?: number;
4083
+ /**
4084
+ * Total number of tokens in output
4085
+ */
4086
+ completion_tokens?: number;
4087
+ /**
4088
+ * Total number of input and output tokens
4089
+ */
4090
+ total_tokens?: number;
4091
+ };
4092
+ /**
4093
+ * An array of tool calls requests made during the response generation
4094
+ */
4095
+ tool_calls?: {
4096
+ /**
4097
+ * The arguments passed to be passed to the tool call request
4098
+ */
4099
+ arguments?: object;
4100
+ /**
4101
+ * The name of the tool to be called
4102
+ */
4103
+ name?: string;
4104
+ }[];
4105
+ }
4106
+ | string;
4107
+ export declare abstract class Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct {
4108
+ inputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Input;
4109
+ postProcessedOutputs: Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct_Output;
4110
+ }
3835
4111
  export interface AiModels {
3836
4112
  "@cf/huggingface/distilbert-sst-2-int8": BaseAiTextClassification;
3837
4113
  "@cf/stabilityai/stable-diffusion-xl-base-1.0": BaseAiTextToImage;
@@ -3898,6 +4174,7 @@ export interface AiModels {
3898
4174
  "@cf/meta/llama-3.2-11b-vision-instruct": Base_Ai_Cf_Meta_Llama_3_2_11B_Vision_Instruct;
3899
4175
  "@cf/meta/llama-guard-3-8b": Base_Ai_Cf_Meta_Llama_Guard_3_8B;
3900
4176
  "@cf/baai/bge-reranker-base": Base_Ai_Cf_Baai_Bge_Reranker_Base;
4177
+ "@cf/meta/llama-4-scout-17b-16e-instruct": Base_Ai_Cf_Meta_Llama_4_Scout_17B_16E_Instruct;
3901
4178
  }
3902
4179
  export type AiOptions = {
3903
4180
  gateway?: GatewayOptions;