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

# Deepline Agent: Ai Evaluate

> Ask an AI model typed questions about a record and get structured answers back, such as scores or yes/no checks. Includes SDK V2 examples, schemas, and cost.

Ask an AI model typed questions about a record and get structured answers back, such as scores or yes/no checks.

> [!NOTE]
>
> Tool ID: `ai_evaluate`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'ai_evaluate',
  {
    "state": "California",
    "questions": {}
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute ai_evaluate --input '{
  "state": "California",
  "questions": {}
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "status": "completed",
  "result": {
    "answers": {},
    "response": {
      "modelId": "model_123",
      "timestamp": "example"
    }
  },
  "usage": {
    "inputTokens": 123,
    "outputTokens": 123,
    "totalTokens": 123
  },
  "output": "example",
  "extracted_json": {}
}
```

Use `deepline describe ai_evaluate --json` for the latest machine-readable contract.

## Input reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.model` | `string` | No | `"typesafe-ai/jev"` | Case-sensitive provider-prefixed Vercel AI Gateway evaluation model id, for example "typesafe-ai/jev". Copy the exact id from [https://ai-gateway.vercel.sh/v1/models](https://ai-gateway.vercel.sh/v1/models). Pattern: `^[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*$`. |
| `payload.state` | `unknown` | Yes | — | — |
| `payload.questions` | `record` | Yes | — | Questions by id, for example \{"is\_fit": \{"type": "boolean", "instructions": "Is this company a fit?"}}. choice needs criteria as a map of choice to meaning. score needs criteria as an array of at least two levels. |
| `payload.providerOptions` | `record` | No | — | AI SDK providerOptions passthrough, namespaced by provider. |

<details>
  <summary>Show raw input schema</summary>

  ### Input JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "properties": {
      "model": {
        "type": "string",
        "description": "Case-sensitive provider-prefixed Vercel AI Gateway evaluation model id, for example \"typesafe-ai/jev\". Copy the exact id from https://ai-gateway.vercel.sh/v1/models.",
        "default": "typesafe-ai/jev",
        "pattern": "^[a-z0-9][a-z0-9._-]*/[a-z0-9][a-z0-9._-]*$",
        "feature": "ai_gateway_model"
      },
      "state": {},
      "questions": {
        "type": "object",
        "description": "Questions by id, for example {\"is_fit\": {\"type\": \"boolean\", \"instructions\": \"Is this company a fit?\"}}. choice needs criteria as a map of choice to meaning; score needs criteria as an array of at least two levels.",
        "additionalProperties": {
          "type": "object",
          "properties": {
            "type": {
              "type": "string",
              "enum": [
                "boolean",
                "choice",
                "score"
              ]
            },
            "instructions": {},
            "criteria": {}
          },
          "required": [
            "type",
            "instructions"
          ],
          "additionalProperties": false
        }
      },
      "providerOptions": {
        "type": "object",
        "description": "AI SDK providerOptions passthrough, namespaced by provider.",
        "additionalProperties": {}
      }
    },
    "required": [
      "state",
      "questions"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Output reference

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.status` | `"completed"` | Yes | — | — |
| `result.result` | `object` | Yes | — | — |
| `result.result.answers` | `record` | Yes | — | — |
| `result.result.rounding` | `record` | No | — | — |
| `result.result.response` | `object` | Yes | — | — |
| `result.result.response.modelId` | `string` | Yes | — | — |
| `result.result.response.timestamp` | `string` | Yes | — | — |
| `result.usage` | `object` | Yes | — | — |
| `result.usage.inputTokens` | `integer` | Yes | — | — |
| `result.usage.outputTokens` | `integer` | Yes | — | — |
| `result.usage.totalTokens` | `integer` | Yes | — | — |
| `result.meta` | `object` | No | — | — |
| `result.meta.model` | `string` | Yes | — | — |
| `result.output` | `string` | Yes | — | — |
| `result.extracted_json` | `record` | Yes | — | — |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "properties": {
      "status": {
        "type": "string",
        "const": "completed"
      },
      "result": {
        "type": "object",
        "properties": {
          "answers": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "additionalProperties": {}
            }
          },
          "rounding": {
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "response": {
            "type": "object",
            "properties": {
              "modelId": {
                "type": "string"
              },
              "timestamp": {
                "type": "string"
              }
            },
            "required": [
              "modelId",
              "timestamp"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "answers",
          "response"
        ],
        "additionalProperties": false
      },
      "usage": {
        "type": "object",
        "properties": {
          "inputTokens": {
            "type": "integer"
          },
          "outputTokens": {
            "type": "integer"
          },
          "totalTokens": {
            "type": "integer"
          }
        },
        "required": [
          "inputTokens",
          "outputTokens",
          "totalTokens"
        ],
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          }
        },
        "required": [
          "model"
        ],
        "additionalProperties": false
      },
      "output": {
        "type": "string"
      },
      "extracted_json": {
        "type": "object",
        "additionalProperties": {}
      }
    },
    "required": [
      "status",
      "result",
      "usage",
      "output",
      "extracted_json"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `provider_usage` (provider usage).
* Estimated Deepline credits: `0` per pricing unit.

## Related documentation

* [Deepline Agent provider guide](https://deepline.com/docs/providers/deeplineagent/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.