---
title: "maximum(_:)"
framework: foundationmodels
role: symbol
role_heading: Type Method
path: "foundationmodels/generationguide/maximum(_:)"
---

# maximum(_:)

Enforces a maximum value.

## Declaration

```swift
static func maximum(_ value: Decimal) -> GenerationGuide<Decimal>
```

## Discussion

Discussion Use a maximum generation guide — whose bounds are inclusive — to ensure the model produces a value less than or equal to some maximum value. For example, you can specify that the highest level a character in your game can achieve is 99.9: @Generable struct GameCharacter {     @Guide(description: "A creative name appropriate for a fantasy RPG character")     var name: String

@Guide(description: "A level for the character", .maximum(99.9))     var level: Decimal }

## See Also

### Getting the maximum value

- [maximumCount(_:)](foundationmodels/generationguide/maximumcount(_:).md)
