Contents

ToolExpectation

A specification for an expected tool call, or a group of expectations that can be satisfied in any order.

Declaration

struct ToolExpectation

Mentioned in

Overview

Most commonly, a ToolExpectation identifies a single tool by name and optionally validates its arguments:

ToolExpectation("getWeather", arguments: [
    .exact(argumentName: "location", value: "Paris, France")
])

For ordered sequences where multiple tools must all be called at the same position but their relative order doesn’t matter, use anyOrder(_:):

ToolExpectation.anyOrder([
    ToolExpectation("fetchData"),
    ToolExpectation("fetchMetadata"),
])

Topics

Creating an expectation

Creating any-order groups

Accessing expectation details

Matching arguments

See Also

Creating a single-tool expectation