Run a Workers AI model·续2
<details>
<summary>
ImageToText object {image, frequency_penalty, max_tokens, 8 more }
</summary>
image: array of number
An array of integers that represent the image data constrained to 8-bit unsigned integer values
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2011%20%3E%20(property)%20image">Link to this property</a>
frequency_penalty: optional number
Decreases the likelihood of the model repeating the same lines verbatim.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2011%20%3E%20(property)%20frequency_penalty">Link to this property</a>
max_tokens: optional number
The maximum number of tokens to generate in the response.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2011%20%3E%20(property)%20max_tokens">Link to this property</a>
presence_penalty: optional number
Increases the likelihood of the model introducing new topics.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2011%20%3E%20(property)%20presence_penalty">Link to this property</a>
prompt: optional string
The input text prompt for the model to generate a response.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2011%20%3E%20(property)%20prompt">Link to this property</a>
raw: optional boolean
If true, a chat template is not applied and you must adhere to the specific model’s expected formatting.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2011%20%3E%20(property)%20raw">Link to this property</a>
repetition_penalty: optional number
Penalty for repeated tokens; higher values discourage repetition.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2011%20%3E%20(property)%20repetition_penalty">Link to this property</a>
seed: optional number
Random seed for reproducibility of the generation.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2011%20%3E%20(property)%20seed">Link to this property</a>
temperature: optional number
Controls the randomness of the output; higher values produce more random results.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2011%20%3E%20(property)%20temperature">Link to this property</a>
top_k: optional number
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.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2011%20%3E%20(property)%20top_k">Link to this property</a>
top_p: optional number
Controls the creativity of the AI’s responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2011%20%3E%20(property)%20top_p">Link to this property</a>
</details>
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2011">Link to this property</a>
<details>
<summary>
object {image, prompt, frequency_penalty, 8 more }
</summary>
image: string
Image in base64 encoded format.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2012%20%3E%20(property)%20image">Link to this property</a>
prompt: string
The input text prompt for the model to generate a response.
minLength1
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2012%20%3E%20(property)%20prompt">Link to this property</a>
frequency_penalty: optional number
Decreases the likelihood of the model repeating the same lines verbatim.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2012%20%3E%20(property)%20frequency_penalty">Link to this property</a>
ignore_eos: optional boolean
Whether to ignore the EOS token and continue generating tokens after the EOS token is generated.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2012%20%3E%20(property)%20ignore_eos">Link to this property</a>
max_tokens: optional number
The maximum number of tokens to generate in the response.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2012%20%3E%20(property)%20max_tokens">Link to this property</a>
presence_penalty: optional number
Increases the likelihood of the model introducing new topics.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2012%20%3E%20(property)%20presence_penalty">Link to this property</a>
repetition_penalty: optional number
Penalty for repeated tokens; higher values discourage repetition.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2012%20%3E%20(property)%20repetition_penalty">Link to this property</a>
seed: optional number
Random seed for reproducibility of the generation.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2012%20%3E%20(property)%20seed">Link to this property</a>
temperature: optional number
Controls the randomness of the output; higher values produce more random results.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2012%20%3E%20(property)%20temperature">Link to this property</a>
top_k: optional number
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.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2012%20%3E%20(property)%20top_k">Link to this property</a>
top_p: optional number
Controls the creativity of the AI’s responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2012%20%3E%20(property)%20top_p">Link to this property</a>
</details>
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2012">Link to this property</a>
<details>
<summary>
ImageTextToText object {image, messages, frequency_penalty, 8 more }
</summary>
image: string
Image in base64 encoded format.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20image">Link to this property</a>
<details>
<summary>
messages: array of object {content, role }
An array of message objects representing the conversation history.
</summary>
<details>
<summary>
content: stringor array of object {type, image_url, text }
The content of the message as a string.
</summary>
One of the following:
string
The content of the message as a string.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20content%20%3E%20(variant)%200">Link to this property</a>
<details>
<summary>
array of object {type, image_url, text }
Array of content parts (text, image_url, etc.).
</summary>
type: string
Type of the content part (e.g. ‘text’, ‘image_url’).
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20content%20%3E%20(variant)%201%20%3E%20(items)%20%3E%20(property)%20type">Link to this property</a>
<details>
<summary>
image_url: optional object {url }
Image URL object (when type is ‘image_url’).
</summary>
url: string
Image URI with data (e.g. data:image/jpeg;base64,/9j/…).
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20content%20%3E%20(variant)%201%20%3E%20(items)%20%3E%20(property)%20image_url%20%3E%20(property)%20url">Link to this property</a>
</details>
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20content%20%3E%20(variant)%201%20%3E%20(items)%20%3E%20(property)%20image_url">Link to this property</a>
text: optional string
Text content (when type is ‘text’).
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20content%20%3E%20(variant)%201%20%3E%20(items)%20%3E%20(property)%20text">Link to this property</a>
</details>
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20content%20%3E%20(variant)%201">Link to this property</a>
</details>
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20content">Link to this property</a>
role: string
The role of the message sender (e.g., ‘user’, ‘assistant’, ‘system’, ‘tool’).
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20messages%20%3E%20(items)%20%3E%20(property)%20role">Link to this property</a>
</details>
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20messages">Link to this property</a>
frequency_penalty: optional number
Decreases the likelihood of the model repeating the same lines verbatim.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20frequency_penalty">Link to this property</a>
ignore_eos: optional boolean
Whether to ignore the EOS token and continue generating tokens after the EOS token is generated.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20ignore_eos">Link to this property</a>
max_tokens: optional number
The maximum number of tokens to generate in the response.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20max_tokens">Link to this property</a>
presence_penalty: optional number
Increases the likelihood of the model introducing new topics.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20presence_penalty">Link to this property</a>
repetition_penalty: optional number
Penalty for repeated tokens; higher values discourage repetition.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20repetition_penalty">Link to this property</a>
seed: optional number
Random seed for reproducibility of the generation.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20seed">Link to this property</a>
temperature: optional number
Controls the randomness of the output; higher values produce more random results.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20temperature">Link to this property</a>
top_k: optional number
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.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20top_k">Link to this property</a>
top_p: optional number
Controls the creativity of the AI’s responses by adjusting how many possible words it considers. Lower values make outputs more predictable; higher values allow for more varied and creative responses.
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013%20%3E%20(property)%20top_p">Link to this property</a>
</details>
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2013">Link to this property</a>
<details>
<summary>
MultimodalEmbeddings object {image, text }
</summary>
image: optional string
Image in base64 encoded format.
minLength1
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2014%20%3E%20(property)%20image">Link to this property</a>
text: optional array of string
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2014%20%3E%20(property)%20text">Link to this property</a>
</details>
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(params)%200%20%3E%20(param)%20body%20%3E%20(schema)%20%3E%20(variant)%2014">Link to this property</a>
</details>
ReturnsExpand Collapse
<details>
<summary>
result: optional array of object {label, score } or stringor object {audio } or 12 more
An array of classification results for the input text
</summary>
One of the following:
<details>
<summary>
TextClassification = array of object {label, score }
An array of classification results for the input text
</summary>
label: optional string
The classification label assigned to the text (e.g., ‘POSITIVE’ or ‘NEGATIVE’)
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(network%20schema)%20%3E%20(property)%20result%20%2B%20(resource)%20ai%20%3E%20(model)%20ai_run_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(items)%20%3E%20(property)%20label">Link to this property</a>
score: optional number
Confidence score indicating the likelihood that the text belongs to the specified label
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(network%20schema)%20%3E%20(property)%20result%20%2B%20(resource)%20ai%20%3E%20(model)%20ai_run_response%20%3E%20(schema)%20%3E%20(variant)%200%20%3E%20(items)%20%3E%20(property)%20score">Link to this property</a>
</details>
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(network%20schema)%20%3E%20(property)%20result%20%2B%20(resource)%20ai%20%3E%20(model)%20ai_run_response%20%3E%20(schema)%20%3E%20(variant)%200">Link to this property</a>
TextToImage = string
The generated image in PNG format
<a href="#(resource)%20ai%20%3E%20(method)%20run%20%3E%20(network%20schema)%20%3E%20(property)%20result%20%2B%20(resource)%20ai%20%3E%20(model)%20ai_run_response%20%3E%20(schema)%20%3E%20(variant)%201">Link to this property</a>
<details>
<summary>
Audio object {audio }
</summary>
audio: optional string
