Understanding the MVVM Architecture and Component Interactions
Explore the sophisticated architecture that powers OpenAssistant, built with SwiftUI following modern iOS development patterns and best practices.
The Model-View-ViewModel pattern provides clear separation of concerns, making the app maintainable, testable, and scalable.
Model: Assistant, Message, Thread, VectorStore structs
ViewModel: Business logic, API calls, state management
View: SwiftUI views, user interface, user interactions
Handles all OpenAI API interactions
The API service layer handles all external communication with the OpenAI API, built with a base service class and specialized extensions for different endpoints.
Foundation classes for all ViewModels
Base classes provide common functionality and establish patterns that all ViewModels follow, ensuring consistency across the application.
Complete assistant lifecycle management
Handles creation, configuration, updating, and deletion of OpenAI Assistants with support for advanced features like tool configuration and vector store association.
Interactive conversation interface
Delivers a complete chat experience with message history, thread management, and real-time assistant interactions.
Knowledge base and file handling
Manages vector stores for knowledge retrieval and handles file uploads with configurable chunking strategies for optimal performance.