AI Assistant on iOS

Nutrient AI Assistant brings AI chat capabilities to your documents, enabling users to ask questions in natural language and get answers without sifting through pages of text. AI Assistant is ideal for summarizing, translating, and finding certain information in documents. Users can tap links in the chat to jump to the part of the document information came from.

To use this feature, run Nutrient AI Assistant on your server.

AI Assistant

Setting up AI Assistant on iOS

To get started, either implement AI Assistant in your own app by following the steps below, or check out AIAssistantExample in our Catalog app. In the case of the latter, you’ll only need to follow step 1, as it already implements steps 2 and 3.

  1. Set up Nutrient AI Assistant on your server, or run the server locally. The easiest way to get started is to clone our AI Assistant demo repository and follow the instructions in the README.

  2. Set an AIAssistantConfiguration in your main PDFConfiguration. This configuration specifies the URL where your AI Assistant server can be accessed, a JSON Web Token (JWT) for authentication, a session identifier, and an optional user identifier. It’s best practice for the JWT to be generated by your own server; for more details, refer to generate a JWT in our AI Assistant server guides. You may have one session for each document if you want to restore the chat history each time. You could have multiple sessions per document if multiple users access the same document in your app on one device.

  3. Add AIAssistantButton (SwiftUI) or aiAssistantButtonItem (UIKit) to your navigation bar or toolbar. When users tap this button, the document data will be uploaded to AI Assistant on your server, and the chat UI will be presented.