Trevor Whittingham 1/29/2026

Add Tool Calling To A Foundation Models Session

Read Original

This article explains how to add tool calling to Foundation Models sessions in Swift, allowing models to invoke Swift code and use results in responses. It covers creating a small data source (ArticleIndex actor), defining a tool with arguments and output, and integrating with SwiftUI. The focus is on keeping tools small, validating arguments, and using view models to manage sessions. Examples use Xcode 26.5 SDK and demonstrate a reading-list app where the model searches saved articles. The article emphasizes clean architecture and concurrent safety.

Add Tool Calling To A Foundation Models Session

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet