Skip to content

AskAI provides an approachable, native experience for generating text with ChatGPT and images with DALL·E.

Notifications You must be signed in to change notification settings

bodhichristian/AskAI

Repository files navigation

AskAI

AskAI provides an approachable, native to iOS experience for interfacing with artificial intelligence. Using OpenAI's API, users may converse with ChatGPT or generate images with DALL·E. It's written with almost entirely SwiftUI, and uses MVVM architecture. App icons and imagery generated with Midjourney.

Getting Started

  • To receive responses from ChatGPT, you'll need an API key from OpenAI. Keys are available for free at https://openai.com/api/
  • Insert API key in AskAI/ViewModels/OpenAIViewModel.swift

HomeView AskAI Showcase 1 001

The app launches into HomeView, the center of three tabs. In this view, users are greeted, presented with links for inspiration, and can view relevant stats. Tapping the gear icon reveals a sheet presenting SettingsView. Here, users can change their display name and color, and access information related to OpenAI and developer credits.

DALLEView AskAI 2 0 Showcase 002 From the DALL·E tab, users can begin an image generation prompt, or view previously saved images. Tapping on the info icon in the toobar presents a sheet displaying more detailed inforamtion about DALL·E. Tapping on the Ask DALL·E Navigation Link pushes to DALLEPromptView. This environment, like ChatGPTPromptView, is conditionally managed so that the user is sandboxed to the intended implementation. User may not submit an empty request, nor are the save/delete buttons tappable prior to receiving a response or error from OpenAI. The submit button dismisses the iOS keyboard, and animates while waiting for a response. User may save the chat, with an alert notifying success. Upon save, the prompt view is cleared of the current request and response. User may clear the chat without saving, with an alert to make sure they meant to. From the Saved Images section, tapping on an image preview pushes to an instatiation of SavedChatView, presenting the user with the request and response in a messaging-style UI. In this view, users may save images, favorite/unmark, and delete chats. As an easter egg, the user may drag the image around the screen, and it will return to its original position upon release.

ChatGPTView AskAI Showcase 1 001 From the ChatGPT tab, users may begin a new chat with one of the four available chat engines: Davinci, Curie, Babbage, and Ada. If the user has saved chats, they will appear in a list of navigation links with a SavedChatView as its destination. Items in this list respond to swipe gestures from the leading and trailing edges, as well as a context menu that appears as a result of a press-and-hold gesture. User may tap the info button to reveal a sheet with chat engine overviews and credits.Each ChatView instantiates its own ChatViewModel so that request and response data are preserved when user navigates away from the view. Tapping on the info icon in the toobar presents a sheet displaying more detailed inforamtion about each engine.

Future Updates:

  • Migrate to Core Data for data persistence
  • Optional biometric authentication at sign-in

About

AskAI provides an approachable, native experience for generating text with ChatGPT and images with DALL·E.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages