<!--
{
  "availability" : [
    "Xcode: 27.0.0 -",
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Evaluations",
  "identifier" : "/documentation/Evaluations/ModelSubject",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Evaluations"
    ],
    "preciseIdentifier" : "s:11Evaluations12ModelSubjectV"
  },
  "title" : "ModelSubject"
}
-->

# ModelSubject

The subject type for language model evaluations.

```
struct ModelSubject<Value> where Value : Decodable, Value : Encodable, Value : Sendable
```

## Overview

Carries the value the model produces and an optional structured transcript.
The transcript is required for tool-call evaluation.
[`ToolCallEvaluator`](/documentation/Evaluations/ToolCallEvaluator) performs a runtime check and throws [`EvaluationError.missingTranscript(evaluatorType:)`](/documentation/Evaluations/EvaluationError/missingTranscript(evaluatorType:))
if the transcript is `nil`.

```swift
let subject = ModelSubject(value: "Paris, France")
```

## Topics

### Creating a subject

[`init(value: Value, transcript: StructuredTranscript?)`](/documentation/Evaluations/ModelSubject/init(value:transcript:))

Creates a model subject with a value and optional transcript.

### Accessing the content

[`var value: Value`](/documentation/Evaluations/ModelSubject/value)

The typed value the model produces.

[`var transcript: StructuredTranscript?`](/documentation/Evaluations/ModelSubject/transcript)

The structured transcript from the model session.

### Inspecting tool calls

[`var toolCalls: [Transcript.ToolCall]`](/documentation/Evaluations/ModelSubject/toolCalls)

The tool calls from the transcript, or an empty array if no transcript was provided.

[`struct StructuredTranscript`](/documentation/Evaluations/StructuredTranscript)

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`EvaluationSubject`](/documentation/Evaluations/EvaluationSubject)

[`Sendable`](/documentation/Swift/Sendable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)