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

# Create eval

> Create an eval source file in the project source or a preview branch to test an agent against a dataset and metrics; returns the eval source document.

`createEval(projectReference: String!, input: CreateEvalInput!): EvalSource!`

Requires project.evals.write.

## Arguments

| Argument | Type | Required |
| - | - | - |
| `projectReference` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | Yes |
| `input` | [`CreateEvalInput!`](https://veryfront.com/docs/cloud/graphql/types/createevalinput) | Yes |

## Input fields

### input

[`CreateEvalInput`](https://veryfront.com/docs/cloud/graphql/types/createevalinput)

| Field | Type | Required | Description |
| - | - | - | - |
| `name` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | Yes | The eval id is derived from the name. |
| `description` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | No | |
| `target` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | Yes | The identifier of the agent the eval runs against. |
| `dataset` | [`EvalDatasetInput!`](https://veryfront.com/docs/cloud/graphql/types/evaldatasetinput) | Yes | |
| `metrics` | [`[EvalMetricInput!]`](https://veryfront.com/docs/cloud/graphql/types/evalmetricinput) | No | Default none. |
| `repetitions` | [`Int`](https://veryfront.com/docs/cloud/graphql/types/int) | No | How often each example runs; default 1. |
| `tags` | [`[String!]`](https://veryfront.com/docs/cloud/graphql/types/string) | No | |
| `metadata` | [`JSONObject`](https://veryfront.com/docs/cloud/graphql/types/jsonobject) | No | |
| `sourceTargetKind` | [`WriteTargetKind`](https://veryfront.com/docs/cloud/graphql/types/writetargetkind) | No | The source to write; default project. |
| `targetBranchId` | [`ID`](https://veryfront.com/docs/cloud/graphql/types/id) | No | Required with the kind preview\_branch. |

## Response

Returns [`EvalSource!`](https://veryfront.com/docs/cloud/graphql/types/evalsource). Open the type for its fields and nested types.

| Field | Type | Description |
| - | - | - |
| `id` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | |
| `name` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | |
| `description` | [`String`](https://veryfront.com/docs/cloud/graphql/types/string) | |
| `targetKind` | [`EvalTargetKind!`](https://veryfront.com/docs/cloud/graphql/types/evaltargetkind) | |
| `target` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | |
| `sourcePath` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | |
| `exportName` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | |
| `source` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | The source text of the eval file. |

[All fields of `EvalSource`](https://veryfront.com/docs/cloud/graphql/types/evalsource).

Types marked with `!` cannot be null. Lists use `[Type]` notation. The [type index](https://veryfront.com/docs/cloud/graphql/schema.md) lists all published input and response types.

## Example

```graphql title="query.graphql" theme={null}
mutation CreateEval($projectReference: String!, $input: CreateEvalInput!) {
  createEval(projectReference: $projectReference, input: $input) {
    id
    name
    capabilities
    description
    dynamicFields
  }
}
```

```json title="variables.json" theme={null}
{
  "projectReference": "00000000-0000-4000-8000-000000000001",
  "input": {
    "name": "example",
    "target": "example",
    "dataset": {
      "kind": "inline",
      "editable": false,
      "dynamic": false
    }
  }
}
```

<details>
  <summary>Try this mutation</summary>

  Calls use `https://api.veryfront.com/graphql`. Replace sample values with resources you can access. See [Authentication](https://veryfront.com/docs/cloud/authentication.md) for credentials and permissions.

  Bearer token or API key

  Stored in this tab's session. Clear credential

  Mutation

  Variables (JSON)
</details>


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