DynamicInstructions
protocol · iOS 27.0+ · SDK 27.1
protocol DynamicInstructionsA type that represents dynamic instructions. Dynamic instructions provide a declarative approach to assembling instructions and tools that a ``LanguageModelSession`` uses. The framework evaluates them before every request to the model, so the body can contain conditional logic that's based on current app state. ```swift struct PresentationInstructions: DynamicInstructions { // The data source for conditional instructions. var isEditingImage = true var body: some DynamicInstructions { // The instructions and tools that remain the same across any use of this type. Instructions { "Help people improve their presentation." } ListPhotosTool() AddPhotoTool() // Depending on the state of the app, include additional instructions // that provide the model with more task-specific instructions and tools. if isEditingImage { ImageEditingInstructions() } } } ```
Members (0)
This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.
Skipped declarations
No declarations were skipped in this snapshot.