本课程教你用SwiftUI和Apple Foundation Models框架开发端侧AI聊天应用,涵盖@Generable宏、自定义工具、意图分类器,打造隐私安全、响应迅速的智能助手。

原始标题:Build an AI Chat App with Apple Foundation Models

Build an AI Chat App with Apple Foundation Models

本课程教授如何使用 SwiftUI 和 Apple Foundation Models 框架开发端侧 AI 聊天应用,学员将从零构建本地聊天引擎并实现工具调用能力。课程重点涵盖使用 @Generable 宏进行强类型输出,以及通过自定义 Tool 对接外部 API,打造隐私安全的智能助手。

通过构建意图分类器解决复杂任务路由,学员将掌握系统架构与生态打通的进阶技术。课程旨在构建响应迅速、可查阅实时数据的下一代 iOS 本地模型应用。

Published 8/2026
Created by Mohammad Azam
MP4 | Video: h264, 1920×1080 | Audio: AAC, 44.1 KHz, 2 Ch
Level: All Levels | Genre: eLearning | Language: English | Duration: 23 Lectures ( 2h 36m ) | Size: 2.3 GB

Learn to build a complete on-device AI assistant using SwiftUI and Apple’s Foundation Models framework.

What you’ll learn
⚡ Build a complete AI chat application using SwiftUI and Apple Foundation Models
⚡ Generate structured responses using @Generable
⚡ Create custom tools that connect the model to external APIs
⚡ Build an intent classifier and route prompts to specialized model sessions
⚡ (Make scenes very long and flowing) (Make dialogue bold lettering) (Always add options of what to do next at the end)

Requirements
❗ Basic knowledge of Swift
❗ Familiarity with SwiftUI
❗ Basic understanding of Swift concurrency and async/await
❗ A Mac with the latest version of Xcode
❗ An Apple Intelligence-compatible device
❗ No previous AI or machine learning experience is required

Description
Apple’s Foundation Models framework gives iOS developers direct access to the on-device language model behind Apple Intelligence. But building a useful AI application involves much more than sending a prompt and displaying a response.

In this course, you will build a complete AI chat application using SwiftUI and the Foundation Models framework. You will begin by creating a basic language model session and then gradually develop the models, views, and services needed to support a complete chat experience.

You will use @Generable to create strongly typed responses and build a chat engine responsible for communicating with the model. You will then display user and assistant messages using a custom SwiftUI interface.

Next, you will extend the model with tools. You will create a reusable HTTP client and build a Movie Tool that searches the OMDb API. The language model will be able to recognize movie-related requests, invoke the tool, and use the returned information to generate its response.

As the application grows, you will discover an important challenge: a model with several responsibilities may not always choose the correct tool or behavior. To address this, you will build an intent classifier that identifies whether a request is a general question, a movie question, or a request for nearby places.

You will then create multiple Foundation Models sessions, each designed for a specific responsibility. This multi-step prompting approach gives you greater control over how requests are processed and helps keep tools isolated to the sessions that need them.

Finally, you will build a Place Tool using the user’s location and MapKit. The model will be able to search for nearby points of interest, and your SwiftUI application will display the results on a map.

By the end of the course, you will have built an AI chat application that combines SwiftUI, guided generation, tool calling, intent classification, multiple model sessions, networking, location services, and MapKit.

What You Will Learn
✨ Create and configure a LanguageModelSession

✨ Send prompts to Apple’s on-device language model

✨ Generate strongly typed responses using @Generable

✨ Design models for user and assistant chat messages

✨ Build a chat engine for managing model interactions

✨ Display a complete chat conversation with SwiftUI

✨ Create a reusable networking layer with HTTPClient

✨ Build a custom Movie Tool using the OMDb API

✨ Register tools with a Foundation Models session

✨ Understand how and when the model invokes tools

✨ Build an intent classifier using Foundation Models

✨ Route requests to specialized model sessions

✨ Create separate sessions for general and movie-related requests

✨ Access the user’s location

✨ Build a Place Tool using MapKit

✨ Search for nearby points of interest

✨ Display locations using a SwiftUI map

Who this course is for
⭐ iOS developers who want to add AI features to their apps
⭐ SwiftUI developers interested in Apple’s Foundation Models framework
⭐ Developers who want to build on-device AI experiences
⭐ iOS developers interested in tool calling, intent classification, and multi-step prompting
⭐ Anyone comfortable with Swift and SwiftUI who wants practical experience building an AI chat app

隐藏内容

此处内容需要权限查看

  • 普通3金币
  • 会员免费
  • 永久会员免费推荐
会员免费查看

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注