Tech Specs
Core Components
Data Models
struct Entry: Codable {
let id: UUID
let content: String
let timestamp: Date
let embeddings: [Float]
}
struct Cluster: Codable {
let id: UUID
let entries: [Entry]
let threshold: Float
let category: String?
}
Training Data Structure
A training data manager to handle our training data
A model trainer service
A way to save and load our trained model
NLP Processing
CoreML for text embeddings
Natural Language framework for tokenization
Local clustering using k-means algorithm
Threshold detection using cosine similarity
Storage Layer
protocol StorageProvider {
func saveEntry(_ entry: Entry) async throws
func fetchClusters() async throws -> [Cluster]
func updateCluster(_ cluster: Cluster) async throws
}
UNPARTY Wrapper
REST API endpoints for processing
JWT authentication
Webhook support for cluster updates
Response handling for inference requests
SwiftUI Views
struct EntryView: View {
@StateObject var viewModel: EntryViewModel
@State private var entries: [Entry] = []
@State private var clusters: [Cluster] = []
}
struct ClusterView: View {
let cluster: Cluster
@State private var isProcessing: Bool = false
}
Processing Flow
Entry Creation → Local NLP → Embedding Generation
Cluster Detection → Threshold Check → Storage Update
Wrapper Processing → Documentation Site API → Response Handling
UI Update → Visualization → State Management
API Integration
struct WrapperEndpoint {
static let base = "https://docs.unparty.app/api"
static let process = "/process"
static let inference = "/inference"
}
Demo Requirements
iOS 16.0+
CoreML 3.0+
Natural Language framework
Async/await support
Network connectivity
Last updated
Was this helpful?