deprecated-generative-ai-swift is a Swift client and example scaffold for building generative AI apps using the Gemini models. Although marked “deprecated”, the repo demonstrates how to integrate Gemini inference into iOS and macOS apps via Swift APIs, providing boilerplate for prompt dispatching, streaming responses, UI integration, and error handling. It includes a sample app that showcases a chat interface, where users send messages and receive responses streamed in real time, with UI updates as tokens arrive. The code also handles request queuing, cancellation, and retry logic, giving developers a realistic foundation rather than a minimalist “hello world.” Despite its deprecated label, the repo remains valuable for developers who want to see how a native Swift integration might be structured before migrating to newer SDKs. Maintainability is emphasized: modular layers separate networking, prompt handling, and UI logic, making adaptation easier when switching to updated APIs.
Features
- Swift client library and scaffolding for Gemini-based generative apps
- Example chat UI with streaming response token updates
- Handling for request cancellation, queuing, and retry policies
- Modular layering: network, prompt, UI separation
- Error and status propagation for user feedback and debugging
- Licensed code suitable for reuse even after deprecation