Contents

ModelSample

A general-purpose language model evaluation sample.

Declaration

struct ModelSample<ExpectedValue> where ExpectedValue : Decodable, ExpectedValue : Encodable, ExpectedValue : Sendable

Mentioned in

Overview

Accepts string-based prompts and instructions. For multimodal prompts, create a custom ModelSampleProtocol conformance or use the init(input:expected:expectations:) initializer with a prebuilt ModelSampleInput.

let sample = ModelSample(prompt: "The capital of France is...", expected: "Paris.")

Topics

Creating a sample

Specifying the query

Specifying expected output

Specifying tool expectations

Configuring generation

Bundled input and output

Protocols

See Also

Datasets