ModelSample
A general-purpose language model evaluation sample.
Declaration
struct ModelSample<ExpectedValue> where ExpectedValue : Decodable, ExpectedValue : Encodable, ExpectedValue : SendableMentioned 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
init(prompt:expected:instructions:generationSchema:expectations:)init(prompt:expected:instructions:generationSchema:expectations:)init(input:expected:expectations:)