> ## Documentation Index
> Fetch the complete documentation index at: https://dev.writer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# AI Studio Agent

Runs a Writer AI Studio agent app by ID.

<img src="https://mintcdn.com/writer/dHnl9w_Om9ycQRLE/images/agent-builder/blueprints/ai-studio-agent-block.png?fit=max&auto=format&n=dHnl9w_Om9ycQRLE&q=85&s=e0eb9481a50bca31956d08f8141afa51" alt="" width="2310" height="1490" data-path="images/agent-builder/blueprints/ai-studio-agent-block.png" />

## Overview

The **AI Studio Agent** block runs a [deployed no-code AI Studio agent](/no-code/introduction). Only agents with [text generation](/no-code/text-generation) and [research](/no-code/research) capabilities are supported.

Under `App Id`, you can select the no-code agent you'd like to run from a pre-populated list of your deployed no-code agents.

<Warning>No-code agents with [chat capabilities](/no-code/chat) are not supported with this blueprint block. See the [Agent Builder chatbot tutorial](/agent-builder/chatbot-tutorial) for an example of how to create a chatbot with Agent Builder.</Warning>

## Inputs

The **AI Studio Agent** block takes key-value pairs in the `App inputs` field. The inputs should match the inputs of the no-code agent you're running. The key is the name of the input and the value is the value you'd like to pass to the agent.

If the no-code agent is a research assistant, it takes a single input with the key `query`. The value is the query you'd like the agent to run.

<img src="https://mintcdn.com/writer/KruNpIclsgQbhj82/images/agent-builder/blueprints/ai-studio-agent-research-agent-inputs.png?fit=max&auto=format&n=KruNpIclsgQbhj82&q=85&s=6b8d9215b349c3a00d6547daa88f54ae" alt="" width="1822" height="580" data-path="images/agent-builder/blueprints/ai-studio-agent-research-agent-inputs.png" />

### File and image inputs

If the input is a file or an image, you must upload the file to Writer first and then pass the ID to the agent. You can't pass the file or image directly to the agent.

See the [Upload, parse, and summarize PDFs](/agent-builder/summarize-pdfs#first-blueprint%3A-upload-file-to-writer-cloud) tutorial for more information on how to upload files to the Writer cloud.

If the no-code agent accepts URLs to a file or image as input, you can pass a URL to the agent as a value rather than uploading the file to the Writer cloud.

## Output

The **AI Studio Agent** block returns the output of the no-code agent as a string.

You can access the output of an **AI Studio Agent** block using the `@{result}` variable in the block that follows it in a blueprint.

## Example

The following example shows an **AI Studio Agent** block that runs a no-code AI Studio agent.

<img src="https://mintcdn.com/writer/dHnl9w_Om9ycQRLE/images/agent-builder/blueprints/ai-studio-agent-blueprint.png?fit=max&auto=format&n=dHnl9w_Om9ycQRLE&q=85&s=737a0097cca4a7981c9ebb1f09136dd7" alt="" width="2606" height="1084" data-path="images/agent-builder/blueprints/ai-studio-agent-blueprint.png" />

The no-code agent is an NDA review assistant that accepts a file input with the name `NDA` and runs a text generation workflow. It returns the analysis from the workflow in the `Output formatting` field.

<img src="https://mintcdn.com/writer/dHnl9w_Om9ycQRLE/images/agent-builder/blueprints/ai-studio-agent-example.png?fit=max&auto=format&n=dHnl9w_Om9ycQRLE&q=85&s=dc25a67c23e6d3d51b56c5578e60f8b4" alt="" width="3456" height="1804" data-path="images/agent-builder/blueprints/ai-studio-agent-example.png" />

In this example blueprint, the **AI Studio Agent** block provides a file ID for an uploaded file, which is stored in the agent's state as `nda_file_id`. The file must already be uploaded to the Writer cloud.

<img src="https://mintcdn.com/writer/KruNpIclsgQbhj82/images/agent-builder/blueprints/ai-studio-agent-file-input.png?fit=max&auto=format&n=KruNpIclsgQbhj82&q=85&s=124ad6e47668cd41f7c4ad5144bf7dfe" alt="" width="1946" height="740" data-path="images/agent-builder/blueprints/ai-studio-agent-file-input.png" />

The **AI Studio Agent** block returns the output of the no-code agent and proceeds to the next block, which stores the `@{result}` in a state variable.

## Errors

If the AI Studio Agent block fails with the error `Failed to acquire proper response for completion from data`, ensure that your no-code agent in AI Studio returns a value in the `Output formatting` field and that you are passing the correct inputs to the agent.

<img src="https://mintcdn.com/writer/KruNpIclsgQbhj82/images/agent-builder/blueprints/ai-studio-agent-output-formatting.png?fit=max&auto=format&n=KruNpIclsgQbhj82&q=85&s=ffdf336a049d782d6f40d23dec078934" alt="" width="812" height="398" data-path="images/agent-builder/blueprints/ai-studio-agent-output-formatting.png" />

## Fields

<table className="blueprintFields">
  <thead>
    <th>Name</th>
    <th>Type</th>
    <th>Control</th>
    <th>Default</th>
    <th>Description</th>
    <th>Options</th>
    <th>Validation</th>
  </thead>

  <tbody>
    <tr>
      <td>App Id</td>
      <td>App Id</td>
      <td>-</td>

      <td>
        <span>-</span>
      </td>

      <td>The agent id can be found in the agent's URL. It has a UUID format.</td>

      <td>
        <span>-</span>
      </td>

      <td>
        Format: uuid
      </td>
    </tr>

    <tr>
      <td>App inputs</td>
      <td>Key-Value</td>
      <td>-</td>

      <td>
        <code>
          {"{}"}
        </code>
      </td>

      <td>-</td>

      <td>
        <span>-</span>
      </td>

      <td>
        <span>-</span>
      </td>
    </tr>
  </tbody>
</table>

## End states

Below are the possible end states of the block call.

<table className="blueprintFields">
  <thead>
    <th>Name</th>
    <th>Field</th>
    <th>Type</th>
    <th>Description</th>
  </thead>

  <tbody>
    <tr>
      <td>Success</td>
      <td>-</td>
      <td>success</td>
      <td>The agent ran successfully.</td>
    </tr>

    <tr>
      <td>Error</td>
      <td>-</td>
      <td>error</td>
      <td>There was an error running the agent.</td>
    </tr>
  </tbody>
</table>

Access the output of an **AI Studio Agent** block using the `@{result}` variable in the block that follows it in a blueprint.
