Explain how I can leverage the new Foundation Models Framework to bolster app intents and shortcuts in my app

Asked on 06/13/2025

1 search

To leverage the new Foundation Models Framework to bolster app intents and shortcuts in your app, you can follow these steps:

  1. Foundation Models Framework Overview: The Foundation Models Framework provides access to an on-device large language model through a Swift API. This model is optimized for tasks like content generation, text summarization, and user input analysis, all while maintaining privacy since it runs on-device. You can use this framework to enhance existing app features or create new ones, such as generating itineraries in a travel app or creating dialogue for game characters. For more details, you can refer to the session Meet the Foundation Models framework.

  2. Integrating with App Intents: App Intents allow your app to integrate its features across the system, including Shortcuts and Spotlight. By exposing your app's content as entities and using actions like the new "UseModel" action, you can make your app's features more accessible and useful. This involves defining app intents and entities that describe your app's core functions, which can then be used in various system features like Siri, Spotlight, and Shortcuts. For more information, see the session Develop for Shortcuts and Spotlight with App Intents.

  3. Prompt Engineering and Tool Calling: When using the Foundation Models Framework, start with prompt engineering to perfect your prompts. You can use Xcode's Playground for this purpose. Additionally, the framework supports tool calling, which allows the model to autonomously choose and call functions to fetch additional information or perform actions, enhancing the model's capabilities. This is particularly useful for creating intelligent features that require external data or actions. For a practical demonstration, check out the session Code-along: Bring on-device AI to your app using the Foundation Models framework.

By combining the capabilities of the Foundation Models Framework with App Intents, you can create a more intelligent and integrated app experience that leverages Apple's on-device AI capabilities.