[Yandex Cloud documentation](../../../../index.md) > [Yandex Serverless Integrations](../../../index.md) > [Step-by-step guides](../../index.md) > Workflows > [Workflow step constructor](index.md) > Integration steps > Models AI Studio

# Interacting with AI Studio models

{% list tabs %}

- Management console {#console}

  1. When [creating](../workflow/create-constructor.md) a new workflow or [editing](../workflow/update.md) an existing one, in the management console, under **Create workflow** / **Edit workflow**, select `Constructor`. 
  1. From the **AI Studio** section on the left side of the screen, drag the ![foundation-models-icon](../../../../_assets/foundation-models-icon.svg) **AI Studio models** element to relevant workflow location in the constructor window.

      You can drag and drop steps into areas marked by the dotted line in the workflow schema, such as **Add a step**, etc.
  1. In the workflow schema window, click the new **AI Studio models** section to select it.
  1. At the right of the window, on the **Settings** tab.
      1. In the **Step name** field, enter a name for the workflow step.      
      1. Select an [AI model](https://aistudio.yandex.ru/docs/en/ai-studio/concepts/generation/index):

          {% cut "`Text generation`" %}
        
          1. Select:

              * `Base model` to use the model from the drop-down list and, in the **Folder ID** field, select the [folder](../../../../resource-manager/concepts/resources-hierarchy.md#folder) the model will be invoked in.
              * `Fine-tuned model` to use a fine-tuned model, and specify the model's ID ([URI](https://aistudio.yandex.ru/docs/en/ai-studio/concepts/tuning/index#requests)) in the **Model URI** field.

          1. In the **Temperature** field, set the model's response variability: the higher the temperature value, the less predictable the result. The possible values range from `0` to `1`.
          1. In the **Number of tokens** field, limit the maximum allowed number of [tokens](https://aistudio.yandex.ru/docs/en/ai-studio/concepts/generation/tokens) in the model's response.
          1. Under **Context**, select:

              * `Messages` to set the context of your request to the model as a sequence of individual messages in `<Message_sender_role>`:`<Message_text>` format using the ![plus](../../../../_assets/console-icons/plus.svg) button.
              * `JSON string` to set the [context](https://aistudio.yandex.ru/docs/en/ai-studio/concepts/index#prompt) of your request to the model in [JSON](https://en.wikipedia.org/wiki/JSON) string format.

          1. Optionally, under **Reasoning mode**, select the [reasoning mode](https://aistudio.yandex.ru/docs/en/ai-studio/concepts/generation/chain-of-thought) status:
              * `Unspecified`: Not specified.
              * `Disabled`: Reasoning mode is disabled. 
              * `Enabled`: Reasoning mode is enabled.
          1. Optionally, under **Structured output**, select [response format](https://aistudio.yandex.ru/docs/en/ai-studio/concepts/generation/structured-output):

              * `None`: The model returns a response formatted with Markdown.
              * `JSON object`: The model returns a response as a JSON object.
              * `JSON schema`: The model returns a response as a JSON schema set in the **JSON schema** field.

          {% endcut %}

          {% cut "`Working with images`" %}

          1. Select the model from the drop-down list and, in the **Folder ID** field, select the [folder](../../../../resource-manager/concepts/resources-hierarchy.md#folder) the model will be invoked in.
          1. In the **Temperature** field, set the model's response variability: the higher the temperature value, the less predictable the result. The possible values range from `0` to `1`.
          1. In the **Number of tokens** field, limit the maximum allowed number of [tokens](https://aistudio.yandex.ru/docs/en/ai-studio/concepts/generation/tokens) in the model's response.
          1. Under **Context**, select:

              * `Messages` to set the context of your request to the model as a sequence of individual messages in `<Message_sender_role>`:`<Message_text>` format using the ![plus](../../../../_assets/console-icons/plus.svg) **Add message** button.

                  You can add an image to your message by clicking ![plus](../../../../_assets/console-icons/plus.svg) **Add image** and selecting:
                  * `Base64` to add an image in [Base64](https://en.wikipedia.org/wiki/Base64) format.
                  * `Image source` to specify the public URL to access the image or the image object name in the Object Storage [bucket](../../../../storage/concepts/bucket.md), e.g., `prefix/subprefix/image.png`.

              * `JSON string` to set the [context](https://aistudio.yandex.ru/docs/en/ai-studio/concepts/index#prompt) of your request to the model in [JSON](https://en.wikipedia.org/wiki/JSON) string format.

          {% endcut %}

          {% cut "`Fine-tuned classification`" %}

          1. In the **Model URI** field, enter a fine-tuned model's ID. For more information, see [Classifier models based on YandexGPT](https://aistudio.yandex.ru/docs/en/ai-studio/concepts/classifier/models).
          1. In the **Text** field, enter the message text.

          {% endcut %}

          {% cut "`Classifcation by prompt`" %}

          1. Select the model and the [folder](../../../../resource-manager/concepts/resources-hierarchy.md#folder) it will be invoked in.
          1. In the **Task** field, enter the text description of the task for the classifier.
          1. In the **Text** field, enter the message text.
          1. Under **Labels**, select:
              * `List` to enter classes, click ![plus](../../../../_assets/console-icons/plus.svg).
              * `JSON` and enter classes in [JSON](https://en.wikipedia.org/wiki/JSON) format under **JSON object**.

          1. Optionally, under **Sample queries**, select: 
              * `List` to enter request examples using ![plus](../../../../_assets/console-icons/plus.svg).
              * `JSON` and enter request examples in JSON format under **JSON object**.
        
          {% endcut %}

      1. Optionally, disable request logging. For more information, see [this AI Studio guide](https://aistudio.yandex.ru/docs/en/ai-studio/operations/disable-logging).
      1. Optionally, in the **Timeout, ms** field, set the maximum execution time for the current step.
      1. Optionally, to set a custom retry policy for a step, expand the **Retry policy** section and click ![plus](../../../../_assets/console-icons/plus.svg) **Retry policy**. In the form that appears:
         
         1. Optionally, in the **Initial delay, ms** field, set the initial value for a delay between step retries.
         1. Optionally, in the **Backoff rate** field, set the multiplication factor for delay before each step retry.
         1. Optionally, in the **Maximum delay, ms** field, set the value for a maximum delay between step retries.
         1. In the **Errors** field, select the errors for which the step will or will not be retried.
         
             For detailed information about possible errors, see [this section](../../../concepts/workflows/execution.md#errors).
         1. Optionally, in the **Maximum number of retries** field, set the maximum number of step retry attempts.
         1. In the **Error selection mode** field, select:
         
             * `INCLUDE`: Retry executing a step when errors specified in the **Errors** field occur.
             * `EXCLUDE`: To retry executing the step on any errors other than those specified in the **Errors** field.
         
         If you want to delete a retry policy you created for the step earlier, click ![ellipsis](../../../../_assets/console-icons/ellipsis.svg) and select **Delete** in the **Retry policy** row.
         
         If no custom retry policy is configured for a step, the retry policy [set for the whole workflow](setup-restart-policy.md) will apply.
  1. Optionally, navigate to the **Input** tab and set a [jq template](../../../concepts/workflows/templating.md) to filter the [workflow state](../../../concepts/workflows/workflow.md#state) fed into the step.
  1. Optionally, navigate to the **Output** tab and set a [jq template](../../../concepts/workflows/templating.md) to filter the step outputs added into the [workflow state](../../../concepts/workflows/workflow.md#state).
  1. Optionally, [add](setup-catch-rule.md) an [error transition rule](../../../concepts/workflows/yawl/index.md#catchrule) for the step you are creating to handle errors you may get during this step.

{% endlist %}

## Useful links {#see-also}

* [YaWL specification](../../../concepts/workflows/yawl/integration/foundationmodelscall.md)
* [Creating a workflow using the constructor](../workflow/create-constructor.md)
* [Updating a workflow](../workflow/update.md)