Full Code of lzell/AIProxyBootstrap for AI

main 1126c9e54d7c cached
244 files
588.8 KB
172.0k tokens
1 requests
Download .txt
Showing preview only (662K chars total). Download the full file or copy to clipboard to get everything.
Repository: lzell/AIProxyBootstrap
Branch: main
Commit: 1126c9e54d7c
Files: 244
Total size: 588.8 KB

Directory structure:
gitextract_weqk_mf7/

├── .gitignore
├── AIProxyAnthropic/
│   ├── AIProxyAnthropic/
│   │   ├── AIProxyAnthropicApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   ├── anthropic.imageset/
│   │   │   │   └── Contents.json
│   │   │   └── climber.imageset/
│   │   │       └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── MessageRequestView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   ├── ToolsView.swift
│   │   └── VisionView.swift
│   └── AIProxyAnthropic.xcodeproj/
│       └── project.pbxproj
├── AIProxyDeepL/
│   ├── AIProxyDeepL/
│   │   ├── AIProxyDeepLApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── deepl.imageset/
│   │   │       └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   └── TranslationView.swift
│   └── AIProxyDeepL.xcodeproj/
│       └── project.pbxproj
├── AIProxyFal/
│   ├── AIProxyFal/
│   │   ├── AIProxyFalApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── fal.imageset/
│   │   │       └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   └── TextToImageView.swift
│   └── AIProxyFal.xcodeproj/
│       └── project.pbxproj
├── AIProxyGemini/
│   ├── AIProxyGemini/
│   │   ├── AIProxyGeminiApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── icon.imageset/
│   │   │       └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   └── TextGenerationView.swift
│   └── AIProxyGemini.xcodeproj/
│       └── project.pbxproj
├── AIProxyGroq/
│   ├── AIProxyGroq/
│   │   ├── AIProxyGroqApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── groq.imageset/
│   │   │       └── Contents.json
│   │   ├── ChatView.swift
│   │   ├── ContentView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   └── StreamingChatView.swift
│   └── AIProxyGroq.xcodeproj/
│       └── project.pbxproj
├── AIProxyOpenAI/
│   ├── AIProxyOpenAI/
│   │   ├── AIProxyOpenAIApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   ├── openai.imageset/
│   │   │   │   └── Contents.json
│   │   │   └── surfer.imageset/
│   │   │       └── Contents.json
│   │   ├── ChatView.swift
│   │   ├── ContentView.swift
│   │   ├── DalleView.swift
│   │   ├── MultiModalChatView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   ├── StreamingChatView.swift
│   │   └── TextToSpeechView.swift
│   └── AIProxyOpenAI.xcodeproj/
│       └── project.pbxproj
├── AIProxyReplicate/
│   ├── AIProxyReplicate/
│   │   ├── AIProxyReplicateApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── replicate.imageset/
│   │   │       └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── ImageGenView.swift
│   │   └── Preview Content/
│   │       └── Preview Assets.xcassets/
│   │           └── Contents.json
│   └── AIProxyReplicate.xcodeproj/
│       └── project.pbxproj
├── AIProxyStabilityAI/
│   ├── AIProxyStabilityAI/
│   │   ├── AIProxyStabilityAIApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── stability.imageset/
│   │   │       └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── ImageGenView.swift
│   │   └── Preview Content/
│   │       └── Preview Assets.xcassets/
│   │           └── Contents.json
│   └── AIProxyStabilityAI.xcodeproj/
│       └── project.pbxproj
├── AIProxyTogetherAI/
│   ├── AIProxyTogetherAI/
│   │   ├── AIProxyTogetherAIApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── togetherai.imageset/
│   │   │       └── Contents.json
│   │   ├── ChatView.swift
│   │   ├── ContentView.swift
│   │   ├── JSONResponseView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   └── StreamingChatView.swift
│   └── AIProxyTogetherAI.xcodeproj/
│       └── project.pbxproj
├── Demos/
│   ├── AIColorPalette/
│   │   ├── AIColorPalette/
│   │   │   ├── AIColorPaletteApp.swift
│   │   │   ├── AIProxyIntegration.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── Contents.json
│   │   │   │   └── palm.imageset/
│   │   │   │       └── Contents.json
│   │   │   ├── ColorData.swift
│   │   │   ├── ColorDetailView.swift
│   │   │   ├── ContentView.swift
│   │   │   ├── Preview Content/
│   │   │   │   └── Preview Assets.xcassets/
│   │   │   │       └── Contents.json
│   │   │   ├── Ripple.metal
│   │   │   └── Ripple.swift
│   │   ├── AIColorPalette.xcodeproj/
│   │   │   └── project.pbxproj
│   │   └── README.md
│   ├── Chat/
│   │   ├── Chat/
│   │   │   ├── AppConstants.swift
│   │   │   ├── AppLogger.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── ChatApp.swift
│   │   │   ├── ChatBubble.swift
│   │   │   ├── ChatDataLoader.swift
│   │   │   ├── ChatInputView.swift
│   │   │   ├── ChatManager.swift
│   │   │   ├── ChatMessage.swift
│   │   │   ├── ChatView.swift
│   │   │   └── Preview Content/
│   │   │       └── Preview Assets.xcassets/
│   │   │           └── Contents.json
│   │   └── Chat.xcodeproj/
│   │       └── project.pbxproj
│   ├── Classifier/
│   │   ├── Classifier/
│   │   │   ├── AppConstants.swift
│   │   │   ├── AppLogger.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── CameraControlsView.swift
│   │   │   ├── CameraDataLoader.swift
│   │   │   ├── CameraFrameManager.swift
│   │   │   ├── CameraView.swift
│   │   │   ├── ClassifierApp.swift
│   │   │   ├── ClassifierDataLoader.swift
│   │   │   ├── ClassifierManager.swift
│   │   │   ├── ClassifierView.swift
│   │   │   └── Preview Content/
│   │   │       └── Preview Assets.xcassets/
│   │   │           └── Contents.json
│   │   └── Classifier.xcodeproj/
│   │       └── project.pbxproj
│   ├── EmojiPuzzleMaker/
│   │   ├── EmojiPuzzleMaker/
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── ContentView.swift
│   │   │   ├── EmojiPuzzleMakerApp.swift
│   │   │   └── Preview Content/
│   │   │       └── Preview Assets.xcassets/
│   │   │           └── Contents.json
│   │   └── EmojiPuzzleMaker.xcodeproj/
│   │       └── project.pbxproj
│   ├── FilmFinder/
│   │   ├── FilmFinder/
│   │   │   ├── AppConstants.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── ContentView.swift
│   │   │   ├── FilmFinderApp.swift
│   │   │   ├── GenreSelectorView.swift
│   │   │   ├── GetStartedTip.swift
│   │   │   ├── Info.plist
│   │   │   ├── Movie.swift
│   │   │   ├── MovieDetailsView.swift
│   │   │   ├── Preview Content/
│   │   │   │   └── Preview Assets.xcassets/
│   │   │   │       └── Contents.json
│   │   │   ├── Ripple.metal
│   │   │   └── Ripple.swift
│   │   └── FilmFinder.xcodeproj/
│   │       └── project.pbxproj
│   ├── PuLIDDemo/
│   │   ├── PuLIDDemo/
│   │   │   ├── AppConstants.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── Contents.json
│   │   │   │   └── pulid.imageset/
│   │   │   │       └── Contents.json
│   │   │   ├── ContentView.swift
│   │   │   ├── Info.plist
│   │   │   ├── Preview Content/
│   │   │   │   └── Preview Assets.xcassets/
│   │   │   │       └── Contents.json
│   │   │   ├── PuLIDDemoApp.swift
│   │   │   ├── Ripple.metal
│   │   │   └── Ripple.swift
│   │   └── PuLIDDemo.xcodeproj/
│   │       └── project.pbxproj
│   ├── Stickers/
│   │   ├── Stickers/
│   │   │   ├── AppConstants.swift
│   │   │   ├── AppLogger.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── ButtonStyles.swift
│   │   │   ├── Preview Content/
│   │   │   │   └── Preview Assets.xcassets/
│   │   │   │       └── Contents.json
│   │   │   ├── StickerDataLoader.swift
│   │   │   ├── StickerImageView.swift
│   │   │   ├── StickerInputView.swift
│   │   │   ├── StickerLoadingView.swift
│   │   │   ├── StickerManager.swift
│   │   │   ├── StickerView.swift
│   │   │   └── StickersApp.swift
│   │   └── Stickers.xcodeproj/
│   │       └── project.pbxproj
│   ├── Transcriber/
│   │   ├── Transcriber/
│   │   │   ├── AppConstants.swift
│   │   │   ├── AppLogger.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── AudioFileWriter.swift
│   │   │   ├── AudioRecorder.swift
│   │   │   ├── AudioRecording.swift
│   │   │   ├── ButtonStyles.swift
│   │   │   ├── FileUtils.swift
│   │   │   ├── MicrophoneSampleVendor.swift
│   │   │   ├── ModelContext+Extensions.swift
│   │   │   ├── NoRecordingsView.swift
│   │   │   ├── Preview Content/
│   │   │   │   └── Preview Assets.xcassets/
│   │   │   │       └── Contents.json
│   │   │   ├── RecordingRowView.swift
│   │   │   ├── TranscribedAudioRecording.swift
│   │   │   ├── TranscriberApp.swift
│   │   │   ├── TranscriberDataLoader.swift
│   │   │   ├── TranscriberManager.swift
│   │   │   └── TranscriberView.swift
│   │   └── Transcriber.xcodeproj/
│   │       └── project.pbxproj
│   ├── Translator/
│   │   ├── Translator/
│   │   │   ├── AppConstants.swift
│   │   │   ├── AppLogger.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── BottomTranslateView.swift
│   │   │   ├── ButtonStyles.swift
│   │   │   ├── Preview Content/
│   │   │   │   └── Preview Assets.xcassets/
│   │   │   │       └── Contents.json
│   │   │   ├── TopTranslateView.swift
│   │   │   ├── TranslateView.swift
│   │   │   ├── TranslationDataLoader.swift
│   │   │   └── TranslatorApp.swift
│   │   └── Translator.xcodeproj/
│   │       └── project.pbxproj
│   └── Trivia/
│       ├── Trivia/
│       │   ├── AppConstants.swift
│       │   ├── AppLogger.swift
│       │   ├── Assets.xcassets/
│       │   │   ├── AccentColor.colorset/
│       │   │   │   └── Contents.json
│       │   │   ├── AppIcon.appiconset/
│       │   │   │   └── Contents.json
│       │   │   └── Contents.json
│       │   ├── Preview Content/
│       │   │   └── Preview Assets.xcassets/
│       │   │       └── Contents.json
│       │   ├── TriviaAnswerPicker.swift
│       │   ├── TriviaApp.swift
│       │   ├── TriviaCardData.swift
│       │   ├── TriviaCardView.swift
│       │   ├── TriviaDataLoader.swift
│       │   ├── TriviaFormView.swift
│       │   ├── TriviaManager.swift
│       │   └── TriviaView.swift
│       └── Trivia.xcodeproj/
│           └── project.pbxproj
└── README.md

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
.DS_Store
*.swp
tags
xcshareddata
project.xcworkspace
.ackrc
*.codekit3

# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/


================================================
FILE: AIProxyAnthropic/AIProxyAnthropic/AIProxyAnthropicApp.swift
================================================
//
//  AIProxyAnthropicApp.swift
//  AIProxyAnthropic
//
//  Created by Todd Hamilton on 6/17/24.
//

import SwiftUI

@main
struct AIProxyAnthropicApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}


================================================
FILE: AIProxyAnthropic/AIProxyAnthropic/AppConstants.swift
================================================
//
//  AppConstants.swift
//  AIProxyAnthropic
//
//  Created by Todd Hamilton on 8/14/24.
//

import AIProxy

#error(
    """
    Uncomment one of the methods below. To build and run on device you must follow the AIProxy integration guide.
    Please see https://www.aiproxy.pro/docs/integration-guide.html")
    """
)

/* Uncomment for BYOK use cases */
let anthropicService = AIProxy.anthropicDirectService(
    unprotectedAPIKey: "your-anthropic-key"
)

/* Uncomment for all other production use cases */
//let anthropicService = AIProxy.anthropicService(
//    partialKey: "partial-key-from-your-developer-dashboard",
//    serviceURL: "service-url-from-your-developer-dashboard"
//)


================================================
FILE: AIProxyAnthropic/AIProxyAnthropic/Assets.xcassets/AccentColor.colorset/Contents.json
================================================
{
  "colors" : [
    {
      "idiom" : "universal"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyAnthropic/AIProxyAnthropic/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
  "images" : [
    {
      "idiom" : "universal",
      "platform" : "ios",
      "size" : "1024x1024"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyAnthropic/AIProxyAnthropic/Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyAnthropic/AIProxyAnthropic/Assets.xcassets/anthropic.imageset/Contents.json
================================================
{
  "images" : [
    {
      "filename" : "anthropic.jpeg",
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyAnthropic/AIProxyAnthropic/Assets.xcassets/climber.imageset/Contents.json
================================================
{
  "images" : [
    {
      "filename" : "climber.jpg",
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyAnthropic/AIProxyAnthropic/ContentView.swift
================================================
//
//  ContentView.swift
//  AIProxyAnthropic
//
//  Created by Todd Hamilton on 6/17/24.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack{
            
            VStack(spacing:24){
                VStack{
                    Image("anthropic")
                        .resizable()
                        .scaledToFit()
                        .frame(width: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/)
                        .cornerRadius(14)
                        .foregroundColor(.primary)
                    Text("Anthropic")
                        .bold()
                        .font(.largeTitle)
                    Text("AIProxy Sample")
                        .font(.subheadline)
                        .foregroundColor(.secondary)
                }
                .frame(maxWidth:.infinity,alignment:.center)
                
                VStack{
                    NavigationLink("Message Request Example",destination: MessageRequestView())
                        .bold()
                        .controlSize(.large)
                        .tint(.brown)
                        .buttonStyle(.bordered)
                    NavigationLink("Vision Example",destination: VisionView())
                        .bold()
                        .controlSize(.large)
                        .tint(.brown)
                        .buttonStyle(.bordered)
                    NavigationLink("Tools Example",destination: ToolsView())
                        .bold()
                        .controlSize(.large)
                        .tint(.brown)
                        .buttonStyle(.bordered)
                }
            }
        }
    }
}

#Preview {
    ContentView()
}


================================================
FILE: AIProxyAnthropic/AIProxyAnthropic/MessageRequestView.swift
================================================
//
//  MessageRequestView.swift
//  AIProxyAnthropic
//
//  Created by Todd Hamilton on 8/14/24.
//

import SwiftUI
import AIProxy

struct MessageRequestView: View {
    
    @State private var prompt = ""
    @State private var result = ""
    @State private var isLoading = false
    @State private var showingAlert = false
    
    func generate() async throws {
        isLoading = true
        defer { isLoading = false }
        do {
            let response = try await anthropicService.messageRequest(body: AnthropicMessageRequestBody(
                maxTokens: 1024,
                messages: [
                    AnthropicInputMessage(content: [.text(prompt)], role: .user)
                ],
                model: "claude-3-5-sonnet-20240620"
            ))
            for content in response.content {
                switch content {
                case .text(let message):
                    print("Claude sent a message: \(message)")
                    result = message
                    showingAlert = true
                case .toolUse(id: _, name: let toolName, input: let toolInput):
                    print("Claude used a tool \(toolName) with input: \(toolInput)")
                }
            }
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received non-200 status code: \(statusCode) with response body: \(responseBody)")
        } catch {
            print(error.localizedDescription)
        }
    }
    
    var body: some View {
        VStack {
            VStack{
                ContentUnavailableView(
                    "Generate Message",
                    systemImage: "doc.plaintext.fill",
                    description: Text("Write a prompt below")
                )
            }
            .alert(isPresented: $showingAlert) {
                Alert(
                    title: Text("Result"),
                    message: Text(result),
                    dismissButton: .default(Text("Close"))
                )
            }

            Spacer()
            
            VStack(spacing:12){
                TextField("Type a prompt", text:$prompt)
                    .submitLabel(.go)
                    .padding(12)
                    .background(Color(.systemBackground))
                    .cornerRadius(8)
                    .shadow(color:.primary, radius: 1)
                    .onSubmit {
                        Task{ try await generate() }
                    }
                Button{
                    Task{ try await generate() }
                }label:{
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Generate Message")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Message Example")
        .navigationBarTitleDisplayMode(.inline)
    }
}

#Preview {
    MessageRequestView()
}


================================================
FILE: AIProxyAnthropic/AIProxyAnthropic/Preview Content/Preview Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyAnthropic/AIProxyAnthropic/ToolsView.swift
================================================
//
//  ToolsView.swift
//  AIProxyAnthropic
//
//  Created by Todd Hamilton on 8/14/24.
//

import SwiftUI
import AIProxy

struct ToolsView: View {
    
    @State private var prompt = ""
    @State private var result = ""
    @State private var isLoading = false
    @State private var showingAlert = false
    
    var body: some View {
        VStack {
            VStack{
                ContentUnavailableView(
                    "Stock Symbol Lookup",
                    systemImage: "chart.line.uptrend.xyaxis",
                    description: Text("Type the name of the company you want the symbol for.")
                )
            }
            .alert(isPresented: $showingAlert) {
                Alert(
                    title: Text("Result"),
                    message: Text(result),
                    dismissButton: .default(Text("Close"))
                )
            }

            Spacer()
            
            VStack(spacing:12){
                TextField("Type a company", text:$prompt)
                    .submitLabel(.go)
                    .padding(12)
                    .background(Color(.systemBackground))
                    .cornerRadius(8)
                    .shadow(color:.primary, radius: 1)
                    .onSubmit {
                        Task{ try await generate() }
                    }
                Button{
                    Task{ try await generate() }
                }label:{
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Look Up")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Tools Example")
        .navigationBarTitleDisplayMode(.inline)
    }
    
    func generate() async throws {
        isLoading = true
        defer { isLoading = false }
        do {
            let requestBody = AnthropicMessageRequestBody(
                maxTokens: 1024,
                messages: [
                    .init(
                        content: [.text(prompt)],
                        role: .user
                    )
                ],
                model: "claude-3-5-sonnet-20240620",
                tools: [
                    .init(
                        description: "Call this function when the user wants a stock symbol",
                        inputSchema: [
                            "type": "object",
                            "properties": [
                                "ticker": [
                                    "type": "string",
                                    "description": "The stock ticker symbol, e.g. AAPL for Apple Inc."
                                ]
                            ],
                            "required": ["ticker"]
                        ],
                        name: "get_stock_symbol"
                    )
                ]
            )
            let response = try await anthropicService.messageRequest(body: requestBody)
            
            for content in response.content {
                switch content {
                case .text(let message):
                    print("Claude sent a message: \(message)")
                case .toolUse(id: _, name: let toolName, input: let toolInput):
                    print("Claude used a tool \(toolName) with input: \(toolInput)")
                    result = toolInput.description
                    showingAlert = true
                }
            }
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received non-200 status code: \(statusCode) with response body: \(responseBody)")
        } catch {
            print(error.localizedDescription)
        }
    }
}

#Preview {
    ToolsView()
}


================================================
FILE: AIProxyAnthropic/AIProxyAnthropic/VisionView.swift
================================================
//
//  VisionView.swift
//  AIProxyAnthropic
//
//  Created by Todd Hamilton on 8/14/24.
//

import SwiftUI
import AIProxy

struct VisionView: View {
    
    @State private var prompt:String = ""
    @State private var result:String = ""
    @State private var showingAlert = false
    @State private var isLoading = false
    
    func generate() async throws {
        
        guard let image = UIImage(named: "climber") else {
            print("Could not find an image named 'climber' in your app assets")
            return
        }

        guard let jpegData = AIProxy.encodeImageAsJpeg(image: image, compressionQuality: 0.8) else {
            print("Could not convert image to jpeg")
            return
        }
        
        isLoading = true
        defer { isLoading = false }
        do {
            let response = try await anthropicService.messageRequest(body: AnthropicMessageRequestBody(
                maxTokens: 1024,
                messages: [
                    AnthropicInputMessage(content: [
                        .text("Provide a very short description of this image"),
                        .image(mediaType: .jpeg, data: jpegData.base64EncodedString())
                    ], role: .user)
                ],
                model: "claude-3-5-sonnet-20240620"
            ))
            for content in response.content {
                switch content {
                case .text(let message):
                    print("Claude sent a message: \(message)")
                    result = message
                    showingAlert = true
                case .toolUse(id: _, name: let toolName, input: let toolInput):
                    print("Claude used a tool \(toolName) with input: \(toolInput)")
                }
            }
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received non-200 status code: \(statusCode) with response body: \(responseBody)")
        } catch {
            print(error.localizedDescription)
        }
    }
    
    var body: some View {
        VStack{
            VStack{
                Image("climber")
                    .resizable()
                    .scaledToFit()
                    .frame(maxWidth: .infinity)
            }
            .frame(maxHeight: .infinity)
            .alert(isPresented: $showingAlert){
                Alert(
                    title: Text("Result"),
                    message: Text("\(result)"),
                    dismissButton: .default(Text("Close"))
                )
            }
            
            Spacer()
            
            VStack(spacing:12){
                Button{
                    Task {
                        try await generate()
                    }
                }label: {
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Describe Image")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Vision Example")
        .navigationBarTitleDisplayMode(.inline)
    }
}

#Preview {
    VisionView()
}


================================================
FILE: AIProxyAnthropic/AIProxyAnthropic.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 56;
	objects = {

/* Begin PBXBuildFile section */
		2C06E1442C20DFDB0024133C /* AIProxyAnthropicApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C06E1432C20DFDB0024133C /* AIProxyAnthropicApp.swift */; };
		2C06E1462C20DFDB0024133C /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C06E1452C20DFDB0024133C /* ContentView.swift */; };
		2C06E1482C20DFDD0024133C /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2C06E1472C20DFDD0024133C /* Assets.xcassets */; };
		2C06E14B2C20DFDD0024133C /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2C06E14A2C20DFDD0024133C /* Preview Assets.xcassets */; };
		2CCB20382C6D13EE003A8B25 /* AppConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCB20372C6D13EE003A8B25 /* AppConstants.swift */; };
		2CCB203B2C6D13F4003A8B25 /* AIProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 2CCB203A2C6D13F4003A8B25 /* AIProxy */; };
		2CCB203D2C6D1464003A8B25 /* MessageRequestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCB203C2C6D1464003A8B25 /* MessageRequestView.swift */; };
		2CCB203F2C6D27D9003A8B25 /* VisionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCB203E2C6D27D9003A8B25 /* VisionView.swift */; };
		2CCB20412C6D3072003A8B25 /* ToolsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCB20402C6D3072003A8B25 /* ToolsView.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
		2C06E1402C20DFDB0024133C /* AIProxyAnthropic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AIProxyAnthropic.app; sourceTree = BUILT_PRODUCTS_DIR; };
		2C06E1432C20DFDB0024133C /* AIProxyAnthropicApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AIProxyAnthropicApp.swift; sourceTree = "<group>"; };
		2C06E1452C20DFDB0024133C /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
		2C06E1472C20DFDD0024133C /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
		2C06E14A2C20DFDD0024133C /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
		2CCB20372C6D13EE003A8B25 /* AppConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppConstants.swift; sourceTree = "<group>"; };
		2CCB203C2C6D1464003A8B25 /* MessageRequestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageRequestView.swift; sourceTree = "<group>"; };
		2CCB203E2C6D27D9003A8B25 /* VisionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VisionView.swift; sourceTree = "<group>"; };
		2CCB20402C6D3072003A8B25 /* ToolsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ToolsView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
		2C06E13D2C20DFDB0024133C /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2CCB203B2C6D13F4003A8B25 /* AIProxy in Frameworks */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		2C06E1372C20DFDB0024133C = {
			isa = PBXGroup;
			children = (
				2C06E1422C20DFDB0024133C /* AIProxyAnthropic */,
				2C06E1412C20DFDB0024133C /* Products */,
			);
			sourceTree = "<group>";
		};
		2C06E1412C20DFDB0024133C /* Products */ = {
			isa = PBXGroup;
			children = (
				2C06E1402C20DFDB0024133C /* AIProxyAnthropic.app */,
			);
			name = Products;
			sourceTree = "<group>";
		};
		2C06E1422C20DFDB0024133C /* AIProxyAnthropic */ = {
			isa = PBXGroup;
			children = (
				2C06E1432C20DFDB0024133C /* AIProxyAnthropicApp.swift */,
				2C06E1452C20DFDB0024133C /* ContentView.swift */,
				2CCB203C2C6D1464003A8B25 /* MessageRequestView.swift */,
				2CCB203E2C6D27D9003A8B25 /* VisionView.swift */,
				2CCB20402C6D3072003A8B25 /* ToolsView.swift */,
				2CCB20372C6D13EE003A8B25 /* AppConstants.swift */,
				2C06E1472C20DFDD0024133C /* Assets.xcassets */,
				2C06E1492C20DFDD0024133C /* Preview Content */,
			);
			path = AIProxyAnthropic;
			sourceTree = "<group>";
		};
		2C06E1492C20DFDD0024133C /* Preview Content */ = {
			isa = PBXGroup;
			children = (
				2C06E14A2C20DFDD0024133C /* Preview Assets.xcassets */,
			);
			path = "Preview Content";
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
		2C06E13F2C20DFDB0024133C /* AIProxyAnthropic */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = 2C06E14E2C20DFDD0024133C /* Build configuration list for PBXNativeTarget "AIProxyAnthropic" */;
			buildPhases = (
				2C06E13C2C20DFDB0024133C /* Sources */,
				2C06E13D2C20DFDB0024133C /* Frameworks */,
				2C06E13E2C20DFDB0024133C /* Resources */,
			);
			buildRules = (
			);
			dependencies = (
			);
			name = AIProxyAnthropic;
			packageProductDependencies = (
				2CCB203A2C6D13F4003A8B25 /* AIProxy */,
			);
			productName = AIProxyAnthropic;
			productReference = 2C06E1402C20DFDB0024133C /* AIProxyAnthropic.app */;
			productType = "com.apple.product-type.application";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		2C06E1382C20DFDB0024133C /* Project object */ = {
			isa = PBXProject;
			attributes = {
				BuildIndependentTargetsInParallel = 1;
				LastSwiftUpdateCheck = 1540;
				LastUpgradeCheck = 1540;
				TargetAttributes = {
					2C06E13F2C20DFDB0024133C = {
						CreatedOnToolsVersion = 15.4;
					};
				};
			};
			buildConfigurationList = 2C06E13B2C20DFDB0024133C /* Build configuration list for PBXProject "AIProxyAnthropic" */;
			compatibilityVersion = "Xcode 14.0";
			developmentRegion = en;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
				Base,
			);
			mainGroup = 2C06E1372C20DFDB0024133C;
			packageReferences = (
				2CCB20392C6D13F4003A8B25 /* XCRemoteSwiftPackageReference "AIProxySwift" */,
			);
			productRefGroup = 2C06E1412C20DFDB0024133C /* Products */;
			projectDirPath = "";
			projectRoot = "";
			targets = (
				2C06E13F2C20DFDB0024133C /* AIProxyAnthropic */,
			);
		};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
		2C06E13E2C20DFDB0024133C /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2C06E14B2C20DFDD0024133C /* Preview Assets.xcassets in Resources */,
				2C06E1482C20DFDD0024133C /* Assets.xcassets in Resources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		2C06E13C2C20DFDB0024133C /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2CCB20412C6D3072003A8B25 /* ToolsView.swift in Sources */,
				2CCB203D2C6D1464003A8B25 /* MessageRequestView.swift in Sources */,
				2C06E1462C20DFDB0024133C /* ContentView.swift in Sources */,
				2CCB20382C6D13EE003A8B25 /* AppConstants.swift in Sources */,
				2CCB203F2C6D27D9003A8B25 /* VisionView.swift in Sources */,
				2C06E1442C20DFDB0024133C /* AIProxyAnthropicApp.swift in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
		2C06E14C2C20DFDD0024133C /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = dwarf;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_TESTABILITY = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 17.5;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
				MTL_FAST_MATH = YES;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = iphoneos;
				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
			};
			name = Debug;
		};
		2C06E14D2C20DFDD0024133C /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				ENABLE_NS_ASSERTIONS = NO;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 17.5;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = NO;
				MTL_FAST_MATH = YES;
				SDKROOT = iphoneos;
				SWIFT_COMPILATION_MODE = wholemodule;
				VALIDATE_PRODUCT = YES;
			};
			name = Release;
		};
		2C06E14F2C20DFDD0024133C /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyAnthropic/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.AIProxySampleApp;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Debug;
		};
		2C06E1502C20DFDD0024133C /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyAnthropic/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.AIProxySampleApp;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		2C06E13B2C20DFDB0024133C /* Build configuration list for PBXProject "AIProxyAnthropic" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2C06E14C2C20DFDD0024133C /* Debug */,
				2C06E14D2C20DFDD0024133C /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		2C06E14E2C20DFDD0024133C /* Build configuration list for PBXNativeTarget "AIProxyAnthropic" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2C06E14F2C20DFDD0024133C /* Debug */,
				2C06E1502C20DFDD0024133C /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
		2CCB20392C6D13F4003A8B25 /* XCRemoteSwiftPackageReference "AIProxySwift" */ = {
			isa = XCRemoteSwiftPackageReference;
			repositoryURL = "https://github.com/lzell/AIProxySwift";
			requirement = {
				branch = main;
				kind = branch;
			};
		};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
		2CCB203A2C6D13F4003A8B25 /* AIProxy */ = {
			isa = XCSwiftPackageProductDependency;
			package = 2CCB20392C6D13F4003A8B25 /* XCRemoteSwiftPackageReference "AIProxySwift" */;
			productName = AIProxy;
		};
/* End XCSwiftPackageProductDependency section */
	};
	rootObject = 2C06E1382C20DFDB0024133C /* Project object */;
}


================================================
FILE: AIProxyDeepL/AIProxyDeepL/AIProxyDeepLApp.swift
================================================
//
//  AIProxyDeepLApp.swift
//  AIProxyDeepL
//
//  Created by Todd Hamilton on 8/14/24.
//

import SwiftUI

@main
struct AIProxyDeepLApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}


================================================
FILE: AIProxyDeepL/AIProxyDeepL/AppConstants.swift
================================================
//
//  AppConstants.swift
//  AIProxyDeepL
//
//  Created by Todd Hamilton on 8/14/24.
//

import AIProxy

#error(
    """
    Uncomment one of the methods below. To build and run on device you must follow the AIProxy integration guide.
    Please see https://www.aiproxy.pro/docs/integration-guide.html")
    """
)

/* Uncomment for BYOK use cases */
let deepLService = AIProxy.deepLDirectService(
    unprotectedAPIKey: "your-deepL-key",
    accountType: .free
)

/* Uncomment for all other production use cases */
//let deepLService = AIProxy.deepLService(
//    partialKey: "partial-key-from-your-developer-dashboard",
//    serviceURL: "service-url-from-your-developer-dashboard"
//)


================================================
FILE: AIProxyDeepL/AIProxyDeepL/Assets.xcassets/AccentColor.colorset/Contents.json
================================================
{
  "colors" : [
    {
      "idiom" : "universal"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyDeepL/AIProxyDeepL/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
  "images" : [
    {
      "idiom" : "universal",
      "platform" : "ios",
      "size" : "1024x1024"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyDeepL/AIProxyDeepL/Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyDeepL/AIProxyDeepL/Assets.xcassets/deepl.imageset/Contents.json
================================================
{
  "images" : [
    {
      "filename" : "deepl.png",
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyDeepL/AIProxyDeepL/ContentView.swift
================================================
//
//  ContentView.swift
//  AIProxyDeepL
//
//  Created by Todd Hamilton on 8/14/24.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack{
            
            VStack(spacing:48){
                VStack{
                    Image("deepl")
                        .resizable()
                        .scaledToFit()
                        .frame(width: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/)
                        .cornerRadius(14)
                        .foregroundColor(.primary)
                    Text("DeepL")
                        .bold()
                        .font(.largeTitle)
                    Text("AIProxy Sample")
                        .font(.subheadline)
                        .foregroundColor(.secondary)
                }
                .frame(maxWidth:.infinity,alignment:.center)
                
                VStack{
                    NavigationLink("Translation Example",destination: TranslationView())
                        .bold()
                        .controlSize(.large)
                        .tint(.blue)
                        .buttonStyle(.bordered)
                    
                }
            }
        }
    }
}

#Preview {
    ContentView()
}


================================================
FILE: AIProxyDeepL/AIProxyDeepL/Preview Content/Preview Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyDeepL/AIProxyDeepL/TranslationView.swift
================================================
//
//  TranslationView.swift
//  AIProxyDeepL
//
//  Created by Todd Hamilton on 8/14/24.
//

import SwiftUI
import AIProxy

struct TranslationView: View {
    
    @State private var prompt = ""
    @State private var result = ""
    @State private var isLoading = false
    @State private var showingAlert = false
    
    func generate() async throws {
        isLoading = true
        defer { isLoading = false }
        do {
            let body = DeepLTranslateRequestBody(targetLang: "ES", text: [prompt])
            let response = try await deepLService.translateRequest(body: body)
            // Do something with `response.translations`
            result = response.translations.first?.text ?? ""
            showingAlert = true
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received non-200 status code: \(statusCode) with response body: \(responseBody)")
        } catch {
            print("Could not create translation: \(error.localizedDescription)")
        }
    }
    
    var body: some View {
        VStack {
            VStack{
                ContentUnavailableView(
                    "Translate to Spanish",
                    systemImage: "captions.bubble.fill",
                    description: Text("Write text you want to translate below")
                )
            }
            .alert(isPresented: $showingAlert) {
                Alert(
                    title: Text("Result"),
                    message: Text(result),
                    dismissButton: .default(Text("Close"))
                )
            }

            Spacer()
            
            VStack(spacing:12){
                TextField("Type your text here", text:$prompt)
                    .submitLabel(.go)
                    .padding(12)
                    .background(Color(.systemBackground))
                    .cornerRadius(8)
                    .shadow(color:.primary, radius: 1)
                    .onSubmit {
                        Task{ try await generate() }
                    }
                Button{
                    Task{ try await generate() }
                }label:{
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Translate")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Translate Example")
        .navigationBarTitleDisplayMode(.inline)
    }
}

#Preview {
    TranslationView()
}


================================================
FILE: AIProxyDeepL/AIProxyDeepL.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 56;
	objects = {

/* Begin PBXBuildFile section */
		2CCB204F2C6D5FB8003A8B25 /* AIProxyDeepLApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCB204E2C6D5FB8003A8B25 /* AIProxyDeepLApp.swift */; };
		2CCB20512C6D5FB8003A8B25 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCB20502C6D5FB8003A8B25 /* ContentView.swift */; };
		2CCB20532C6D5FBA003A8B25 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2CCB20522C6D5FBA003A8B25 /* Assets.xcassets */; };
		2CCB20562C6D5FBA003A8B25 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2CCB20552C6D5FBA003A8B25 /* Preview Assets.xcassets */; };
		2CCB205E2C6D5FC1003A8B25 /* AIProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 2CCB205D2C6D5FC1003A8B25 /* AIProxy */; };
		2CCB20602C6D6012003A8B25 /* TranslationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCB205F2C6D6012003A8B25 /* TranslationView.swift */; };
		2CCB20622C6D60B1003A8B25 /* AppConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCB20612C6D60B1003A8B25 /* AppConstants.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
		2CCB204B2C6D5FB8003A8B25 /* AIProxyDeepL.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AIProxyDeepL.app; sourceTree = BUILT_PRODUCTS_DIR; };
		2CCB204E2C6D5FB8003A8B25 /* AIProxyDeepLApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AIProxyDeepLApp.swift; sourceTree = "<group>"; };
		2CCB20502C6D5FB8003A8B25 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
		2CCB20522C6D5FBA003A8B25 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
		2CCB20552C6D5FBA003A8B25 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
		2CCB205F2C6D6012003A8B25 /* TranslationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TranslationView.swift; sourceTree = "<group>"; };
		2CCB20612C6D60B1003A8B25 /* AppConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppConstants.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
		2CCB20482C6D5FB8003A8B25 /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2CCB205E2C6D5FC1003A8B25 /* AIProxy in Frameworks */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		2CCB20422C6D5FB8003A8B25 = {
			isa = PBXGroup;
			children = (
				2CCB204D2C6D5FB8003A8B25 /* AIProxyDeepL */,
				2CCB204C2C6D5FB8003A8B25 /* Products */,
			);
			sourceTree = "<group>";
		};
		2CCB204C2C6D5FB8003A8B25 /* Products */ = {
			isa = PBXGroup;
			children = (
				2CCB204B2C6D5FB8003A8B25 /* AIProxyDeepL.app */,
			);
			name = Products;
			sourceTree = "<group>";
		};
		2CCB204D2C6D5FB8003A8B25 /* AIProxyDeepL */ = {
			isa = PBXGroup;
			children = (
				2CCB204E2C6D5FB8003A8B25 /* AIProxyDeepLApp.swift */,
				2CCB20502C6D5FB8003A8B25 /* ContentView.swift */,
				2CCB205F2C6D6012003A8B25 /* TranslationView.swift */,
				2CCB20612C6D60B1003A8B25 /* AppConstants.swift */,
				2CCB20522C6D5FBA003A8B25 /* Assets.xcassets */,
				2CCB20542C6D5FBA003A8B25 /* Preview Content */,
			);
			path = AIProxyDeepL;
			sourceTree = "<group>";
		};
		2CCB20542C6D5FBA003A8B25 /* Preview Content */ = {
			isa = PBXGroup;
			children = (
				2CCB20552C6D5FBA003A8B25 /* Preview Assets.xcassets */,
			);
			path = "Preview Content";
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
		2CCB204A2C6D5FB8003A8B25 /* AIProxyDeepL */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = 2CCB20592C6D5FBA003A8B25 /* Build configuration list for PBXNativeTarget "AIProxyDeepL" */;
			buildPhases = (
				2CCB20472C6D5FB8003A8B25 /* Sources */,
				2CCB20482C6D5FB8003A8B25 /* Frameworks */,
				2CCB20492C6D5FB8003A8B25 /* Resources */,
			);
			buildRules = (
			);
			dependencies = (
			);
			name = AIProxyDeepL;
			packageProductDependencies = (
				2CCB205D2C6D5FC1003A8B25 /* AIProxy */,
			);
			productName = AIProxyDeepL;
			productReference = 2CCB204B2C6D5FB8003A8B25 /* AIProxyDeepL.app */;
			productType = "com.apple.product-type.application";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		2CCB20432C6D5FB8003A8B25 /* Project object */ = {
			isa = PBXProject;
			attributes = {
				BuildIndependentTargetsInParallel = 1;
				LastSwiftUpdateCheck = 1540;
				LastUpgradeCheck = 1540;
				TargetAttributes = {
					2CCB204A2C6D5FB8003A8B25 = {
						CreatedOnToolsVersion = 15.4;
					};
				};
			};
			buildConfigurationList = 2CCB20462C6D5FB8003A8B25 /* Build configuration list for PBXProject "AIProxyDeepL" */;
			compatibilityVersion = "Xcode 14.0";
			developmentRegion = en;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
				Base,
			);
			mainGroup = 2CCB20422C6D5FB8003A8B25;
			packageReferences = (
				2CCB205C2C6D5FC1003A8B25 /* XCRemoteSwiftPackageReference "AIProxySwift" */,
			);
			productRefGroup = 2CCB204C2C6D5FB8003A8B25 /* Products */;
			projectDirPath = "";
			projectRoot = "";
			targets = (
				2CCB204A2C6D5FB8003A8B25 /* AIProxyDeepL */,
			);
		};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
		2CCB20492C6D5FB8003A8B25 /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2CCB20562C6D5FBA003A8B25 /* Preview Assets.xcassets in Resources */,
				2CCB20532C6D5FBA003A8B25 /* Assets.xcassets in Resources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		2CCB20472C6D5FB8003A8B25 /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2CCB20622C6D60B1003A8B25 /* AppConstants.swift in Sources */,
				2CCB20602C6D6012003A8B25 /* TranslationView.swift in Sources */,
				2CCB20512C6D5FB8003A8B25 /* ContentView.swift in Sources */,
				2CCB204F2C6D5FB8003A8B25 /* AIProxyDeepLApp.swift in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
		2CCB20572C6D5FBA003A8B25 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = dwarf;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_TESTABILITY = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 17.5;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
				MTL_FAST_MATH = YES;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = iphoneos;
				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
			};
			name = Debug;
		};
		2CCB20582C6D5FBA003A8B25 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				ENABLE_NS_ASSERTIONS = NO;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 17.5;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = NO;
				MTL_FAST_MATH = YES;
				SDKROOT = iphoneos;
				SWIFT_COMPILATION_MODE = wholemodule;
				VALIDATE_PRODUCT = YES;
			};
			name = Release;
		};
		2CCB205A2C6D5FBA003A8B25 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyDeepL/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.AIProxySampleApp;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Debug;
		};
		2CCB205B2C6D5FBA003A8B25 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyDeepL/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.AIProxySampleApp;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		2CCB20462C6D5FB8003A8B25 /* Build configuration list for PBXProject "AIProxyDeepL" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2CCB20572C6D5FBA003A8B25 /* Debug */,
				2CCB20582C6D5FBA003A8B25 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		2CCB20592C6D5FBA003A8B25 /* Build configuration list for PBXNativeTarget "AIProxyDeepL" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2CCB205A2C6D5FBA003A8B25 /* Debug */,
				2CCB205B2C6D5FBA003A8B25 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
		2CCB205C2C6D5FC1003A8B25 /* XCRemoteSwiftPackageReference "AIProxySwift" */ = {
			isa = XCRemoteSwiftPackageReference;
			repositoryURL = "https://github.com/lzell/AIProxySwift";
			requirement = {
				branch = main;
				kind = branch;
			};
		};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
		2CCB205D2C6D5FC1003A8B25 /* AIProxy */ = {
			isa = XCSwiftPackageProductDependency;
			package = 2CCB205C2C6D5FC1003A8B25 /* XCRemoteSwiftPackageReference "AIProxySwift" */;
			productName = AIProxy;
		};
/* End XCSwiftPackageProductDependency section */
	};
	rootObject = 2CCB20432C6D5FB8003A8B25 /* Project object */;
}


================================================
FILE: AIProxyFal/AIProxyFal/AIProxyFalApp.swift
================================================
//
//  AIProxyFalApp.swift
//  AIProxyFal
//
//  Created by Todd Hamilton on 6/13/24.
//

import SwiftUI

@main
struct AIProxyFalApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}


================================================
FILE: AIProxyFal/AIProxyFal/AppConstants.swift
================================================
//
//  AppConstants.swift
//  AIProxyFal
//
//  Created by Todd Hamilton on 9/17/24.
//

import AIProxy

#error(
    """
    Uncomment one of the methods below. To build and run on device you must follow the AIProxy integration guide.
    Please see https://www.aiproxy.pro/docs/integration-guide.html")
    """
)

/* Uncomment for BYOK use cases */
let falService = AIProxy.falDirectService(
    unprotectedAPIKey: "your-fal-key"
)

/* Uncomment for all other production use cases */
//let falService = AIProxy.falService(
//    partialKey: "partial-key-from-your-developer-dashboard",
//    serviceURL: "service-url-from-your-developer-dashboard"
//)


================================================
FILE: AIProxyFal/AIProxyFal/Assets.xcassets/AccentColor.colorset/Contents.json
================================================
{
  "colors" : [
    {
      "idiom" : "universal"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyFal/AIProxyFal/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
  "images" : [
    {
      "idiom" : "universal",
      "platform" : "ios",
      "size" : "1024x1024"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyFal/AIProxyFal/Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyFal/AIProxyFal/Assets.xcassets/fal.imageset/Contents.json
================================================
{
  "images" : [
    {
      "filename" : "fal.png",
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyFal/AIProxyFal/ContentView.swift
================================================
//
//  ContentView.swift
//  AIProxyFal
//
//  Created by Todd Hamilton on 6/13/24.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack{
            
            VStack(spacing:24){
                VStack{
                    Image("fal")
                        .resizable()
                        .scaledToFit()
                        .frame(width: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/)
                        .cornerRadius(14)
                        .foregroundColor(.primary)
                    Text("Fal")
                        .bold()
                        .font(.largeTitle)
                    Text("AIProxy Sample")
                        .font(.subheadline)
                        .foregroundColor(.secondary)
                }
                .frame(maxWidth:.infinity,alignment:.center)
                
                VStack{
                    NavigationLink("Text to Image with FastSDXL",destination: TextToImageView())
                        .bold()
                        .controlSize(.large)
                        .tint(.indigo)
                        .buttonStyle(.bordered)
                }
            }
        }
    }
}

#Preview {
    ContentView()
}


================================================
FILE: AIProxyFal/AIProxyFal/Preview Content/Preview Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyFal/AIProxyFal/TextToImageView.swift
================================================
//
//  ImageGenView.swift
//  AIProxyFal
//
//  Created by Todd Hamilton on 6/13/24.
//

import SwiftUI
import AIProxy

struct TextToImageView: View {
    
    @State private var prompt: String = ""
    @State private var imageUrl: String?
    @State private var isLoading: Bool = false
    
    private func generate() async throws {
        
        let input = FalFastSDXLInputSchema(
            prompt: prompt,
            enableSafetyChecker: false
        )
        isLoading = true  // Start loading
        defer { isLoading = false }
        do {
            let output = try await falService.createFastSDXLImage(input: input)
            print("""
                  The first output image is at \(output.images?.first?.url?.absoluteString ?? "")
                  It took \(output.timings?.inference ?? Double.nan) seconds to generate.
                  """)
            imageUrl = output.images?.first?.url?.absoluteString
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received non-200 status code: \(statusCode) with response body: \(responseBody)")
        } catch {
            print("Could not create Fal SDXL image: \(error.localizedDescription)")
        }
    }
    
    var body: some View {
        VStack{
                
            VStack{
                if (imageUrl != nil) {
                    AsyncImage(url: URL(string: imageUrl!)) { phase in
                        if let image = phase.image {
                            image
                                .resizable()
                                .aspectRatio(contentMode: .fit)
                        } else if phase.error != nil {
                            Text("Failed to load image")
                                .foregroundColor(.red)
                        } else {
                            ProgressView()
                        }
                    }
                } else{
                    ContentUnavailableView(
                        "Generate an image",
                        systemImage: "photo.fill",
                        description: Text("Write a prompt below")
                    )
                }
            }
            .frame(maxHeight: .infinity)
            
            Spacer()
            
            VStack(spacing:12){
                TextField("Type a prompt", text:$prompt)
                    .submitLabel(.go)
                    .padding(12)
                    .background(Color(.systemBackground))
                    .cornerRadius(8)
                    .shadow(color:.primary, radius: 1)
                    .onSubmit {
                        Task{ try await generate() }
                    }
                Button{
                    Task{ try await generate() }
                }label:{
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Generate Image")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Generate Image")
        .navigationBarTitleDisplayMode(.inline)
    }
}

#Preview {
    TextToImageView()
}


================================================
FILE: AIProxyFal/AIProxyFal.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 56;
	objects = {

/* Begin PBXBuildFile section */
		2C20F29C2CB0EB31001ECE32 /* AIProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 2C20F29B2CB0EB31001ECE32 /* AIProxy */; };
		2C63D7772D232C03008CFE5B /* AIProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 2C63D7762D232C03008CFE5B /* AIProxy */; };
		2C885B432CB1CD0A00C23BAD /* AIProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 2C885B422CB1CD0A00C23BAD /* AIProxy */; };
		2CD964C92C1BD144006DAD57 /* AIProxyFalApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD964C82C1BD144006DAD57 /* AIProxyFalApp.swift */; };
		2CD964CB2C1BD144006DAD57 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD964CA2C1BD144006DAD57 /* ContentView.swift */; };
		2CD964CD2C1BD145006DAD57 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2CD964CC2C1BD145006DAD57 /* Assets.xcassets */; };
		2CD964D02C1BD145006DAD57 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2CD964CF2C1BD145006DAD57 /* Preview Assets.xcassets */; };
		2CD964D72C1BD186006DAD57 /* TextToImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD964D62C1BD186006DAD57 /* TextToImageView.swift */; };
		2CDD52932C9A2A940052700C /* AppConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CDD52922C9A2A940052700C /* AppConstants.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
		2CD964C52C1BD144006DAD57 /* AIProxyFal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AIProxyFal.app; sourceTree = BUILT_PRODUCTS_DIR; };
		2CD964C82C1BD144006DAD57 /* AIProxyFalApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AIProxyFalApp.swift; sourceTree = "<group>"; };
		2CD964CA2C1BD144006DAD57 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
		2CD964CC2C1BD145006DAD57 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
		2CD964CF2C1BD145006DAD57 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
		2CD964D62C1BD186006DAD57 /* TextToImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextToImageView.swift; sourceTree = "<group>"; };
		2CDD52922C9A2A940052700C /* AppConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppConstants.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
		2CD964C22C1BD144006DAD57 /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2C63D7772D232C03008CFE5B /* AIProxy in Frameworks */,
				2C20F29C2CB0EB31001ECE32 /* AIProxy in Frameworks */,
				2C885B432CB1CD0A00C23BAD /* AIProxy in Frameworks */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		2CD964BC2C1BD144006DAD57 = {
			isa = PBXGroup;
			children = (
				2CD964C72C1BD144006DAD57 /* AIProxyFal */,
				2CD964C62C1BD144006DAD57 /* Products */,
			);
			sourceTree = "<group>";
		};
		2CD964C62C1BD144006DAD57 /* Products */ = {
			isa = PBXGroup;
			children = (
				2CD964C52C1BD144006DAD57 /* AIProxyFal.app */,
			);
			name = Products;
			sourceTree = "<group>";
		};
		2CD964C72C1BD144006DAD57 /* AIProxyFal */ = {
			isa = PBXGroup;
			children = (
				2CD964C82C1BD144006DAD57 /* AIProxyFalApp.swift */,
				2CD964CA2C1BD144006DAD57 /* ContentView.swift */,
				2CD964D62C1BD186006DAD57 /* TextToImageView.swift */,
				2CDD52922C9A2A940052700C /* AppConstants.swift */,
				2CD964CC2C1BD145006DAD57 /* Assets.xcassets */,
				2CD964CE2C1BD145006DAD57 /* Preview Content */,
			);
			path = AIProxyFal;
			sourceTree = "<group>";
		};
		2CD964CE2C1BD145006DAD57 /* Preview Content */ = {
			isa = PBXGroup;
			children = (
				2CD964CF2C1BD145006DAD57 /* Preview Assets.xcassets */,
			);
			path = "Preview Content";
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
		2CD964C42C1BD144006DAD57 /* AIProxyFal */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = 2CD964D32C1BD145006DAD57 /* Build configuration list for PBXNativeTarget "AIProxyFal" */;
			buildPhases = (
				2CD964C12C1BD144006DAD57 /* Sources */,
				2CD964C22C1BD144006DAD57 /* Frameworks */,
				2CD964C32C1BD144006DAD57 /* Resources */,
			);
			buildRules = (
			);
			dependencies = (
			);
			name = AIProxyFal;
			packageProductDependencies = (
				2C20F29B2CB0EB31001ECE32 /* AIProxy */,
				2C885B422CB1CD0A00C23BAD /* AIProxy */,
				2C63D7762D232C03008CFE5B /* AIProxy */,
			);
			productName = AIProxyFal;
			productReference = 2CD964C52C1BD144006DAD57 /* AIProxyFal.app */;
			productType = "com.apple.product-type.application";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		2CD964BD2C1BD144006DAD57 /* Project object */ = {
			isa = PBXProject;
			attributes = {
				BuildIndependentTargetsInParallel = 1;
				LastSwiftUpdateCheck = 1540;
				LastUpgradeCheck = 1540;
				TargetAttributes = {
					2CD964C42C1BD144006DAD57 = {
						CreatedOnToolsVersion = 15.4;
					};
				};
			};
			buildConfigurationList = 2CD964C02C1BD144006DAD57 /* Build configuration list for PBXProject "AIProxyFal" */;
			compatibilityVersion = "Xcode 14.0";
			developmentRegion = en;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
				Base,
			);
			mainGroup = 2CD964BC2C1BD144006DAD57;
			packageReferences = (
				2C63D7752D232C03008CFE5B /* XCRemoteSwiftPackageReference "AIProxySwift" */,
			);
			productRefGroup = 2CD964C62C1BD144006DAD57 /* Products */;
			projectDirPath = "";
			projectRoot = "";
			targets = (
				2CD964C42C1BD144006DAD57 /* AIProxyFal */,
			);
		};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
		2CD964C32C1BD144006DAD57 /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2CD964D02C1BD145006DAD57 /* Preview Assets.xcassets in Resources */,
				2CD964CD2C1BD145006DAD57 /* Assets.xcassets in Resources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		2CD964C12C1BD144006DAD57 /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2CD964D72C1BD186006DAD57 /* TextToImageView.swift in Sources */,
				2CD964CB2C1BD144006DAD57 /* ContentView.swift in Sources */,
				2CD964C92C1BD144006DAD57 /* AIProxyFalApp.swift in Sources */,
				2CDD52932C9A2A940052700C /* AppConstants.swift in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
		2CD964D12C1BD145006DAD57 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = dwarf;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_TESTABILITY = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 17.5;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
				MTL_FAST_MATH = YES;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = iphoneos;
				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
			};
			name = Debug;
		};
		2CD964D22C1BD145006DAD57 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				ENABLE_NS_ASSERTIONS = NO;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 17.5;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = NO;
				MTL_FAST_MATH = YES;
				SDKROOT = iphoneos;
				SWIFT_COMPILATION_MODE = wholemodule;
				VALIDATE_PRODUCT = YES;
			};
			name = Release;
		};
		2CD964D42C1BD145006DAD57 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyFal/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.AIProxyFal;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Debug;
		};
		2CD964D52C1BD145006DAD57 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyFal/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.AIProxyFal;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		2CD964C02C1BD144006DAD57 /* Build configuration list for PBXProject "AIProxyFal" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2CD964D12C1BD145006DAD57 /* Debug */,
				2CD964D22C1BD145006DAD57 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		2CD964D32C1BD145006DAD57 /* Build configuration list for PBXNativeTarget "AIProxyFal" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2CD964D42C1BD145006DAD57 /* Debug */,
				2CD964D52C1BD145006DAD57 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
		2C63D7752D232C03008CFE5B /* XCRemoteSwiftPackageReference "AIProxySwift" */ = {
			isa = XCRemoteSwiftPackageReference;
			repositoryURL = "https://github.com/lzell/AIProxySwift";
			requirement = {
				branch = main;
				kind = branch;
			};
		};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
		2C20F29B2CB0EB31001ECE32 /* AIProxy */ = {
			isa = XCSwiftPackageProductDependency;
			productName = AIProxy;
		};
		2C63D7762D232C03008CFE5B /* AIProxy */ = {
			isa = XCSwiftPackageProductDependency;
			package = 2C63D7752D232C03008CFE5B /* XCRemoteSwiftPackageReference "AIProxySwift" */;
			productName = AIProxy;
		};
		2C885B422CB1CD0A00C23BAD /* AIProxy */ = {
			isa = XCSwiftPackageProductDependency;
			productName = AIProxy;
		};
/* End XCSwiftPackageProductDependency section */
	};
	rootObject = 2CD964BD2C1BD144006DAD57 /* Project object */;
}


================================================
FILE: AIProxyGemini/AIProxyGemini/AIProxyGeminiApp.swift
================================================
//
//  AIProxyGeminiApp.swift
//  AIProxyGemini
//
//  Created by Todd Hamilton on 10/18/24.
//

import SwiftUI

@main
struct AIProxyGeminiApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}


================================================
FILE: AIProxyGemini/AIProxyGemini/AppConstants.swift
================================================
//
//  AppConstants.swift
//  AIProxyGemini
//
//  Created by Todd Hamilton on 10/18/24.
//

import AIProxy

#error(
    """
    Uncomment one of the methods below. To build and run on device you must follow the AIProxy integration guide.
    Please see https://www.aiproxy.pro/docs/integration-guide.html")
    """
)

/* Uncomment for BYOK use cases */
let geminiService = AIProxy.geminiDirectService(
    unprotectedAPIKey: "your-gemini-key"
)

/* Uncomment for all other production use cases */
//let geminiService = AIProxy.geminiService(
//    partialKey: "partial-key-from-your-developer-dashboard",
//    serviceURL: "service-url-from-your-developer-dashboard"
//)


================================================
FILE: AIProxyGemini/AIProxyGemini/Assets.xcassets/AccentColor.colorset/Contents.json
================================================
{
  "colors" : [
    {
      "idiom" : "universal"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyGemini/AIProxyGemini/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
  "images" : [
    {
      "idiom" : "universal",
      "platform" : "ios",
      "size" : "1024x1024"
    },
    {
      "appearances" : [
        {
          "appearance" : "luminosity",
          "value" : "dark"
        }
      ],
      "idiom" : "universal",
      "platform" : "ios",
      "size" : "1024x1024"
    },
    {
      "appearances" : [
        {
          "appearance" : "luminosity",
          "value" : "tinted"
        }
      ],
      "idiom" : "universal",
      "platform" : "ios",
      "size" : "1024x1024"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyGemini/AIProxyGemini/Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyGemini/AIProxyGemini/Assets.xcassets/icon.imageset/Contents.json
================================================
{
  "images" : [
    {
      "filename" : "gemini.png",
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyGemini/AIProxyGemini/ContentView.swift
================================================
//
//  ContentView.swift
//  AIProxyGemini
//
//  Created by Todd Hamilton on 10/18/24.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack{
            VStack(spacing:24){
                VStack{
                    Image("icon")
                        .resizable()
                        .scaledToFit()
                        .frame(width: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/)
                        .cornerRadius(14)
                        .foregroundColor(.primary)
                    Text("Gemini")
                        .bold()
                        .font(.largeTitle)
                    Text("AIProxy Sample")
                        .font(.subheadline)
                        .foregroundColor(.secondary)
                }
                .frame(maxWidth:.infinity,alignment:.center)
                
                VStack{
                    NavigationLink("Text Generation",destination: TextGenerationView())
                }
                .bold()
                .controlSize(.large)
                .tint(.teal)
                .buttonStyle(.bordered)
            }
        }
    }
}

#Preview {
    ContentView()
}


================================================
FILE: AIProxyGemini/AIProxyGemini/Preview Content/Preview Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyGemini/AIProxyGemini/TextGenerationView.swift
================================================
//
//  TextGenerationView.swift
//  AIProxyGemini
//
//  Created by Todd Hamilton on 10/18/24.
//

import SwiftUI
import AIProxy

struct TextGenerationView: View {
    
    @State private var prompt = ""
    @State private var result = ""
    @State private var isLoading = false
    @State private var showingAlert = false
    
    func generate() async throws {
        isLoading = true
        defer { isLoading = false }
        do {
            let requestBody = GeminiGenerateContentRequestBody(
                model: "gemini-1.5-flash",
                contents: [
                    .init(
                        parts: [.text("Tell me a joke")]
                    )
                ]
            )
            let response = try await geminiService.generateContentRequest(body: requestBody)
            for part in response.candidates?.first?.content?.parts ?? [] {
                switch part {
                case .text(let text):
                    print("Gemini sent: \(text)")
                    result = text
                }
            }
            if let usage = response.usageMetadata {
                print(
                    """
                    Used:
                     \(usage.promptTokenCount ?? 0) prompt tokens
                     \(usage.cachedContentTokenCount ?? 0) cached tokens
                     \(usage.candidatesTokenCount ?? 0) candidate tokens
                     \(usage.totalTokenCount ?? 0) total tokens
                    """
                )
            }
            
            showingAlert = true
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received \(statusCode) status code with response body: \(responseBody)")
        } catch {
            print("Could not create Gemini generate content request: \(error.localizedDescription)")
        }
    }
    
    var body: some View {
        VStack {
            VStack{
                ContentUnavailableView(
                    "Generate Text",
                    systemImage: "doc.plaintext.fill",
                    description: Text("Write a prompt below")
                )
            }
            .alert(isPresented: $showingAlert) {
                Alert(
                    title: Text("Result"),
                    message: Text(result),
                    dismissButton: .default(Text("Close"))
                )
            }

            Spacer()
            
            VStack(spacing:12){
                TextField("Type a prompt", text:$prompt)
                    .submitLabel(.go)
                    .padding(12)
                    .background(Color(.systemBackground))
                    .cornerRadius(8)
                    .shadow(color:.primary, radius: 1)
                    .onSubmit {
                        Task{ try await generate() }
                    }
                Button{
                    Task{ try await generate() }
                }label:{
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Generate Text")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Chat Completion")
        .navigationBarTitleDisplayMode(.inline)
    }
}

#Preview {
    TextGenerationView()
}


================================================
FILE: AIProxyGemini/AIProxyGemini.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 77;
	objects = {

/* Begin PBXBuildFile section */
		2C7496D32CC2C9720069337D /* AIProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 2C7496D22CC2C9720069337D /* AIProxy */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
		2C7496A42CC2C82B0069337D /* AIProxyGemini.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AIProxyGemini.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFileSystemSynchronizedRootGroup section */
		2C7496A62CC2C82B0069337D /* AIProxyGemini */ = {
			isa = PBXFileSystemSynchronizedRootGroup;
			path = AIProxyGemini;
			sourceTree = "<group>";
		};
/* End PBXFileSystemSynchronizedRootGroup section */

/* Begin PBXFrameworksBuildPhase section */
		2C7496A12CC2C82B0069337D /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2C7496D32CC2C9720069337D /* AIProxy in Frameworks */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		2C74969B2CC2C82B0069337D = {
			isa = PBXGroup;
			children = (
				2C7496A62CC2C82B0069337D /* AIProxyGemini */,
				2C7496A52CC2C82B0069337D /* Products */,
			);
			sourceTree = "<group>";
		};
		2C7496A52CC2C82B0069337D /* Products */ = {
			isa = PBXGroup;
			children = (
				2C7496A42CC2C82B0069337D /* AIProxyGemini.app */,
			);
			name = Products;
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
		2C7496A32CC2C82B0069337D /* AIProxyGemini */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = 2C7496B22CC2C82D0069337D /* Build configuration list for PBXNativeTarget "AIProxyGemini" */;
			buildPhases = (
				2C7496A02CC2C82B0069337D /* Sources */,
				2C7496A12CC2C82B0069337D /* Frameworks */,
				2C7496A22CC2C82B0069337D /* Resources */,
			);
			buildRules = (
			);
			dependencies = (
			);
			fileSystemSynchronizedGroups = (
				2C7496A62CC2C82B0069337D /* AIProxyGemini */,
			);
			name = AIProxyGemini;
			packageProductDependencies = (
				2C7496D22CC2C9720069337D /* AIProxy */,
			);
			productName = AIProxyGemini;
			productReference = 2C7496A42CC2C82B0069337D /* AIProxyGemini.app */;
			productType = "com.apple.product-type.application";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		2C74969C2CC2C82B0069337D /* Project object */ = {
			isa = PBXProject;
			attributes = {
				BuildIndependentTargetsInParallel = 1;
				LastSwiftUpdateCheck = 1600;
				LastUpgradeCheck = 1600;
				TargetAttributes = {
					2C7496A32CC2C82B0069337D = {
						CreatedOnToolsVersion = 16.0;
					};
				};
			};
			buildConfigurationList = 2C74969F2CC2C82B0069337D /* Build configuration list for PBXProject "AIProxyGemini" */;
			developmentRegion = en;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
				Base,
			);
			mainGroup = 2C74969B2CC2C82B0069337D;
			minimizedProjectReferenceProxies = 1;
			packageReferences = (
				2C7496D12CC2C9720069337D /* XCRemoteSwiftPackageReference "AIProxySwift" */,
			);
			preferredProjectObjectVersion = 77;
			productRefGroup = 2C7496A52CC2C82B0069337D /* Products */;
			projectDirPath = "";
			projectRoot = "";
			targets = (
				2C7496A32CC2C82B0069337D /* AIProxyGemini */,
			);
		};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
		2C7496A22CC2C82B0069337D /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		2C7496A02CC2C82B0069337D /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
		2C7496B02CC2C82D0069337D /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = dwarf;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_TESTABILITY = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 18.0;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
				MTL_FAST_MATH = YES;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = iphoneos;
				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
			};
			name = Debug;
		};
		2C7496B12CC2C82D0069337D /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				ENABLE_NS_ASSERTIONS = NO;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 18.0;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = NO;
				MTL_FAST_MATH = YES;
				SDKROOT = iphoneos;
				SWIFT_COMPILATION_MODE = wholemodule;
				VALIDATE_PRODUCT = YES;
			};
			name = Release;
		};
		2C7496B32CC2C82D0069337D /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyGemini/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.bootstrap;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Debug;
		};
		2C7496B42CC2C82D0069337D /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyGemini/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.bootstrap;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		2C74969F2CC2C82B0069337D /* Build configuration list for PBXProject "AIProxyGemini" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2C7496B02CC2C82D0069337D /* Debug */,
				2C7496B12CC2C82D0069337D /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		2C7496B22CC2C82D0069337D /* Build configuration list for PBXNativeTarget "AIProxyGemini" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2C7496B32CC2C82D0069337D /* Debug */,
				2C7496B42CC2C82D0069337D /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
		2C7496D12CC2C9720069337D /* XCRemoteSwiftPackageReference "AIProxySwift" */ = {
			isa = XCRemoteSwiftPackageReference;
			repositoryURL = "https://github.com/lzell/AIProxySwift";
			requirement = {
				branch = main;
				kind = branch;
			};
		};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
		2C7496D22CC2C9720069337D /* AIProxy */ = {
			isa = XCSwiftPackageProductDependency;
			package = 2C7496D12CC2C9720069337D /* XCRemoteSwiftPackageReference "AIProxySwift" */;
			productName = AIProxy;
		};
/* End XCSwiftPackageProductDependency section */
	};
	rootObject = 2C74969C2CC2C82B0069337D /* Project object */;
}


================================================
FILE: AIProxyGroq/AIProxyGroq/AIProxyGroqApp.swift
================================================
//
//  AIProxyGroqApp.swift
//  AIProxyGroq
//
//  Created by Todd Hamilton on 10/1/24.
//

import SwiftUI

@main
struct AIProxyGroqApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}


================================================
FILE: AIProxyGroq/AIProxyGroq/AppConstants.swift
================================================
//
//  AppConstants.swift
//  AIProxyGroq
//
//  Created by Todd Hamilton on 10/1/24.
//

import AIProxy

#error(
    """
    Uncomment one of the methods below. To build and run on device you must follow the AIProxy integration guide.
    Please see https://www.aiproxy.pro/docs/integration-guide.html")
    """
)

/* Uncomment for BYOK use cases */
let groqService = AIProxy.groqDirectService(
    unprotectedAPIKey: "your-groq-key"
)

/* Uncomment for all other production use cases */
//let groqService = AIProxy.groqService(
//    partialKey: "partial-key-from-your-developer-dashboard",
//    serviceURL: "service-url-from-your-developer-dashboard"
//)


================================================
FILE: AIProxyGroq/AIProxyGroq/Assets.xcassets/AccentColor.colorset/Contents.json
================================================
{
  "colors" : [
    {
      "idiom" : "universal"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyGroq/AIProxyGroq/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
  "images" : [
    {
      "idiom" : "universal",
      "platform" : "ios",
      "size" : "1024x1024"
    },
    {
      "appearances" : [
        {
          "appearance" : "luminosity",
          "value" : "dark"
        }
      ],
      "idiom" : "universal",
      "platform" : "ios",
      "size" : "1024x1024"
    },
    {
      "appearances" : [
        {
          "appearance" : "luminosity",
          "value" : "tinted"
        }
      ],
      "idiom" : "universal",
      "platform" : "ios",
      "size" : "1024x1024"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyGroq/AIProxyGroq/Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyGroq/AIProxyGroq/Assets.xcassets/groq.imageset/Contents.json
================================================
{
  "images" : [
    {
      "filename" : "groq.png",
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyGroq/AIProxyGroq/ChatView.swift
================================================
//
//  ChatView.swift
//  AIProxyGroq
//
//  Created by Todd Hamilton on 10/1/24.
//

import SwiftUI
import AIProxy

struct ChatView: View {
    
    @State private var prompt = ""
    @State private var result = ""
    @State private var isLoading = false
    @State private var showingAlert = false
    
    func generate() async throws {
        isLoading = true
        defer { isLoading = false }
        do {
            let response = try await groqService.chatCompletionRequest(body: .init(
                messages: [.assistant(content: prompt)],
                model: "mixtral-8x7b-32768"
            ))
            print(response.choices.first?.message.content ?? "")
            result = response.choices.first?.message.content ?? ""
            showingAlert = true
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received non-200 status code: \(statusCode) with response body: \(responseBody)")
        } catch {
            print(error.localizedDescription)
        }
    }
    
    var body: some View {
        VStack {
            VStack{
                ContentUnavailableView(
                    "Generate Text",
                    systemImage: "doc.plaintext.fill",
                    description: Text("Write a prompt below")
                )
            }
            .alert(isPresented: $showingAlert) {
                Alert(
                    title: Text("Result"),
                    message: Text(result),
                    dismissButton: .default(Text("Close"))
                )
            }

            Spacer()
            
            VStack(spacing:12){
                TextField("Type a prompt", text:$prompt)
                    .submitLabel(.go)
                    .padding(12)
                    .background(Color(.systemBackground))
                    .cornerRadius(8)
                    .shadow(color:.primary, radius: 1)
                    .onSubmit {
                        Task{ try await generate() }
                    }
                Button{
                    Task{ try await generate() }
                }label:{
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Generate Text")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Chat Completion")
        .navigationBarTitleDisplayMode(.inline)
    }
}


#Preview {
    ChatView()
}


================================================
FILE: AIProxyGroq/AIProxyGroq/ContentView.swift
================================================
//
//  ContentView.swift
//  AIProxyGroq
//
//  Created by Todd Hamilton on 10/1/24.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack{
            VStack(spacing:24){
                VStack{
                    Image("groq")
                        .resizable()
                        .scaledToFit()
                        .frame(width: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/)
                        .cornerRadius(14)
                        .foregroundColor(.primary)
                    Text("Groq")
                        .bold()
                        .font(.largeTitle)
                    Text("AIProxy Sample")
                        .font(.subheadline)
                        .foregroundColor(.secondary)
                }
                .frame(maxWidth:.infinity,alignment:.center)
                
                VStack{
                    NavigationLink("Chat Completion",destination: ChatView())
                    NavigationLink("Streaming Chat Completion",destination: StreamingChatView())
                }
                .bold()
                .controlSize(.large)
                .tint(.red)
                .buttonStyle(.bordered)
            }
        }
    }
}

#Preview {
    ContentView()
}


================================================
FILE: AIProxyGroq/AIProxyGroq/Preview Content/Preview Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyGroq/AIProxyGroq/StreamingChatView.swift
================================================
//
//  StreamingChatView.swift
//  AIProxyGroq
//
//  Created by Todd Hamilton on 10/1/24.
//


import SwiftUI
import AIProxy

struct StreamingChatView: View {
    
    @State private var prompt = ""
    @State private var result = ""
    @State private var isLoading = false
    @State private var showingAlert = false
    
    func generate() async throws {
        isLoading = true
        defer { isLoading = false }
        do {
            let stream = try await groqService.streamingChatCompletionRequest(body: .init(
                    messages: [.assistant(content: prompt)],
                    model: "mixtral-8x7b-32768"
                )
            )
            for try await chunk in stream {
                print(chunk.choices.first?.delta.content ?? "")
            }
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received \(statusCode) status code with response body: \(responseBody)")
        } catch {
            print(error.localizedDescription)
        }
    }
    
    var body: some View {
        VStack {
            VStack{
                ContentUnavailableView(
                    "Generate Text",
                    systemImage: "doc.plaintext.fill",
                    description: Text("Write a prompt below")
                )
            }
            .alert(isPresented: $showingAlert) {
                Alert(
                    title: Text("Result"),
                    message: Text("View the streaming response in the Xcode console."),
                    dismissButton: .default(Text("Close"))
                )
            }

            Spacer()
            
            VStack(spacing:12){
                TextField("Type a prompt", text:$prompt)
                    .submitLabel(.go)
                    .padding(12)
                    .background(Color(.systemBackground))
                    .cornerRadius(8)
                    .shadow(color:.primary, radius: 1)
                    .onSubmit {
                        showingAlert = true
                        Task{ try await generate() }
                    }
                Button{
                    showingAlert = true
                    Task{ try await generate() }
                }label:{
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Generate Text")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Streaming Chat Completion")
        .navigationBarTitleDisplayMode(.inline)
    }
}

#Preview {
    ChatView()
}


================================================
FILE: AIProxyGroq/AIProxyGroq.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 77;
	objects = {

/* Begin PBXBuildFile section */
		2C7E8C082CAC7CAA00A70D1C /* AIProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 2C7E8C072CAC7CAA00A70D1C /* AIProxy */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
		2C7E8BF52CAC7B7E00A70D1C /* AIProxyGroq.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AIProxyGroq.app; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */

/* Begin PBXFileSystemSynchronizedRootGroup section */
		2C7E8BF72CAC7B7E00A70D1C /* AIProxyGroq */ = {
			isa = PBXFileSystemSynchronizedRootGroup;
			path = AIProxyGroq;
			sourceTree = "<group>";
		};
/* End PBXFileSystemSynchronizedRootGroup section */

/* Begin PBXFrameworksBuildPhase section */
		2C7E8BF22CAC7B7E00A70D1C /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2C7E8C082CAC7CAA00A70D1C /* AIProxy in Frameworks */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		2C7E8BEC2CAC7B7E00A70D1C = {
			isa = PBXGroup;
			children = (
				2C7E8BF72CAC7B7E00A70D1C /* AIProxyGroq */,
				2C7E8BF62CAC7B7E00A70D1C /* Products */,
			);
			sourceTree = "<group>";
		};
		2C7E8BF62CAC7B7E00A70D1C /* Products */ = {
			isa = PBXGroup;
			children = (
				2C7E8BF52CAC7B7E00A70D1C /* AIProxyGroq.app */,
			);
			name = Products;
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
		2C7E8BF42CAC7B7E00A70D1C /* AIProxyGroq */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = 2C7E8C032CAC7B7F00A70D1C /* Build configuration list for PBXNativeTarget "AIProxyGroq" */;
			buildPhases = (
				2C7E8BF12CAC7B7E00A70D1C /* Sources */,
				2C7E8BF22CAC7B7E00A70D1C /* Frameworks */,
				2C7E8BF32CAC7B7E00A70D1C /* Resources */,
			);
			buildRules = (
			);
			dependencies = (
			);
			fileSystemSynchronizedGroups = (
				2C7E8BF72CAC7B7E00A70D1C /* AIProxyGroq */,
			);
			name = AIProxyGroq;
			packageProductDependencies = (
				2C7E8C072CAC7CAA00A70D1C /* AIProxy */,
			);
			productName = AIProxyGroq;
			productReference = 2C7E8BF52CAC7B7E00A70D1C /* AIProxyGroq.app */;
			productType = "com.apple.product-type.application";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		2C7E8BED2CAC7B7E00A70D1C /* Project object */ = {
			isa = PBXProject;
			attributes = {
				BuildIndependentTargetsInParallel = 1;
				LastSwiftUpdateCheck = 1600;
				LastUpgradeCheck = 1600;
				TargetAttributes = {
					2C7E8BF42CAC7B7E00A70D1C = {
						CreatedOnToolsVersion = 16.0;
					};
				};
			};
			buildConfigurationList = 2C7E8BF02CAC7B7E00A70D1C /* Build configuration list for PBXProject "AIProxyGroq" */;
			developmentRegion = en;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
				Base,
			);
			mainGroup = 2C7E8BEC2CAC7B7E00A70D1C;
			minimizedProjectReferenceProxies = 1;
			packageReferences = (
				2C7E8C062CAC7CAA00A70D1C /* XCRemoteSwiftPackageReference "AIProxySwift" */,
			);
			preferredProjectObjectVersion = 77;
			productRefGroup = 2C7E8BF62CAC7B7E00A70D1C /* Products */;
			projectDirPath = "";
			projectRoot = "";
			targets = (
				2C7E8BF42CAC7B7E00A70D1C /* AIProxyGroq */,
			);
		};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
		2C7E8BF32CAC7B7E00A70D1C /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		2C7E8BF12CAC7B7E00A70D1C /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
		2C7E8C012CAC7B7F00A70D1C /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = dwarf;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_TESTABILITY = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 18.0;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
				MTL_FAST_MATH = YES;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = iphoneos;
				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
			};
			name = Debug;
		};
		2C7E8C022CAC7B7F00A70D1C /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				ENABLE_NS_ASSERTIONS = NO;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 18.0;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = NO;
				MTL_FAST_MATH = YES;
				SDKROOT = iphoneos;
				SWIFT_COMPILATION_MODE = wholemodule;
				VALIDATE_PRODUCT = YES;
			};
			name = Release;
		};
		2C7E8C042CAC7B7F00A70D1C /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyGroq/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.bootstrap;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Debug;
		};
		2C7E8C052CAC7B7F00A70D1C /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyGroq/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.bootstrap;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		2C7E8BF02CAC7B7E00A70D1C /* Build configuration list for PBXProject "AIProxyGroq" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2C7E8C012CAC7B7F00A70D1C /* Debug */,
				2C7E8C022CAC7B7F00A70D1C /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		2C7E8C032CAC7B7F00A70D1C /* Build configuration list for PBXNativeTarget "AIProxyGroq" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2C7E8C042CAC7B7F00A70D1C /* Debug */,
				2C7E8C052CAC7B7F00A70D1C /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
		2C7E8C062CAC7CAA00A70D1C /* XCRemoteSwiftPackageReference "AIProxySwift" */ = {
			isa = XCRemoteSwiftPackageReference;
			repositoryURL = "https://github.com/lzell/AIProxySwift";
			requirement = {
				branch = main;
				kind = branch;
			};
		};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
		2C7E8C072CAC7CAA00A70D1C /* AIProxy */ = {
			isa = XCSwiftPackageProductDependency;
			package = 2C7E8C062CAC7CAA00A70D1C /* XCRemoteSwiftPackageReference "AIProxySwift" */;
			productName = AIProxy;
		};
/* End XCSwiftPackageProductDependency section */
	};
	rootObject = 2C7E8BED2CAC7B7E00A70D1C /* Project object */;
}


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/AIProxyOpenAIApp.swift
================================================
//
//  AIProxyOpenAIApp.swift
//  AIProxyOpenAI
//
//  Created by Todd Hamilton on 6/14/24.
//

import SwiftUI

@main
struct AIProxyOpenAIApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/AppConstants.swift
================================================
//
//  AppConstants.swift
//  AIProxyOpenAI
//
//  Created by Todd Hamilton on 6/14/24.
//

import AIProxy

#error(
    """
    Uncomment one of the methods below. To build and run on device you must follow the AIProxy integration guide.
    Please see https://www.aiproxy.pro/docs/integration-guide.html")
    """
)

/* Uncomment for BYOK use cases */
let openAIService = AIProxy.openAIDirectService(
    unprotectedAPIKey: "your-openai-key"
)

/* Uncomment for all other production use cases */
//let openAIService = AIProxy.openAIService(
//    partialKey: "partial-key-from-your-developer-dashboard",
//    serviceURL: "service-url-from-your-developer-dashboard"
//)


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/Assets.xcassets/AccentColor.colorset/Contents.json
================================================
{
  "colors" : [
    {
      "idiom" : "universal"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
  "images" : [
    {
      "idiom" : "universal",
      "platform" : "ios",
      "size" : "1024x1024"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/Assets.xcassets/openai.imageset/Contents.json
================================================
{
  "images" : [
    {
      "filename" : "openai.png",
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/Assets.xcassets/surfer.imageset/Contents.json
================================================
{
  "images" : [
    {
      "filename" : "surfer.jpeg",
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/ChatView.swift
================================================
//
//  ChatView.swift
//  AIProxyOpenAI
//
//  Created by Todd Hamilton on 6/14/24.
//

import SwiftUI
import AIProxy

struct ChatView: View {
    
    @State private var prompt = ""
    @State private var result = ""
    @State private var isLoading = false
    @State private var showingAlert = false
    
    func generate() async throws {
        isLoading = true
        defer { isLoading = false }
        do {
            let response = try await openAIService.chatCompletionRequest(body: .init(
                model: "gpt-4o",
                messages: [.system(content: .text(prompt))]
            ))
            result = (response.choices.first?.message.content)!
            showingAlert = true
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received non-200 status code: \(statusCode) with response body: \(String(describing: responseBody))")
        } catch {
            print(error.localizedDescription)
        }
    }
    
    var body: some View {
        VStack {
            VStack{
                ContentUnavailableView(
                    "Generate Text",
                    systemImage: "doc.plaintext.fill",
                    description: Text("Write a prompt below")
                )
            }
            .alert(isPresented: $showingAlert) {
                Alert(
                    title: Text("Result"),
                    message: Text(result),
                    dismissButton: .default(Text("Close"))
                )
            }

            Spacer()
            
            VStack(spacing:12){
                TextField("Type a prompt", text:$prompt)
                    .submitLabel(.go)
                    .padding(12)
                    .background(Color(.systemBackground))
                    .cornerRadius(8)
                    .shadow(color:.primary, radius: 1)
                    .onSubmit {
                        Task{ try await generate() }
                    }
                Button{
                    Task{ try await generate() }
                }label:{
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Generate Text")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Chat Completion")
        .navigationBarTitleDisplayMode(.inline)
    }
}

#Preview {
    ChatView()
}


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/ContentView.swift
================================================
//
//  ContentView.swift
//  AIProxyOpenAI
//
//  Created by Todd Hamilton on 6/14/24.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack{
            
            VStack(spacing:48){
                VStack{
                    Image("openai")
                        .resizable()
                        .scaledToFit()
                        .frame(width: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/)
                        .cornerRadius(14)
                        .foregroundColor(.primary)
                    Text("OpenAI")
                        .bold()
                        .font(.largeTitle)
                    Text("AIProxy Sample")
                        .font(.subheadline)
                        .foregroundColor(.secondary)
                }
                .frame(maxWidth:.infinity,alignment:.center)
                
                VStack{
                    NavigationLink("Chat Example",destination: ChatView())
                    NavigationLink("Streaming Chat Example",destination: ChatView())
                    NavigationLink("Multi-Modal Chat Example",destination: MultiModalChatView())
                    NavigationLink("DALLE Example",destination: DalleView())
                    NavigationLink("Text-to-Speech Example",destination: TextToSpeechView())
                }
                .bold()
                .controlSize(.large)
                .buttonStyle(.bordered)
                .tint(.purple)
            }
        }
    }
}

#Preview {
    ContentView()
}


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/DalleView.swift
================================================
//
//  DalleView.swift
//  AIProxyOpenAI
//
//  Created by Todd Hamilton on 8/13/24.
//

import SwiftUI
import AIProxy

struct DalleView: View {
    
    @State private var prompt = ""
    @State private var imageUrl: String?
    @State private var isLoading = false
    
    func generate() async throws {
        isLoading = true  // Start loading
        defer { isLoading = false }
        do {
            let requestBody = OpenAICreateImageRequestBody(
                prompt: prompt,
                model: "dall-e-3"
            )
            let response = try await openAIService.createImageRequest(body: requestBody)
            imageUrl = response.data.first?.url?.absoluteString ?? ""
//            print(response.data.first?.url ?? "")
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received non-200 status code: \(statusCode) with response body: \(responseBody)")
        } catch {
            print(error.localizedDescription)
        }
    }
    
    var body: some View {
        VStack{
                
            VStack{
                if (imageUrl != nil) {
                    AsyncImage(url: URL(string: imageUrl!)) { phase in
                        if let image = phase.image {
                            image
                                .resizable()
                                .aspectRatio(contentMode: .fit)
                        } else if phase.error != nil {
                            Text("Failed to load image")
                                .foregroundColor(.red)
                        } else {
                            ProgressView()
                        }
                    }
                } else{
                    ContentUnavailableView(
                        "Generate an image",
                        systemImage: "photo.fill",
                        description: Text("Write a prompt below")
                    )
                }
            }
            .frame(maxHeight: .infinity)
            
            Spacer()
            
            VStack(spacing:12){
                TextField("Type a prompt", text:$prompt)
                    .submitLabel(.go)
                    .padding(12)
                    .background(Color(.systemBackground))
                    .cornerRadius(8)
                    .shadow(color:.primary, radius: 1)
                    .onSubmit {
                        Task{ try await generate() }
                    }
                Button{
                    Task{ try await generate() }
                }label:{
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Generate Text")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Generate Image")
        .navigationBarTitleDisplayMode(.inline)
    }
}

#Preview {
    DalleView()
}


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/MultiModalChatView.swift
================================================
//
//  MultiModalChatView.swift
//  AIProxyOpenAI
//
//  Created by Todd Hamilton on 6/14/24.
//

import SwiftUI
import AIProxy
import UIKit

struct MultiModalChatView: View {
    
    @State private var prompt:String = ""
    @State private var result:String = ""
    @State private var showingAlert = false
    @State private var isLoading = false
    
    var body: some View {
        VStack{
            VStack{
                Image("surfer")
                    .resizable()
                    .scaledToFit()
                    .frame(maxWidth: .infinity)
            }
            .frame(maxHeight: .infinity)
            .alert(isPresented: $showingAlert){
                Alert(
                    title: Text("Result"),
                    message: Text("\(result)"),
                    dismissButton: .default(Text("Close"))
                )
            }
            
            Spacer()
            
            VStack(spacing:12){
                Button{
                    Task {
                        try await generate()
                    }
                }label: {
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Describe Image")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Describe Image")
        .navigationBarTitleDisplayMode(.inline)
    }
    
    func generate() async throws {
        isLoading = true
        defer { isLoading = false }
        
        let image = UIImage(named: "surfer")
        let localURL = createOpenAILocalURL(forImage: image!)
        
        do {
            let response = try await openAIService.chatCompletionRequest(body: .init(
                model: "gpt-4o",
                messages: [
                    .system(
                        content: .text("Tell me what you see")
                    ),
                    .user(
                        content: .parts(
                            [
                                .text("What do you see?"),
                                .imageURL(localURL!)
                            ]
                        )
                    )
                ]
            ))
            result = (response.choices.first?.message.content)!
            showingAlert = true
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received non-200 status code: \(statusCode) with response body: \(String(describing: responseBody))")
        } catch {
            print(error.localizedDescription)
        }
    }
    
    func createOpenAILocalURL(forImage image: UIImage) -> URL? {
        // Attempt to get JPEG data from the UIImage
        guard let jpegData = image.jpegData(compressionQuality: 1.0) else {
            return nil
        }
        
        // Encode the JPEG data to a base64 string
        let base64String = jpegData.base64EncodedString()
        
        // Create the data URL string
        let urlString = "data:image/jpeg;base64,\(base64String)"
        
        // Return the URL constructed from the data URL string
        return URL(string: urlString)
    }
 
}

#Preview {
    MultiModalChatView()
}

private extension CGImage {
    var jpegData: Data? {
        let uiImage = UIImage(cgImage: self)
        return uiImage.jpegData(compressionQuality: 1.0)
    }
}






================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/Preview Content/Preview Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/StreamingChatView.swift
================================================
//
//  StreamingChatView.swift
//  AIProxyOpenAI
//
//  Created by Todd Hamilton on 8/13/24.
//

import SwiftUI
import AIProxy

struct StreamingChatView: View {
    
    @State private var prompt = ""
    @State private var result = ""
    @State private var isLoading = false
    @State private var showingAlert = false
    
    func generate() async throws {
        
        let requestBody = OpenAIChatCompletionRequestBody(
            model: "gpt-4o",
            messages: [.user(content: .text(prompt))]
        )
        isLoading = true
        defer { isLoading = false }
        do {
            let stream = try await openAIService.streamingChatCompletionRequest(body: requestBody)
            for try await chunk in stream {
                print(chunk.choices.first?.delta.content ?? "")
            }
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received non-200 status code: \(statusCode) with response body: \(responseBody)")
        } catch {
            print(error.localizedDescription)
        }
    }
    
    var body: some View {
        VStack {
            VStack{
                ContentUnavailableView(
                    "Generate Text",
                    systemImage: "doc.plaintext.fill",
                    description: Text("Write a prompt below")
                )
            }
            .alert(isPresented: $showingAlert) {
                Alert(
                    title: Text("Result"),
                    message: Text("View the streaming response in the Xcode console."),
                    dismissButton: .default(Text("Close"))
                )
            }

            Spacer()
            
            VStack(spacing:12){
                TextField("Type a prompt", text:$prompt)
                    .submitLabel(.go)
                    .padding(12)
                    .background(Color(.systemBackground))
                    .cornerRadius(8)
                    .shadow(color:.primary, radius: 1)
                    .onSubmit {
                        Task{ try await generate() }
                    }
                Button{
                    showingAlert = true
                    Task{ try await generate() }
                }label:{
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Generate Text")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Streaming Chat Completion")
        .navigationBarTitleDisplayMode(.inline)
    }
}

#Preview {
    StreamingChatView()
}


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI/TextToSpeechView.swift
================================================
//
//  TextToSpeechView.swift
//  AIProxyOpenAI
//
//  Created by Todd Hamilton on 10/9/24.
//

import SwiftUI
import AIProxy
import AVKit

struct TextToSpeechView: View {
    
    @State private var prompt = ""
    @State private var result = ""
    @State private var isLoading = false
    @State var audioPlayer: AVAudioPlayer!
    
    // List of available voices
    let voices = ["nova", "aria", "bella", "emma"] // Replace with actual voice names from OpenAI
    @State private var selectedVoice = "nova" // Default selected voice
    
    func generate() async throws {
        isLoading = true
        defer { isLoading = false }
        do {
            let requestBody = OpenAITextToSpeechRequestBody(
                input: prompt,
                voice: OpenAITextToSpeechRequestBody.Voice(rawValue: selectedVoice) ?? .nova
            )

            let mpegData = try await openAIService.createTextToSpeechRequest(body: requestBody)

            // Do not use a local `let` or `var` for AVAudioPlayer.
            // You need the lifecycle of the player to live beyond the scope of this function.
            // Instead, use file scope or set the player as a member of a reference type with long life.
            // For example, at the top of this file you may define:
            //
            //   fileprivate var audioPlayer: AVAudioPlayer? = nil
            //
            // And then use the code below to play the TTS result:
            audioPlayer = try AVAudioPlayer(data: mpegData)
            audioPlayer?.prepareToPlay()
            audioPlayer?.play()
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received \(statusCode) status code with response body: \(responseBody)")
        } catch {
            print("Could not create ElevenLabs TTS audio: \(error.localizedDescription)")
        }
    }
    
    var body: some View {
        VStack {
            VStack{
                ContentUnavailableView(
                    "Text-to-Speech",
                    systemImage: "doc.plaintext.fill",
                    description: Text("Write a prompt and select a voice")
                )
            }

            Spacer()
            
            VStack(spacing:12){
                TextField("Type a prompt", text:$prompt)
                    .submitLabel(.go)
                    .padding(12)
                    .background(Color(.systemBackground))
                    .cornerRadius(8)
                    .shadow(color:.primary, radius: 1)
                    .onSubmit {
                        Task{ try await generate() }
                    }
                
                // Voice Picker
                Picker("Select Voice", selection: $selectedVoice) {
                    ForEach(voices, id: \.self) {
                        Text($0.capitalized)
                    }
                }
                .pickerStyle(.segmented)
                .padding()
                
                Button{
                    Task{ try await generate() }
                }label:{
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Generate Speech")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Text-to-Speech")
        .navigationBarTitleDisplayMode(.inline)
    }
}

#Preview {
    TextToSpeechView()
}


================================================
FILE: AIProxyOpenAI/AIProxyOpenAI.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 56;
	objects = {

/* Begin PBXBuildFile section */
		2C16EC352CB720580016790F /* TextToSpeechView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C16EC342CB720580016790F /* TextToSpeechView.swift */; };
		2CCB20342C6C03AF003A8B25 /* StreamingChatView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCB20332C6C03AF003A8B25 /* StreamingChatView.swift */; };
		2CCB20362C6C0419003A8B25 /* DalleView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CCB20352C6C0419003A8B25 /* DalleView.swift */; };
		2CD964F02C1CA33B006DAD57 /* AIProxyOpenAIApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD964EF2C1CA33B006DAD57 /* AIProxyOpenAIApp.swift */; };
		2CD964F22C1CA33B006DAD57 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD964F12C1CA33B006DAD57 /* ContentView.swift */; };
		2CD964F42C1CA33D006DAD57 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2CD964F32C1CA33D006DAD57 /* Assets.xcassets */; };
		2CD964F72C1CA33D006DAD57 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2CD964F62C1CA33D006DAD57 /* Preview Assets.xcassets */; };
		2CD964FE2C1CA3DC006DAD57 /* MultiModalChatView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD964FD2C1CA3DC006DAD57 /* MultiModalChatView.swift */; };
		2CD965002C1CA3F3006DAD57 /* ChatView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD964FF2C1CA3F3006DAD57 /* ChatView.swift */; };
		2CD965032C1CA4BB006DAD57 /* AIProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 2CD965022C1CA4BB006DAD57 /* AIProxy */; };
		2CD965052C1CA4CF006DAD57 /* AppConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD965042C1CA4CF006DAD57 /* AppConstants.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
		2C16EC342CB720580016790F /* TextToSpeechView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TextToSpeechView.swift; sourceTree = "<group>"; };
		2CCB20332C6C03AF003A8B25 /* StreamingChatView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StreamingChatView.swift; sourceTree = "<group>"; };
		2CCB20352C6C0419003A8B25 /* DalleView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DalleView.swift; sourceTree = "<group>"; };
		2CD964EC2C1CA33B006DAD57 /* AIProxyOpenAI.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AIProxyOpenAI.app; sourceTree = BUILT_PRODUCTS_DIR; };
		2CD964EF2C1CA33B006DAD57 /* AIProxyOpenAIApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AIProxyOpenAIApp.swift; sourceTree = "<group>"; };
		2CD964F12C1CA33B006DAD57 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
		2CD964F32C1CA33D006DAD57 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
		2CD964F62C1CA33D006DAD57 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
		2CD964FD2C1CA3DC006DAD57 /* MultiModalChatView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiModalChatView.swift; sourceTree = "<group>"; };
		2CD964FF2C1CA3F3006DAD57 /* ChatView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatView.swift; sourceTree = "<group>"; };
		2CD965042C1CA4CF006DAD57 /* AppConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppConstants.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
		2CD964E92C1CA33B006DAD57 /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2CD965032C1CA4BB006DAD57 /* AIProxy in Frameworks */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		2CD964E32C1CA33B006DAD57 = {
			isa = PBXGroup;
			children = (
				2CD964EE2C1CA33B006DAD57 /* AIProxyOpenAI */,
				2CD964ED2C1CA33B006DAD57 /* Products */,
			);
			sourceTree = "<group>";
		};
		2CD964ED2C1CA33B006DAD57 /* Products */ = {
			isa = PBXGroup;
			children = (
				2CD964EC2C1CA33B006DAD57 /* AIProxyOpenAI.app */,
			);
			name = Products;
			sourceTree = "<group>";
		};
		2CD964EE2C1CA33B006DAD57 /* AIProxyOpenAI */ = {
			isa = PBXGroup;
			children = (
				2CD964EF2C1CA33B006DAD57 /* AIProxyOpenAIApp.swift */,
				2CD964F12C1CA33B006DAD57 /* ContentView.swift */,
				2CD964FF2C1CA3F3006DAD57 /* ChatView.swift */,
				2CCB20332C6C03AF003A8B25 /* StreamingChatView.swift */,
				2CD964FD2C1CA3DC006DAD57 /* MultiModalChatView.swift */,
				2CCB20352C6C0419003A8B25 /* DalleView.swift */,
				2C16EC342CB720580016790F /* TextToSpeechView.swift */,
				2CD965042C1CA4CF006DAD57 /* AppConstants.swift */,
				2CD964F32C1CA33D006DAD57 /* Assets.xcassets */,
				2CD964F52C1CA33D006DAD57 /* Preview Content */,
			);
			path = AIProxyOpenAI;
			sourceTree = "<group>";
		};
		2CD964F52C1CA33D006DAD57 /* Preview Content */ = {
			isa = PBXGroup;
			children = (
				2CD964F62C1CA33D006DAD57 /* Preview Assets.xcassets */,
			);
			path = "Preview Content";
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
		2CD964EB2C1CA33B006DAD57 /* AIProxyOpenAI */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = 2CD964FA2C1CA33D006DAD57 /* Build configuration list for PBXNativeTarget "AIProxyOpenAI" */;
			buildPhases = (
				2CD964E82C1CA33B006DAD57 /* Sources */,
				2CD964E92C1CA33B006DAD57 /* Frameworks */,
				2CD964EA2C1CA33B006DAD57 /* Resources */,
			);
			buildRules = (
			);
			dependencies = (
			);
			name = AIProxyOpenAI;
			packageProductDependencies = (
				2CD965022C1CA4BB006DAD57 /* AIProxy */,
			);
			productName = AIProxyOpenAI;
			productReference = 2CD964EC2C1CA33B006DAD57 /* AIProxyOpenAI.app */;
			productType = "com.apple.product-type.application";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		2CD964E42C1CA33B006DAD57 /* Project object */ = {
			isa = PBXProject;
			attributes = {
				BuildIndependentTargetsInParallel = 1;
				LastSwiftUpdateCheck = 1540;
				LastUpgradeCheck = 1540;
				TargetAttributes = {
					2CD964EB2C1CA33B006DAD57 = {
						CreatedOnToolsVersion = 15.4;
					};
				};
			};
			buildConfigurationList = 2CD964E72C1CA33B006DAD57 /* Build configuration list for PBXProject "AIProxyOpenAI" */;
			compatibilityVersion = "Xcode 14.0";
			developmentRegion = en;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
				Base,
			);
			mainGroup = 2CD964E32C1CA33B006DAD57;
			packageReferences = (
				2CD965012C1CA4BB006DAD57 /* XCRemoteSwiftPackageReference "AIProxySwift" */,
			);
			productRefGroup = 2CD964ED2C1CA33B006DAD57 /* Products */;
			projectDirPath = "";
			projectRoot = "";
			targets = (
				2CD964EB2C1CA33B006DAD57 /* AIProxyOpenAI */,
			);
		};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
		2CD964EA2C1CA33B006DAD57 /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2CD964F72C1CA33D006DAD57 /* Preview Assets.xcassets in Resources */,
				2CD964F42C1CA33D006DAD57 /* Assets.xcassets in Resources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		2CD964E82C1CA33B006DAD57 /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2CD965052C1CA4CF006DAD57 /* AppConstants.swift in Sources */,
				2CCB20362C6C0419003A8B25 /* DalleView.swift in Sources */,
				2CD965002C1CA3F3006DAD57 /* ChatView.swift in Sources */,
				2CD964FE2C1CA3DC006DAD57 /* MultiModalChatView.swift in Sources */,
				2C16EC352CB720580016790F /* TextToSpeechView.swift in Sources */,
				2CD964F22C1CA33B006DAD57 /* ContentView.swift in Sources */,
				2CD964F02C1CA33B006DAD57 /* AIProxyOpenAIApp.swift in Sources */,
				2CCB20342C6C03AF003A8B25 /* StreamingChatView.swift in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
		2CD964F82C1CA33D006DAD57 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = dwarf;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_TESTABILITY = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 17.5;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
				MTL_FAST_MATH = YES;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = iphoneos;
				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
			};
			name = Debug;
		};
		2CD964F92C1CA33D006DAD57 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				ENABLE_NS_ASSERTIONS = NO;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 17.5;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = NO;
				MTL_FAST_MATH = YES;
				SDKROOT = iphoneos;
				SWIFT_COMPILATION_MODE = wholemodule;
				VALIDATE_PRODUCT = YES;
			};
			name = Release;
		};
		2CD964FB2C1CA33D006DAD57 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyOpenAI/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.bootstrap;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Debug;
		};
		2CD964FC2C1CA33D006DAD57 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyOpenAI/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.bootstrap;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		2CD964E72C1CA33B006DAD57 /* Build configuration list for PBXProject "AIProxyOpenAI" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2CD964F82C1CA33D006DAD57 /* Debug */,
				2CD964F92C1CA33D006DAD57 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		2CD964FA2C1CA33D006DAD57 /* Build configuration list for PBXNativeTarget "AIProxyOpenAI" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2CD964FB2C1CA33D006DAD57 /* Debug */,
				2CD964FC2C1CA33D006DAD57 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
		2CD965012C1CA4BB006DAD57 /* XCRemoteSwiftPackageReference "AIProxySwift" */ = {
			isa = XCRemoteSwiftPackageReference;
			repositoryURL = "https://github.com/lzell/AIProxySwift";
			requirement = {
				branch = main;
				kind = branch;
			};
		};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
		2CD965022C1CA4BB006DAD57 /* AIProxy */ = {
			isa = XCSwiftPackageProductDependency;
			package = 2CD965012C1CA4BB006DAD57 /* XCRemoteSwiftPackageReference "AIProxySwift" */;
			productName = AIProxy;
		};
/* End XCSwiftPackageProductDependency section */
	};
	rootObject = 2CD964E42C1CA33B006DAD57 /* Project object */;
}


================================================
FILE: AIProxyReplicate/AIProxyReplicate/AIProxyReplicateApp.swift
================================================
//
//  AIProxyReplicateApp.swift
//  AIProxyReplicate
//
//  Created by Todd Hamilton on 6/13/24.
//

import SwiftUI

@main
struct AIProxyReplicateApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}


================================================
FILE: AIProxyReplicate/AIProxyReplicate/AppConstants.swift
================================================
//
//  AppConstants.swift
//  AIProxyReplicate
//
//  Created by Todd Hamilton on 6/13/24.
//

import AIProxy

#error(
    """
    Uncomment one of the methods below. To build and run on device you must follow the AIProxy integration guide.
    Please see https://www.aiproxy.pro/docs/integration-guide.html")
    """
)

/* Uncomment for BYOK use cases */
let replicateService = AIProxy.replicateDirectService(
    unprotectedAPIKey: "your-replicate-key"
)

/* Uncomment for all other production use cases */
//let replicateService = AIProxy.replicateService(
//    partialKey: "partial-key-from-your-developer-dashboard",
//    serviceURL: "service-url-from-your-developer-dashboard"
//)


================================================
FILE: AIProxyReplicate/AIProxyReplicate/Assets.xcassets/AccentColor.colorset/Contents.json
================================================
{
  "colors" : [
    {
      "idiom" : "universal"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyReplicate/AIProxyReplicate/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
  "images" : [
    {
      "idiom" : "universal",
      "platform" : "ios",
      "size" : "1024x1024"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyReplicate/AIProxyReplicate/Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyReplicate/AIProxyReplicate/Assets.xcassets/replicate.imageset/Contents.json
================================================
{
  "images" : [
    {
      "filename" : "replicate.jpeg",
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyReplicate/AIProxyReplicate/ContentView.swift
================================================
//
//  ContentView.swift
//  AIProxyReplicate
//
//  Created by Todd Hamilton on 6/13/24.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack{
            VStack(spacing:24){
                VStack{
                    Image("replicate")
                        .resizable()
                        .scaledToFit()
                        .frame(width: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/)
                        .cornerRadius(14)
                        .foregroundColor(.primary)
                    Text("Replicate")
                        .bold()
                        .font(.largeTitle)
                    Text("AIProxy Samples")
                        .font(.subheadline)
                        .foregroundColor(.secondary)
                }
                .frame(maxWidth:.infinity,alignment:.center)
                
                VStack{
                    NavigationLink("Generate Image Example",destination: ImageGenView())
                        .bold()
                        .controlSize(.large)
                        .tint(.pink)
                        .buttonStyle(.bordered)
                }
            }
        }
    }
}

#Preview {
    ContentView()
}



================================================
FILE: AIProxyReplicate/AIProxyReplicate/ImageGenView.swift
================================================
//
//  ImageGenView.swift
//  AIProxyReplicate
//
//  Created by Todd Hamilton on 6/13/24.
//

import SwiftUI
import AIProxy

struct ImageGenView: View {
    
    @State private var prompt = ""
    @State private var imageUrl: URL?
    @State private var isLoading = false

    func generate() async throws {
        isLoading = true  // Start loading
        defer { isLoading = false }
        do {
            let input = ReplicateSDXLInputSchema(
                prompt: prompt
            )
            let output = try await replicateService.createSDXLImage(
                input: input
            )
            print("Done creating SDXL image: ", output.first ?? "")
            imageUrl = output.first
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received non-200 status code: \(statusCode) with response body: \(responseBody)")
        } catch {
            print("Could not create SDXL image: \(error.localizedDescription)")
        }
    }
    
    var body: some View {
        VStack{
                
            VStack{
                if (imageUrl != nil) {
                    AsyncImage(url: imageUrl) { phase in
                        if let image = phase.image {
                            image
                                .resizable()
                                .aspectRatio(contentMode: .fit)
                        } else if phase.error != nil {
                            Text("Failed to load image")
                                .foregroundColor(.red)
                        } else {
                            ProgressView()
                        }
                    }
                } else{
                    ContentUnavailableView(
                        "Generate an image",
                        systemImage: "photo.fill",
                        description: Text("Write a prompt below")
                    )
                }
            }
            .frame(maxHeight: .infinity)
            
            Spacer()
            
            VStack(spacing:12){
                TextField("Type a prompt", text:$prompt)
                    .submitLabel(.go)
                    .padding(12)
                    .background(.white)
                    .cornerRadius(8)
                    .shadow(radius: 1)
                    .onSubmit {
                        Task{ try await generate() }
                    }
                Button{
                    Task{ try await generate() }
                }label:{
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Generate Text")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Generate Image")
        .navigationBarTitleDisplayMode(.inline)
    }
}

#Preview {
    ImageGenView()
}


================================================
FILE: AIProxyReplicate/AIProxyReplicate/Preview Content/Preview Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyReplicate/AIProxyReplicate.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 56;
	objects = {

/* Begin PBXBuildFile section */
		2C205C532C7F62330030E7AC /* AIProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 2C205C522C7F62330030E7AC /* AIProxy */; };
		2CD964872C1B98F5006DAD57 /* AIProxyReplicateApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD964862C1B98F5006DAD57 /* AIProxyReplicateApp.swift */; };
		2CD964892C1B98F5006DAD57 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD964882C1B98F5006DAD57 /* ContentView.swift */; };
		2CD9648B2C1B98F7006DAD57 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2CD9648A2C1B98F7006DAD57 /* Assets.xcassets */; };
		2CD9648E2C1B98F7006DAD57 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2CD9648D2C1B98F7006DAD57 /* Preview Assets.xcassets */; };
		2CD9649C2C1B995F006DAD57 /* ImageGenView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD9649B2C1B995F006DAD57 /* ImageGenView.swift */; };
		2CD964E02C1BDC53006DAD57 /* AppConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2CD964DF2C1BDC53006DAD57 /* AppConstants.swift */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
		2CD964832C1B98F5006DAD57 /* AIProxyReplicate.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = AIProxyReplicate.app; sourceTree = BUILT_PRODUCTS_DIR; };
		2CD964862C1B98F5006DAD57 /* AIProxyReplicateApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AIProxyReplicateApp.swift; sourceTree = "<group>"; };
		2CD964882C1B98F5006DAD57 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
		2CD9648A2C1B98F7006DAD57 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
		2CD9648D2C1B98F7006DAD57 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
		2CD9649B2C1B995F006DAD57 /* ImageGenView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImageGenView.swift; sourceTree = "<group>"; };
		2CD964DF2C1BDC53006DAD57 /* AppConstants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppConstants.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
		2CD964802C1B98F5006DAD57 /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2C205C532C7F62330030E7AC /* AIProxy in Frameworks */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		2CD9647A2C1B98F5006DAD57 = {
			isa = PBXGroup;
			children = (
				2CD964852C1B98F5006DAD57 /* AIProxyReplicate */,
				2CD964842C1B98F5006DAD57 /* Products */,
			);
			sourceTree = "<group>";
		};
		2CD964842C1B98F5006DAD57 /* Products */ = {
			isa = PBXGroup;
			children = (
				2CD964832C1B98F5006DAD57 /* AIProxyReplicate.app */,
			);
			name = Products;
			sourceTree = "<group>";
		};
		2CD964852C1B98F5006DAD57 /* AIProxyReplicate */ = {
			isa = PBXGroup;
			children = (
				2CD964862C1B98F5006DAD57 /* AIProxyReplicateApp.swift */,
				2CD964882C1B98F5006DAD57 /* ContentView.swift */,
				2CD9649B2C1B995F006DAD57 /* ImageGenView.swift */,
				2CD964DF2C1BDC53006DAD57 /* AppConstants.swift */,
				2CD9648A2C1B98F7006DAD57 /* Assets.xcassets */,
				2CD9648C2C1B98F7006DAD57 /* Preview Content */,
			);
			path = AIProxyReplicate;
			sourceTree = "<group>";
		};
		2CD9648C2C1B98F7006DAD57 /* Preview Content */ = {
			isa = PBXGroup;
			children = (
				2CD9648D2C1B98F7006DAD57 /* Preview Assets.xcassets */,
			);
			path = "Preview Content";
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
		2CD964822C1B98F5006DAD57 /* AIProxyReplicate */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = 2CD964912C1B98F7006DAD57 /* Build configuration list for PBXNativeTarget "AIProxyReplicate" */;
			buildPhases = (
				2CD9647F2C1B98F5006DAD57 /* Sources */,
				2CD964802C1B98F5006DAD57 /* Frameworks */,
				2CD964812C1B98F5006DAD57 /* Resources */,
			);
			buildRules = (
			);
			dependencies = (
			);
			name = AIProxyReplicate;
			packageProductDependencies = (
				2C205C522C7F62330030E7AC /* AIProxy */,
			);
			productName = AIProxyReplicate;
			productReference = 2CD964832C1B98F5006DAD57 /* AIProxyReplicate.app */;
			productType = "com.apple.product-type.application";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		2CD9647B2C1B98F5006DAD57 /* Project object */ = {
			isa = PBXProject;
			attributes = {
				BuildIndependentTargetsInParallel = 1;
				LastSwiftUpdateCheck = 1540;
				LastUpgradeCheck = 1540;
				TargetAttributes = {
					2CD964822C1B98F5006DAD57 = {
						CreatedOnToolsVersion = 15.4;
					};
				};
			};
			buildConfigurationList = 2CD9647E2C1B98F5006DAD57 /* Build configuration list for PBXProject "AIProxyReplicate" */;
			compatibilityVersion = "Xcode 14.0";
			developmentRegion = en;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
				Base,
			);
			mainGroup = 2CD9647A2C1B98F5006DAD57;
			packageReferences = (
				2C205C512C7F62330030E7AC /* XCRemoteSwiftPackageReference "AIProxySwift" */,
			);
			productRefGroup = 2CD964842C1B98F5006DAD57 /* Products */;
			projectDirPath = "";
			projectRoot = "";
			targets = (
				2CD964822C1B98F5006DAD57 /* AIProxyReplicate */,
			);
		};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
		2CD964812C1B98F5006DAD57 /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2CD9648E2C1B98F7006DAD57 /* Preview Assets.xcassets in Resources */,
				2CD9648B2C1B98F7006DAD57 /* Assets.xcassets in Resources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		2CD9647F2C1B98F5006DAD57 /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				2CD964892C1B98F5006DAD57 /* ContentView.swift in Sources */,
				2CD9649C2C1B995F006DAD57 /* ImageGenView.swift in Sources */,
				2CD964E02C1BDC53006DAD57 /* AppConstants.swift in Sources */,
				2CD964872C1B98F5006DAD57 /* AIProxyReplicateApp.swift in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin XCBuildConfiguration section */
		2CD9648F2C1B98F7006DAD57 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = dwarf;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_TESTABILITY = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 17.5;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
				MTL_FAST_MATH = YES;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = iphoneos;
				SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
			};
			name = Debug;
		};
		2CD964902C1B98F7006DAD57 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++20";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_ENABLE_OBJC_WEAK = YES;
				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_COMMA = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
				CLANG_WARN_STRICT_PROTOTYPES = YES;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				ENABLE_NS_ASSERTIONS = NO;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_USER_SCRIPT_SANDBOXING = YES;
				GCC_C_LANGUAGE_STANDARD = gnu17;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 17.5;
				LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
				MTL_ENABLE_DEBUG_INFO = NO;
				MTL_FAST_MATH = YES;
				SDKROOT = iphoneos;
				SWIFT_COMPILATION_MODE = wholemodule;
				VALIDATE_PRODUCT = YES;
			};
			name = Release;
		};
		2CD964922C1B98F7006DAD57 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyReplicate/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.AIProxySampleApp;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Debug;
		};
		2CD964932C1B98F7006DAD57 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
				CODE_SIGN_STYLE = Automatic;
				CURRENT_PROJECT_VERSION = 1;
				DEVELOPMENT_ASSET_PATHS = "\"AIProxyReplicate/Preview Content\"";
				DEVELOPMENT_TEAM = 553LMX46SJ;
				ENABLE_PREVIEWS = YES;
				GENERATE_INFOPLIST_FILE = YES;
				INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
				INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
				INFOPLIST_KEY_UILaunchScreen_Generation = YES;
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
				LD_RUNPATH_SEARCH_PATHS = (
					"$(inherited)",
					"@executable_path/Frameworks",
				);
				MARKETING_VERSION = 1.0;
				PRODUCT_BUNDLE_IDENTIFIER = com.toddham.AIProxySampleApp;
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_EMIT_LOC_STRINGS = YES;
				SWIFT_VERSION = 5.0;
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		2CD9647E2C1B98F5006DAD57 /* Build configuration list for PBXProject "AIProxyReplicate" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2CD9648F2C1B98F7006DAD57 /* Debug */,
				2CD964902C1B98F7006DAD57 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		2CD964912C1B98F7006DAD57 /* Build configuration list for PBXNativeTarget "AIProxyReplicate" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				2CD964922C1B98F7006DAD57 /* Debug */,
				2CD964932C1B98F7006DAD57 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */

/* Begin XCRemoteSwiftPackageReference section */
		2C205C512C7F62330030E7AC /* XCRemoteSwiftPackageReference "AIProxySwift" */ = {
			isa = XCRemoteSwiftPackageReference;
			repositoryURL = "https://github.com/lzell/AIProxySwift";
			requirement = {
				branch = main;
				kind = branch;
			};
		};
/* End XCRemoteSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
		2C205C522C7F62330030E7AC /* AIProxy */ = {
			isa = XCSwiftPackageProductDependency;
			package = 2C205C512C7F62330030E7AC /* XCRemoteSwiftPackageReference "AIProxySwift" */;
			productName = AIProxy;
		};
/* End XCSwiftPackageProductDependency section */
	};
	rootObject = 2CD9647B2C1B98F5006DAD57 /* Project object */;
}


================================================
FILE: AIProxyStabilityAI/AIProxyStabilityAI/AIProxyStabilityAIApp.swift
================================================
//
//  AIProxyStabilityAIApp.swift
//  AIProxyStabilityAI
//
//  Created by Todd Hamilton on 8/13/24.
//

import SwiftUI

@main
struct AIProxyStabilityAIApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
    }
}


================================================
FILE: AIProxyStabilityAI/AIProxyStabilityAI/AppConstants.swift
================================================
//
//  AppConstants.swift
//  AIProxyStabilityAI
//
//  Created by Todd Hamilton on 8/13/24.
//

import AIProxy

#error(
    """
    Uncomment one of the methods below. To build and run on device you must follow the AIProxy integration guide.
    Please see https://www.aiproxy.pro/docs/integration-guide.html")
    """
)

/* Uncomment for BYOK use cases */
let stabilityService = AIProxy.stabilityAIDirectService(
    unprotectedAPIKey: "your-stability-key"
)

/* Uncomment for all other production use cases */
//let stabilityService = AIProxy.stabilityAIService(
//    partialKey: "partial-key-from-your-developer-dashboard",
//    serviceURL: "service-url-from-your-developer-dashboard"
//)


================================================
FILE: AIProxyStabilityAI/AIProxyStabilityAI/Assets.xcassets/AccentColor.colorset/Contents.json
================================================
{
  "colors" : [
    {
      "idiom" : "universal"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyStabilityAI/AIProxyStabilityAI/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
  "images" : [
    {
      "idiom" : "universal",
      "platform" : "ios",
      "size" : "1024x1024"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyStabilityAI/AIProxyStabilityAI/Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyStabilityAI/AIProxyStabilityAI/Assets.xcassets/stability.imageset/Contents.json
================================================
{
  "images" : [
    {
      "filename" : "stability.png",
      "idiom" : "universal",
      "scale" : "1x"
    },
    {
      "idiom" : "universal",
      "scale" : "2x"
    },
    {
      "idiom" : "universal",
      "scale" : "3x"
    }
  ],
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyStabilityAI/AIProxyStabilityAI/ContentView.swift
================================================
//
//  ContentView.swift
//  AIProxyStabilityAI
//
//  Created by Todd Hamilton on 8/13/24.
//

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationStack{
            
            VStack(spacing:48){
                VStack{
                    Image("stability")
                        .resizable()
                        .scaledToFit()
                        .frame(width: /*@START_MENU_TOKEN@*/100/*@END_MENU_TOKEN@*/)
                        .cornerRadius(14)
                        .foregroundColor(.primary)
                    Text("Stability.ai")
                        .bold()
                        .font(.largeTitle)
                    Text("AIProxy Sample")
                        .font(.subheadline)
                        .foregroundColor(.secondary)
                }
                .frame(maxWidth:.infinity,alignment:.center)
                
                VStack{
                    NavigationLink("Generate Image Example",destination: ImageGenView())
                        .bold()
                        .controlSize(.large)
                        .tint(.indigo)
                        .buttonStyle(.bordered)
                }
            }
        }
    }
}

#Preview {
    ContentView()
}


================================================
FILE: AIProxyStabilityAI/AIProxyStabilityAI/ImageGenView.swift
================================================
//
//  ImageGenView.swift
//  AIProxyStabilityAI
//
//  Created by Todd Hamilton on 8/13/24.
//

import SwiftUI
import AIProxy

struct ImageGenView: View {
    
    @State private var prompt = ""
    @State private var image: UIImage? = nil
    @State private var isLoading = false
    
    func generate() async throws {
        isLoading = true  // Start loading
        defer { isLoading = false }
        do {
            let body = StabilityAIUltraRequestBody(prompt: prompt)
            
            // This demo is of text-to-image, which only requires a prompt
            // To use image-to-image the following parameters are required:
            // prompt - text to generate the image from
            // image - the image to use as the starting point for the generation
            // strength - controls how much influence the image parameter has on the output image
            // mode - must be set to image-to-image
            // Learn more: https://platform.stability.ai/docs/api-reference#tag/Generate
            
            let response = try await stabilityService.ultraRequest(body: body)
            image = UIImage(data: response.imageData)
        }  catch AIProxyError.unsuccessfulRequest(let statusCode, let responseBody) {
            print("Received non-200 status code: \(statusCode) with response body: \(responseBody)")
        } catch {
            print(error.localizedDescription)
        }
    }
    
    var body: some View {
        VStack{
                
            VStack{
                if (image != nil) {
                    Image(uiImage: image!)
                        .resizable()
                        .aspectRatio(contentMode: .fit)
                        .frame(maxHeight: UIScreen.main.bounds.width)
                } else{
                    ContentUnavailableView(
                        "Generate an image",
                        systemImage: "photo.fill",
                        description: Text("Write a prompt below")
                    )
                }
            }
            .frame(maxHeight: .infinity)
            
            Spacer()
            
            VStack(spacing:12){
                TextField("Type a prompt", text:$prompt)
                    .submitLabel(.go)
                    .padding(12)
                    .background(Color(.systemBackground))
                    .cornerRadius(8)
                    .shadow(color:.primary, radius: 1)
                    .onSubmit {
                        Task{ try await generate() }
                    }
                Button{
                    Task{ try await generate() }
                }label:{
                    if isLoading {
                        ProgressView()
                            .controlSize(.regular)
                            .frame(maxWidth:.infinity)
                    } else {
                        Text("Generate Image")
                            .bold()
                            .frame(maxWidth:.infinity)
                    }
                }
                .controlSize(.large)
                .buttonStyle(.borderedProminent)
                .disabled(isLoading ? true : false)
            }
        }
        .padding()
        .navigationTitle("Generate Image")
        .navigationBarTitleDisplayMode(.inline)
    }
}

#Preview {
    ImageGenView()
}


================================================
FILE: AIProxyStabilityAI/AIProxyStabilityAI/Preview Content/Preview Assets.xcassets/Contents.json
================================================
{
  "info" : {
    "author" : "xcode",
    "version" : 1
  }
}


================================================
FILE: AIProxyStabilityAI/AIProxyStabilityAI.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 56;
	objects = {

/* Begin PBXBuildFile section */
		2C1C112D2C6BE4A9000B80E0 /* AIProxyStabilityAIApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C1C112C2C6BE4A9000B80E0 /* AIProxyStabilityAIApp.swift */; };
		2C1C112F2C6BE4A9000B80E0 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C1C112E2C6BE4A9000B80E0 /* ContentView.swift */; };
		2C1C11312C6BE4AA000B80E0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2C1C11302C6BE4AA000B80E0 /* Assets.xcassets */; };
		2C1C11342C6BE4AA000B80E0 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2C1C11332C6BE4AA000B80E0 /* Preview Assets.xcassets */; };
		2C1C113C2C6BE4D1000B80E0 /* AIProxy in Frameworks */ = {isa = PBXBuildFile; productRef = 2C1C113B2C6BE4D1000B80E0 /* AIProxy */; };
		2C1C113E2C6BE4FA000B80E0 /* AppConstants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C1C113D2C6BE4FA000B80E0 /* AppConstants.swift */; };
		2C1C11402C6BE57A000B80E0 /* ImageGenView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C1C113F2C6BE57A000B80E0 /* ImageGenView.swift */; };
/* End PBXBui
Download .txt
gitextract_weqk_mf7/

├── .gitignore
├── AIProxyAnthropic/
│   ├── AIProxyAnthropic/
│   │   ├── AIProxyAnthropicApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   ├── anthropic.imageset/
│   │   │   │   └── Contents.json
│   │   │   └── climber.imageset/
│   │   │       └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── MessageRequestView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   ├── ToolsView.swift
│   │   └── VisionView.swift
│   └── AIProxyAnthropic.xcodeproj/
│       └── project.pbxproj
├── AIProxyDeepL/
│   ├── AIProxyDeepL/
│   │   ├── AIProxyDeepLApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── deepl.imageset/
│   │   │       └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   └── TranslationView.swift
│   └── AIProxyDeepL.xcodeproj/
│       └── project.pbxproj
├── AIProxyFal/
│   ├── AIProxyFal/
│   │   ├── AIProxyFalApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── fal.imageset/
│   │   │       └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   └── TextToImageView.swift
│   └── AIProxyFal.xcodeproj/
│       └── project.pbxproj
├── AIProxyGemini/
│   ├── AIProxyGemini/
│   │   ├── AIProxyGeminiApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── icon.imageset/
│   │   │       └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   └── TextGenerationView.swift
│   └── AIProxyGemini.xcodeproj/
│       └── project.pbxproj
├── AIProxyGroq/
│   ├── AIProxyGroq/
│   │   ├── AIProxyGroqApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── groq.imageset/
│   │   │       └── Contents.json
│   │   ├── ChatView.swift
│   │   ├── ContentView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   └── StreamingChatView.swift
│   └── AIProxyGroq.xcodeproj/
│       └── project.pbxproj
├── AIProxyOpenAI/
│   ├── AIProxyOpenAI/
│   │   ├── AIProxyOpenAIApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   ├── openai.imageset/
│   │   │   │   └── Contents.json
│   │   │   └── surfer.imageset/
│   │   │       └── Contents.json
│   │   ├── ChatView.swift
│   │   ├── ContentView.swift
│   │   ├── DalleView.swift
│   │   ├── MultiModalChatView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   ├── StreamingChatView.swift
│   │   └── TextToSpeechView.swift
│   └── AIProxyOpenAI.xcodeproj/
│       └── project.pbxproj
├── AIProxyReplicate/
│   ├── AIProxyReplicate/
│   │   ├── AIProxyReplicateApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── replicate.imageset/
│   │   │       └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── ImageGenView.swift
│   │   └── Preview Content/
│   │       └── Preview Assets.xcassets/
│   │           └── Contents.json
│   └── AIProxyReplicate.xcodeproj/
│       └── project.pbxproj
├── AIProxyStabilityAI/
│   ├── AIProxyStabilityAI/
│   │   ├── AIProxyStabilityAIApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── stability.imageset/
│   │   │       └── Contents.json
│   │   ├── ContentView.swift
│   │   ├── ImageGenView.swift
│   │   └── Preview Content/
│   │       └── Preview Assets.xcassets/
│   │           └── Contents.json
│   └── AIProxyStabilityAI.xcodeproj/
│       └── project.pbxproj
├── AIProxyTogetherAI/
│   ├── AIProxyTogetherAI/
│   │   ├── AIProxyTogetherAIApp.swift
│   │   ├── AppConstants.swift
│   │   ├── Assets.xcassets/
│   │   │   ├── AccentColor.colorset/
│   │   │   │   └── Contents.json
│   │   │   ├── AppIcon.appiconset/
│   │   │   │   └── Contents.json
│   │   │   ├── Contents.json
│   │   │   └── togetherai.imageset/
│   │   │       └── Contents.json
│   │   ├── ChatView.swift
│   │   ├── ContentView.swift
│   │   ├── JSONResponseView.swift
│   │   ├── Preview Content/
│   │   │   └── Preview Assets.xcassets/
│   │   │       └── Contents.json
│   │   └── StreamingChatView.swift
│   └── AIProxyTogetherAI.xcodeproj/
│       └── project.pbxproj
├── Demos/
│   ├── AIColorPalette/
│   │   ├── AIColorPalette/
│   │   │   ├── AIColorPaletteApp.swift
│   │   │   ├── AIProxyIntegration.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── Contents.json
│   │   │   │   └── palm.imageset/
│   │   │   │       └── Contents.json
│   │   │   ├── ColorData.swift
│   │   │   ├── ColorDetailView.swift
│   │   │   ├── ContentView.swift
│   │   │   ├── Preview Content/
│   │   │   │   └── Preview Assets.xcassets/
│   │   │   │       └── Contents.json
│   │   │   ├── Ripple.metal
│   │   │   └── Ripple.swift
│   │   ├── AIColorPalette.xcodeproj/
│   │   │   └── project.pbxproj
│   │   └── README.md
│   ├── Chat/
│   │   ├── Chat/
│   │   │   ├── AppConstants.swift
│   │   │   ├── AppLogger.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── ChatApp.swift
│   │   │   ├── ChatBubble.swift
│   │   │   ├── ChatDataLoader.swift
│   │   │   ├── ChatInputView.swift
│   │   │   ├── ChatManager.swift
│   │   │   ├── ChatMessage.swift
│   │   │   ├── ChatView.swift
│   │   │   └── Preview Content/
│   │   │       └── Preview Assets.xcassets/
│   │   │           └── Contents.json
│   │   └── Chat.xcodeproj/
│   │       └── project.pbxproj
│   ├── Classifier/
│   │   ├── Classifier/
│   │   │   ├── AppConstants.swift
│   │   │   ├── AppLogger.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── CameraControlsView.swift
│   │   │   ├── CameraDataLoader.swift
│   │   │   ├── CameraFrameManager.swift
│   │   │   ├── CameraView.swift
│   │   │   ├── ClassifierApp.swift
│   │   │   ├── ClassifierDataLoader.swift
│   │   │   ├── ClassifierManager.swift
│   │   │   ├── ClassifierView.swift
│   │   │   └── Preview Content/
│   │   │       └── Preview Assets.xcassets/
│   │   │           └── Contents.json
│   │   └── Classifier.xcodeproj/
│   │       └── project.pbxproj
│   ├── EmojiPuzzleMaker/
│   │   ├── EmojiPuzzleMaker/
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── ContentView.swift
│   │   │   ├── EmojiPuzzleMakerApp.swift
│   │   │   └── Preview Content/
│   │   │       └── Preview Assets.xcassets/
│   │   │           └── Contents.json
│   │   └── EmojiPuzzleMaker.xcodeproj/
│   │       └── project.pbxproj
│   ├── FilmFinder/
│   │   ├── FilmFinder/
│   │   │   ├── AppConstants.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── ContentView.swift
│   │   │   ├── FilmFinderApp.swift
│   │   │   ├── GenreSelectorView.swift
│   │   │   ├── GetStartedTip.swift
│   │   │   ├── Info.plist
│   │   │   ├── Movie.swift
│   │   │   ├── MovieDetailsView.swift
│   │   │   ├── Preview Content/
│   │   │   │   └── Preview Assets.xcassets/
│   │   │   │       └── Contents.json
│   │   │   ├── Ripple.metal
│   │   │   └── Ripple.swift
│   │   └── FilmFinder.xcodeproj/
│   │       └── project.pbxproj
│   ├── PuLIDDemo/
│   │   ├── PuLIDDemo/
│   │   │   ├── AppConstants.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── Contents.json
│   │   │   │   └── pulid.imageset/
│   │   │   │       └── Contents.json
│   │   │   ├── ContentView.swift
│   │   │   ├── Info.plist
│   │   │   ├── Preview Content/
│   │   │   │   └── Preview Assets.xcassets/
│   │   │   │       └── Contents.json
│   │   │   ├── PuLIDDemoApp.swift
│   │   │   ├── Ripple.metal
│   │   │   └── Ripple.swift
│   │   └── PuLIDDemo.xcodeproj/
│   │       └── project.pbxproj
│   ├── Stickers/
│   │   ├── Stickers/
│   │   │   ├── AppConstants.swift
│   │   │   ├── AppLogger.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── ButtonStyles.swift
│   │   │   ├── Preview Content/
│   │   │   │   └── Preview Assets.xcassets/
│   │   │   │       └── Contents.json
│   │   │   ├── StickerDataLoader.swift
│   │   │   ├── StickerImageView.swift
│   │   │   ├── StickerInputView.swift
│   │   │   ├── StickerLoadingView.swift
│   │   │   ├── StickerManager.swift
│   │   │   ├── StickerView.swift
│   │   │   └── StickersApp.swift
│   │   └── Stickers.xcodeproj/
│   │       └── project.pbxproj
│   ├── Transcriber/
│   │   ├── Transcriber/
│   │   │   ├── AppConstants.swift
│   │   │   ├── AppLogger.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── AudioFileWriter.swift
│   │   │   ├── AudioRecorder.swift
│   │   │   ├── AudioRecording.swift
│   │   │   ├── ButtonStyles.swift
│   │   │   ├── FileUtils.swift
│   │   │   ├── MicrophoneSampleVendor.swift
│   │   │   ├── ModelContext+Extensions.swift
│   │   │   ├── NoRecordingsView.swift
│   │   │   ├── Preview Content/
│   │   │   │   └── Preview Assets.xcassets/
│   │   │   │       └── Contents.json
│   │   │   ├── RecordingRowView.swift
│   │   │   ├── TranscribedAudioRecording.swift
│   │   │   ├── TranscriberApp.swift
│   │   │   ├── TranscriberDataLoader.swift
│   │   │   ├── TranscriberManager.swift
│   │   │   └── TranscriberView.swift
│   │   └── Transcriber.xcodeproj/
│   │       └── project.pbxproj
│   ├── Translator/
│   │   ├── Translator/
│   │   │   ├── AppConstants.swift
│   │   │   ├── AppLogger.swift
│   │   │   ├── Assets.xcassets/
│   │   │   │   ├── AccentColor.colorset/
│   │   │   │   │   └── Contents.json
│   │   │   │   ├── AppIcon.appiconset/
│   │   │   │   │   └── Contents.json
│   │   │   │   └── Contents.json
│   │   │   ├── BottomTranslateView.swift
│   │   │   ├── ButtonStyles.swift
│   │   │   ├── Preview Content/
│   │   │   │   └── Preview Assets.xcassets/
│   │   │   │       └── Contents.json
│   │   │   ├── TopTranslateView.swift
│   │   │   ├── TranslateView.swift
│   │   │   ├── TranslationDataLoader.swift
│   │   │   └── TranslatorApp.swift
│   │   └── Translator.xcodeproj/
│   │       └── project.pbxproj
│   └── Trivia/
│       ├── Trivia/
│       │   ├── AppConstants.swift
│       │   ├── AppLogger.swift
│       │   ├── Assets.xcassets/
│       │   │   ├── AccentColor.colorset/
│       │   │   │   └── Contents.json
│       │   │   ├── AppIcon.appiconset/
│       │   │   │   └── Contents.json
│       │   │   └── Contents.json
│       │   ├── Preview Content/
│       │   │   └── Preview Assets.xcassets/
│       │   │       └── Contents.json
│       │   ├── TriviaAnswerPicker.swift
│       │   ├── TriviaApp.swift
│       │   ├── TriviaCardData.swift
│       │   ├── TriviaCardView.swift
│       │   ├── TriviaDataLoader.swift
│       │   ├── TriviaFormView.swift
│       │   ├── TriviaManager.swift
│       │   └── TriviaView.swift
│       └── Trivia.xcodeproj/
│           └── project.pbxproj
└── README.md
Condensed preview — 244 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (670K chars).
[
  {
    "path": ".gitignore",
    "chars": 2244,
    "preview": ".DS_Store\n*.swp\ntags\nxcshareddata\nproject.xcworkspace\n.ackrc\n*.codekit3\n\n# Xcode\n#\n# gitignore contributors: remember to"
  },
  {
    "path": "AIProxyAnthropic/AIProxyAnthropic/AIProxyAnthropicApp.swift",
    "chars": 251,
    "preview": "//\n//  AIProxyAnthropicApp.swift\n//  AIProxyAnthropic\n//\n//  Created by Todd Hamilton on 6/17/24.\n//\n\nimport SwiftUI\n\n@m"
  },
  {
    "path": "AIProxyAnthropic/AIProxyAnthropic/AppConstants.swift",
    "chars": 689,
    "preview": "//\n//  AppConstants.swift\n//  AIProxyAnthropic\n//\n//  Created by Todd Hamilton on 8/14/24.\n//\n\nimport AIProxy\n\n#error(\n "
  },
  {
    "path": "AIProxyAnthropic/AIProxyAnthropic/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "AIProxyAnthropic/AIProxyAnthropic/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 177,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"i"
  },
  {
    "path": "AIProxyAnthropic/AIProxyAnthropic/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyAnthropic/AIProxyAnthropic/Assets.xcassets/anthropic.imageset/Contents.json",
    "chars": 308,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"anthropic.jpeg\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n   "
  },
  {
    "path": "AIProxyAnthropic/AIProxyAnthropic/Assets.xcassets/climber.imageset/Contents.json",
    "chars": 305,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"climber.jpg\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n"
  },
  {
    "path": "AIProxyAnthropic/AIProxyAnthropic/ContentView.swift",
    "chars": 1746,
    "preview": "//\n//  ContentView.swift\n//  AIProxyAnthropic\n//\n//  Created by Todd Hamilton on 6/17/24.\n//\n\nimport SwiftUI\n\nstruct Con"
  },
  {
    "path": "AIProxyAnthropic/AIProxyAnthropic/MessageRequestView.swift",
    "chars": 3301,
    "preview": "//\n//  MessageRequestView.swift\n//  AIProxyAnthropic\n//\n//  Created by Todd Hamilton on 8/14/24.\n//\n\nimport SwiftUI\nimpo"
  },
  {
    "path": "AIProxyAnthropic/AIProxyAnthropic/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyAnthropic/AIProxyAnthropic/ToolsView.swift",
    "chars": 4139,
    "preview": "//\n//  ToolsView.swift\n//  AIProxyAnthropic\n//\n//  Created by Todd Hamilton on 8/14/24.\n//\n\nimport SwiftUI\nimport AIProx"
  },
  {
    "path": "AIProxyAnthropic/AIProxyAnthropic/VisionView.swift",
    "chars": 3485,
    "preview": "//\n//  VisionView.swift\n//  AIProxyAnthropic\n//\n//  Created by Todd Hamilton on 8/14/24.\n//\n\nimport SwiftUI\nimport AIPro"
  },
  {
    "path": "AIProxyAnthropic/AIProxyAnthropic.xcodeproj/project.pbxproj",
    "chars": 16380,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "AIProxyDeepL/AIProxyDeepL/AIProxyDeepLApp.swift",
    "chars": 239,
    "preview": "//\n//  AIProxyDeepLApp.swift\n//  AIProxyDeepL\n//\n//  Created by Todd Hamilton on 8/14/24.\n//\n\nimport SwiftUI\n\n@main\nstru"
  },
  {
    "path": "AIProxyDeepL/AIProxyDeepL/AppConstants.swift",
    "chars": 689,
    "preview": "//\n//  AppConstants.swift\n//  AIProxyDeepL\n//\n//  Created by Todd Hamilton on 8/14/24.\n//\n\nimport AIProxy\n\n#error(\n    \""
  },
  {
    "path": "AIProxyDeepL/AIProxyDeepL/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "AIProxyDeepL/AIProxyDeepL/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 177,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"i"
  },
  {
    "path": "AIProxyDeepL/AIProxyDeepL/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyDeepL/AIProxyDeepL/Assets.xcassets/deepl.imageset/Contents.json",
    "chars": 303,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"deepl.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n  "
  },
  {
    "path": "AIProxyDeepL/AIProxyDeepL/ContentView.swift",
    "chars": 1265,
    "preview": "//\n//  ContentView.swift\n//  AIProxyDeepL\n//\n//  Created by Todd Hamilton on 8/14/24.\n//\n\nimport SwiftUI\n\nstruct Content"
  },
  {
    "path": "AIProxyDeepL/AIProxyDeepL/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyDeepL/AIProxyDeepL/TranslationView.swift",
    "chars": 2871,
    "preview": "//\n//  TranslationView.swift\n//  AIProxyDeepL\n//\n//  Created by Todd Hamilton on 8/14/24.\n//\n\nimport SwiftUI\nimport AIPr"
  },
  {
    "path": "AIProxyDeepL/AIProxyDeepL.xcodeproj/project.pbxproj",
    "chars": 15416,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "AIProxyFal/AIProxyFal/AIProxyFalApp.swift",
    "chars": 233,
    "preview": "//\n//  AIProxyFalApp.swift\n//  AIProxyFal\n//\n//  Created by Todd Hamilton on 6/13/24.\n//\n\nimport SwiftUI\n\n@main\nstruct A"
  },
  {
    "path": "AIProxyFal/AIProxyFal/AppConstants.swift",
    "chars": 653,
    "preview": "//\n//  AppConstants.swift\n//  AIProxyFal\n//\n//  Created by Todd Hamilton on 9/17/24.\n//\n\nimport AIProxy\n\n#error(\n    \"\"\""
  },
  {
    "path": "AIProxyFal/AIProxyFal/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "AIProxyFal/AIProxyFal/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 177,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"i"
  },
  {
    "path": "AIProxyFal/AIProxyFal/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyFal/AIProxyFal/Assets.xcassets/fal.imageset/Contents.json",
    "chars": 301,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"fal.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n    "
  },
  {
    "path": "AIProxyFal/AIProxyFal/ContentView.swift",
    "chars": 1248,
    "preview": "//\n//  ContentView.swift\n//  AIProxyFal\n//\n//  Created by Todd Hamilton on 6/13/24.\n//\n\nimport SwiftUI\n\nstruct ContentVi"
  },
  {
    "path": "AIProxyFal/AIProxyFal/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyFal/AIProxyFal/TextToImageView.swift",
    "chars": 3511,
    "preview": "//\n//  ImageGenView.swift\n//  AIProxyFal\n//\n//  Created by Todd Hamilton on 6/13/24.\n//\n\nimport SwiftUI\nimport AIProxy\n\n"
  },
  {
    "path": "AIProxyFal/AIProxyFal.xcodeproj/project.pbxproj",
    "chars": 16066,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "AIProxyGemini/AIProxyGemini/AIProxyGeminiApp.swift",
    "chars": 243,
    "preview": "//\n//  AIProxyGeminiApp.swift\n//  AIProxyGemini\n//\n//  Created by Todd Hamilton on 10/18/24.\n//\n\nimport SwiftUI\n\n@main\ns"
  },
  {
    "path": "AIProxyGemini/AIProxyGemini/AppConstants.swift",
    "chars": 672,
    "preview": "//\n//  AppConstants.swift\n//  AIProxyGemini\n//\n//  Created by Todd Hamilton on 10/18/24.\n//\n\nimport AIProxy\n\n#error(\n   "
  },
  {
    "path": "AIProxyGemini/AIProxyGemini/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "AIProxyGemini/AIProxyGemini/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 607,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    },\n    {\n  "
  },
  {
    "path": "AIProxyGemini/AIProxyGemini/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyGemini/AIProxyGemini/Assets.xcassets/icon.imageset/Contents.json",
    "chars": 304,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"gemini.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n "
  },
  {
    "path": "AIProxyGemini/AIProxyGemini/ContentView.swift",
    "chars": 1200,
    "preview": "//\n//  ContentView.swift\n//  AIProxyGemini\n//\n//  Created by Todd Hamilton on 10/18/24.\n//\n\nimport SwiftUI\n\nstruct Conte"
  },
  {
    "path": "AIProxyGemini/AIProxyGemini/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyGemini/AIProxyGemini/TextGenerationView.swift",
    "chars": 3677,
    "preview": "//\n//  TextGenerationView.swift\n//  AIProxyGemini\n//\n//  Created by Todd Hamilton on 10/18/24.\n//\n\nimport SwiftUI\nimport"
  },
  {
    "path": "AIProxyGemini/AIProxyGemini.xcodeproj/project.pbxproj",
    "chars": 12747,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 77;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "AIProxyGroq/AIProxyGroq/AIProxyGroqApp.swift",
    "chars": 236,
    "preview": "//\n//  AIProxyGroqApp.swift\n//  AIProxyGroq\n//\n//  Created by Todd Hamilton on 10/1/24.\n//\n\nimport SwiftUI\n\n@main\nstruct"
  },
  {
    "path": "AIProxyGroq/AIProxyGroq/AppConstants.swift",
    "chars": 659,
    "preview": "//\n//  AppConstants.swift\n//  AIProxyGroq\n//\n//  Created by Todd Hamilton on 10/1/24.\n//\n\nimport AIProxy\n\n#error(\n    \"\""
  },
  {
    "path": "AIProxyGroq/AIProxyGroq/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "AIProxyGroq/AIProxyGroq/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 607,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    },\n    {\n  "
  },
  {
    "path": "AIProxyGroq/AIProxyGroq/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyGroq/AIProxyGroq/Assets.xcassets/groq.imageset/Contents.json",
    "chars": 302,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"groq.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n   "
  },
  {
    "path": "AIProxyGroq/AIProxyGroq/ChatView.swift",
    "chars": 2836,
    "preview": "//\n//  ChatView.swift\n//  AIProxyGroq\n//\n//  Created by Todd Hamilton on 10/1/24.\n//\n\nimport SwiftUI\nimport AIProxy\n\nstr"
  },
  {
    "path": "AIProxyGroq/AIProxyGroq/ContentView.swift",
    "chars": 1281,
    "preview": "//\n//  ContentView.swift\n//  AIProxyGroq\n//\n//  Created by Todd Hamilton on 10/1/24.\n//\n\nimport SwiftUI\n\nstruct ContentV"
  },
  {
    "path": "AIProxyGroq/AIProxyGroq/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyGroq/AIProxyGroq/StreamingChatView.swift",
    "chars": 2974,
    "preview": "//\n//  StreamingChatView.swift\n//  AIProxyGroq\n//\n//  Created by Todd Hamilton on 10/1/24.\n//\n\n\nimport SwiftUI\nimport AI"
  },
  {
    "path": "AIProxyGroq/AIProxyGroq.xcodeproj/project.pbxproj",
    "chars": 12711,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 77;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/AIProxyOpenAIApp.swift",
    "chars": 242,
    "preview": "//\n//  AIProxyOpenAIApp.swift\n//  AIProxyOpenAI\n//\n//  Created by Todd Hamilton on 6/14/24.\n//\n\nimport SwiftUI\n\n@main\nst"
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/AppConstants.swift",
    "chars": 671,
    "preview": "//\n//  AppConstants.swift\n//  AIProxyOpenAI\n//\n//  Created by Todd Hamilton on 6/14/24.\n//\n\nimport AIProxy\n\n#error(\n    "
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 177,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"i"
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/Assets.xcassets/openai.imageset/Contents.json",
    "chars": 304,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"openai.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n "
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/Assets.xcassets/surfer.imageset/Contents.json",
    "chars": 305,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"surfer.jpeg\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n"
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/ChatView.swift",
    "chars": 2783,
    "preview": "//\n//  ChatView.swift\n//  AIProxyOpenAI\n//\n//  Created by Todd Hamilton on 6/14/24.\n//\n\nimport SwiftUI\nimport AIProxy\n\ns"
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/ContentView.swift",
    "chars": 1555,
    "preview": "//\n//  ContentView.swift\n//  AIProxyOpenAI\n//\n//  Created by Todd Hamilton on 6/14/24.\n//\n\nimport SwiftUI\n\nstruct Conten"
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/DalleView.swift",
    "chars": 3281,
    "preview": "//\n//  DalleView.swift\n//  AIProxyOpenAI\n//\n//  Created by Todd Hamilton on 8/13/24.\n//\n\nimport SwiftUI\nimport AIProxy\n\n"
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/MultiModalChatView.swift",
    "chars": 3756,
    "preview": "//\n//  MultiModalChatView.swift\n//  AIProxyOpenAI\n//\n//  Created by Todd Hamilton on 6/14/24.\n//\n\nimport SwiftUI\nimport "
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/StreamingChatView.swift",
    "chars": 2977,
    "preview": "//\n//  StreamingChatView.swift\n//  AIProxyOpenAI\n//\n//  Created by Todd Hamilton on 8/13/24.\n//\n\nimport SwiftUI\nimport A"
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI/TextToSpeechView.swift",
    "chars": 3784,
    "preview": "//\n//  TextToSpeechView.swift\n//  AIProxyOpenAI\n//\n//  Created by Todd Hamilton on 10/9/24.\n//\n\nimport SwiftUI\nimport AI"
  },
  {
    "path": "AIProxyOpenAI/AIProxyOpenAI.xcodeproj/project.pbxproj",
    "chars": 17223,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "AIProxyReplicate/AIProxyReplicate/AIProxyReplicateApp.swift",
    "chars": 251,
    "preview": "//\n//  AIProxyReplicateApp.swift\n//  AIProxyReplicate\n//\n//  Created by Todd Hamilton on 6/13/24.\n//\n\nimport SwiftUI\n\n@m"
  },
  {
    "path": "AIProxyReplicate/AIProxyReplicate/AppConstants.swift",
    "chars": 689,
    "preview": "//\n//  AppConstants.swift\n//  AIProxyReplicate\n//\n//  Created by Todd Hamilton on 6/13/24.\n//\n\nimport AIProxy\n\n#error(\n "
  },
  {
    "path": "AIProxyReplicate/AIProxyReplicate/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "AIProxyReplicate/AIProxyReplicate/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 177,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"i"
  },
  {
    "path": "AIProxyReplicate/AIProxyReplicate/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyReplicate/AIProxyReplicate/Assets.xcassets/replicate.imageset/Contents.json",
    "chars": 308,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"replicate.jpeg\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n   "
  },
  {
    "path": "AIProxyReplicate/AIProxyReplicate/ContentView.swift",
    "chars": 1245,
    "preview": "//\n//  ContentView.swift\n//  AIProxyReplicate\n//\n//  Created by Todd Hamilton on 6/13/24.\n//\n\nimport SwiftUI\n\nstruct Con"
  },
  {
    "path": "AIProxyReplicate/AIProxyReplicate/ImageGenView.swift",
    "chars": 3232,
    "preview": "//\n//  ImageGenView.swift\n//  AIProxyReplicate\n//\n//  Created by Todd Hamilton on 6/13/24.\n//\n\nimport SwiftUI\nimport AIP"
  },
  {
    "path": "AIProxyReplicate/AIProxyReplicate/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyReplicate/AIProxyReplicate.xcodeproj/project.pbxproj",
    "chars": 15490,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "AIProxyStabilityAI/AIProxyStabilityAI/AIProxyStabilityAIApp.swift",
    "chars": 257,
    "preview": "//\n//  AIProxyStabilityAIApp.swift\n//  AIProxyStabilityAI\n//\n//  Created by Todd Hamilton on 8/13/24.\n//\n\nimport SwiftUI"
  },
  {
    "path": "AIProxyStabilityAI/AIProxyStabilityAI/AppConstants.swift",
    "chars": 695,
    "preview": "//\n//  AppConstants.swift\n//  AIProxyStabilityAI\n//\n//  Created by Todd Hamilton on 8/13/24.\n//\n\nimport AIProxy\n\n#error("
  },
  {
    "path": "AIProxyStabilityAI/AIProxyStabilityAI/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "AIProxyStabilityAI/AIProxyStabilityAI/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 177,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"i"
  },
  {
    "path": "AIProxyStabilityAI/AIProxyStabilityAI/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyStabilityAI/AIProxyStabilityAI/Assets.xcassets/stability.imageset/Contents.json",
    "chars": 307,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"stability.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    "
  },
  {
    "path": "AIProxyStabilityAI/AIProxyStabilityAI/ContentView.swift",
    "chars": 1263,
    "preview": "//\n//  ContentView.swift\n//  AIProxyStabilityAI\n//\n//  Created by Todd Hamilton on 8/13/24.\n//\n\nimport SwiftUI\n\nstruct C"
  },
  {
    "path": "AIProxyStabilityAI/AIProxyStabilityAI/ImageGenView.swift",
    "chars": 3347,
    "preview": "//\n//  ImageGenView.swift\n//  AIProxyStabilityAI\n//\n//  Created by Todd Hamilton on 8/13/24.\n//\n\nimport SwiftUI\nimport A"
  },
  {
    "path": "AIProxyStabilityAI/AIProxyStabilityAI/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyStabilityAI/AIProxyStabilityAI.xcodeproj/project.pbxproj",
    "chars": 15536,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "AIProxyTogetherAI/AIProxyTogetherAI/AIProxyTogetherAIApp.swift",
    "chars": 254,
    "preview": "//\n//  AIProxyTogetherAIApp.swift\n//  AIProxyTogetherAI\n//\n//  Created by Todd Hamilton on 8/18/24.\n//\n\nimport SwiftUI\n\n"
  },
  {
    "path": "AIProxyTogetherAI/AIProxyTogetherAI/AppConstants.swift",
    "chars": 695,
    "preview": "//\n//  AppConstants.swift\n//  AIProxyTogetherAI\n//\n//  Created by Todd Hamilton on 8/18/24.\n//\n\nimport AIProxy\n\n#error(\n"
  },
  {
    "path": "AIProxyTogetherAI/AIProxyTogetherAI/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "AIProxyTogetherAI/AIProxyTogetherAI/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 177,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"i"
  },
  {
    "path": "AIProxyTogetherAI/AIProxyTogetherAI/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyTogetherAI/AIProxyTogetherAI/Assets.xcassets/togetherai.imageset/Contents.json",
    "chars": 308,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"togetherai.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n   "
  },
  {
    "path": "AIProxyTogetherAI/AIProxyTogetherAI/ChatView.swift",
    "chars": 2977,
    "preview": "//\n//  ChatView.swift\n//  AIProxyTogetherAI\n//\n//  Created by Todd Hamilton on 8/18/24.\n//\n\nimport SwiftUI\nimport AIProx"
  },
  {
    "path": "AIProxyTogetherAI/AIProxyTogetherAI/ContentView.swift",
    "chars": 1769,
    "preview": "//\n//  ContentView.swift\n//  AIProxyTogetherAI\n//\n//  Created by Todd Hamilton on 8/18/24.\n//\n\nimport SwiftUI\n\nstruct Co"
  },
  {
    "path": "AIProxyTogetherAI/AIProxyTogetherAI/JSONResponseView.swift",
    "chars": 4258,
    "preview": "//\n//  JSONResponseView.swift\n//  AIProxyTogetherAI\n//\n//  Created by Todd Hamilton on 8/18/24.\n//\n\nimport SwiftUI\nimpor"
  },
  {
    "path": "AIProxyTogetherAI/AIProxyTogetherAI/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "AIProxyTogetherAI/AIProxyTogetherAI/StreamingChatView.swift",
    "chars": 3065,
    "preview": "//\n//  StreamingChatView.swift\n//  AIProxyTogetherAI\n//\n//  Created by Todd Hamilton on 8/18/24.\n//\n\nimport SwiftUI\nimpo"
  },
  {
    "path": "AIProxyTogetherAI/AIProxyTogetherAI.xcodeproj/project.pbxproj",
    "chars": 16429,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "Demos/AIColorPalette/AIColorPalette/AIColorPaletteApp.swift",
    "chars": 245,
    "preview": "//\n//  AIColorPaletteApp.swift\n//  AIColorPalette\n//\n//  Created by Todd Hamilton on 6/20/24.\n//\n\nimport SwiftUI\n\n@main\n"
  },
  {
    "path": "Demos/AIColorPalette/AIColorPalette/AIProxyIntegration.swift",
    "chars": 2843,
    "preview": "//\n//  AIProxyIntegration.swift\n//  AIColorPalette\n//\n//  Created by Todd Hamilton on 6/20/24.\n//\n\nimport AIProxy // The"
  },
  {
    "path": "Demos/AIColorPalette/AIColorPalette/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "Demos/AIColorPalette/AIColorPalette/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 177,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"i"
  },
  {
    "path": "Demos/AIColorPalette/AIColorPalette/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/AIColorPalette/AIColorPalette/Assets.xcassets/palm.imageset/Contents.json",
    "chars": 302,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"palm.jpg\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n   "
  },
  {
    "path": "Demos/AIColorPalette/AIColorPalette/ColorData.swift",
    "chars": 399,
    "preview": "//\n//  ColorData.swift\n//  AIColorPalette\n//\n//  Created by Todd Hamilton on 6/21/24.\n//\n\nimport SwiftUI\n\n// Define the "
  },
  {
    "path": "Demos/AIColorPalette/AIColorPalette/ColorDetailView.swift",
    "chars": 3691,
    "preview": "//\n//  ColorDetailView.swift\n//  AIColorPalette\n//\n//  Created by Todd Hamilton on 6/22/24.\n//\n\nimport SwiftUI\n\nstruct C"
  },
  {
    "path": "Demos/AIColorPalette/AIColorPalette/ContentView.swift",
    "chars": 5564,
    "preview": "//\n//  ContentView.swift\n//  AIColorPalette\n//\n//  Created by Todd Hamilton on 6/20/24.\n//\n\nimport SwiftUI\nimport Photos"
  },
  {
    "path": "Demos/AIColorPalette/AIColorPalette/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/AIColorPalette/AIColorPalette/Ripple.metal",
    "chars": 1547,
    "preview": "//\n//  Ripple.metal\n//  AIColorPalette\n//\n//  Created by Todd Hamilton on 6/21/24.\n//\n\n// Insert #include <metal_stdlib>"
  },
  {
    "path": "Demos/AIColorPalette/AIColorPalette/Ripple.swift",
    "chars": 4459,
    "preview": "//\n//  Ripple.swift\n//  AIColorPalette\n//\n//  Created by Todd Hamilton on 6/21/24.\n//\n\nimport SwiftUI\n\nstruct PushEffect"
  },
  {
    "path": "Demos/AIColorPalette/AIColorPalette.xcodeproj/project.pbxproj",
    "chars": 17366,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "Demos/AIColorPalette/README.md",
    "chars": 1161,
    "preview": "## Example projects\n\n### AIColorPalette\n\n#### About\n\nAIColorPalette generates a color palette from a photo in your camer"
  },
  {
    "path": "Demos/Chat/Chat/AppConstants.swift",
    "chars": 757,
    "preview": "//\n//  AppConstants.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport AIProxy\n\nenum AppConstants {\n    #e"
  },
  {
    "path": "Demos/Chat/Chat/AppLogger.swift",
    "chars": 635,
    "preview": "//\n//  AppLogger.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport OSLog\n\n/// Log level"
  },
  {
    "path": "Demos/Chat/Chat/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "Demos/Chat/Chat/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 208,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"chat.png\",\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size"
  },
  {
    "path": "Demos/Chat/Chat/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/Chat/Chat/ChatApp.swift",
    "chars": 283,
    "preview": "//\n//  ChatApp.swift\n//  Chat\n//\n//  Created by Lou Zell\n//\n\nimport SwiftUI\n\n@main\n@MainActor\nstruct ChatApp: App {\n\n   "
  },
  {
    "path": "Demos/Chat/Chat/ChatBubble.swift",
    "chars": 2324,
    "preview": "//\n//  ChatBubbleView.swift\n//  AIProxyBootstrap\n//\n//  Created by Todd Hamilton\n//\n\nimport SwiftUI\n\n/// A view to conta"
  },
  {
    "path": "Demos/Chat/Chat/ChatDataLoader.swift",
    "chars": 2717,
    "preview": "//\n//  ChatDataLoader.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport AIProxy\n\nenum C"
  },
  {
    "path": "Demos/Chat/Chat/ChatInputView.swift",
    "chars": 2261,
    "preview": "//\n//  ChatInputView.swift\n//  AIProxyBootstrap\n//\n//  Created by Todd Hamilton\n//\n\nimport SwiftUI\n\n/// A view for the u"
  },
  {
    "path": "Demos/Chat/Chat/ChatManager.swift",
    "chars": 1852,
    "preview": "//\n//  ChatManager.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport SwiftUI\n\n@MainActo"
  },
  {
    "path": "Demos/Chat/Chat/ChatMessage.swift",
    "chars": 529,
    "preview": "//\n//  ChatMessage.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\n\n/// Data model to repres"
  },
  {
    "path": "Demos/Chat/Chat/ChatView.swift",
    "chars": 6041,
    "preview": "//\n//  ChatView.swift\n//  AIProxyBootstrap\n//\n//  Created by Todd Hamilton\n//\n\nimport SwiftUI\n\n@MainActor\nstruct ChatVie"
  },
  {
    "path": "Demos/Chat/Chat/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/Chat/Chat.xcodeproj/project.pbxproj",
    "chars": 17696,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "Demos/Classifier/Classifier/AppConstants.swift",
    "chars": 898,
    "preview": "//\n//  AppConstants.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport SwiftData\nimport "
  },
  {
    "path": "Demos/Classifier/Classifier/AppLogger.swift",
    "chars": 641,
    "preview": "//\n//  AppLogger.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport OSLog\n\n/// Log level"
  },
  {
    "path": "Demos/Classifier/Classifier/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "Demos/Classifier/Classifier/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 212,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"classify.png\",\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \""
  },
  {
    "path": "Demos/Classifier/Classifier/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/Classifier/Classifier/CameraControlsView.swift",
    "chars": 863,
    "preview": "//\n//  CameraControlsView.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport SwiftUI\n\nst"
  },
  {
    "path": "Demos/Classifier/Classifier/CameraDataLoader.swift",
    "chars": 2830,
    "preview": "//\n//  CameraFrameHandler.swift\n//  AIProxyBootstrap\n//\n//  Created by Todd Hamilton\n//\n\nimport AVFoundation\nimport Core"
  },
  {
    "path": "Demos/Classifier/Classifier/CameraFrameManager.swift",
    "chars": 1211,
    "preview": "//\n//  CameraFrameManager.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport AVFoundation\nimport Foundatio"
  },
  {
    "path": "Demos/Classifier/Classifier/CameraView.swift",
    "chars": 1008,
    "preview": "//\n//  CameraView.swift\n//  AIProxyBootstrap\n//\n//  Created by Todd Hamilton\n//\n\nimport SwiftUI\n\nstruct CameraView: View"
  },
  {
    "path": "Demos/Classifier/Classifier/ClassifierApp.swift",
    "chars": 463,
    "preview": "//\n//  ClassifierApp.swift\n//  Classifier\n//\n//  Created by Lou Zell\n//\n\nimport SwiftUI\n\n@main\n@MainActor\nstruct Classif"
  },
  {
    "path": "Demos/Classifier/Classifier/ClassifierDataLoader.swift",
    "chars": 2442,
    "preview": "//\n//  ClassifierDataLoader.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport UIKit\nimp"
  },
  {
    "path": "Demos/Classifier/Classifier/ClassifierManager.swift",
    "chars": 1241,
    "preview": "//\n//  ClassifierManager.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport SwiftUI\n\n@MainActor\n@Observabl"
  },
  {
    "path": "Demos/Classifier/Classifier/ClassifierView.swift",
    "chars": 4134,
    "preview": "//\n//  ClassifierView.swift\n//  AIProxyBootstrap\n//\n//  Created by Todd Hamilton\n//\n\nimport SwiftUI\n\n@MainActor\nstruct C"
  },
  {
    "path": "Demos/Classifier/Classifier/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/Classifier/Classifier.xcodeproj/project.pbxproj",
    "chars": 18732,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "Demos/EmojiPuzzleMaker/EmojiPuzzleMaker/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "Demos/EmojiPuzzleMaker/EmojiPuzzleMaker/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 177,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    }\n  ],\n  \"i"
  },
  {
    "path": "Demos/EmojiPuzzleMaker/EmojiPuzzleMaker/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/EmojiPuzzleMaker/EmojiPuzzleMaker/ContentView.swift",
    "chars": 7871,
    "preview": "//\n//  ContentView.swift\n//  EmojiPuzzleMaker\n//\n//  Created by Todd Hamilton on 8/1/24.\n//\n\nimport AIProxy\nimport Swift"
  },
  {
    "path": "Demos/EmojiPuzzleMaker/EmojiPuzzleMaker/EmojiPuzzleMakerApp.swift",
    "chars": 250,
    "preview": "//\n//  EmojiPuzzleMakerApp.swift\n//  EmojiPuzzleMaker\n//\n//  Created by Todd Hamilton on 8/1/24.\n//\n\nimport SwiftUI\n\n@ma"
  },
  {
    "path": "Demos/EmojiPuzzleMaker/EmojiPuzzleMaker/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/EmojiPuzzleMaker/EmojiPuzzleMaker.xcodeproj/project.pbxproj",
    "chars": 14606,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/AppConstants.swift",
    "chars": 828,
    "preview": "//\n//  AppConstants.swift\n//  FilmFinder\n//\n//  Created by Todd Hamilton on 11/4/24.\n//\n\nimport AIProxy\n\n#error(\n    \"\"\""
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 638,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"icon.png\",\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size"
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/ContentView.swift",
    "chars": 8648,
    "preview": "//\n//  ContentView.swift\n//  FilmFinder\n//\n//  Created by Todd Hamilton on 10/28/24.\n//\n\nimport Foundation\nimport SwiftU"
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/FilmFinderApp.swift",
    "chars": 370,
    "preview": "//\n//  FilmFinderApp.swift\n//  FilmFinder\n//\n//  Created by Todd Hamilton on 10/30/24.\n//\n\nimport SwiftUI\nimport TipKit\n"
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/GenreSelectorView.swift",
    "chars": 11686,
    "preview": "//\n//  GenreSelectorView.swift\n//  FilmFinder\n//\n//  Created by Todd Hamilton on 11/3/24.\n//\n\nimport SwiftUI\nimport TipK"
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/GetStartedTip.swift",
    "chars": 335,
    "preview": "//\n//  GetStartedTip.swift\n//  FilmFinder\n//\n//  Created by Todd Hamilton on 10/31/24.\n//\n\nimport SwiftUI\nimport TipKit\n"
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/Info.plist",
    "chars": 181,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/Movie.swift",
    "chars": 1428,
    "preview": "//\n//  Movie.swift\n//  FilmFinder\n//\n//  Created by Todd Hamilton on 10/29/24.\n//\n\nimport Foundation\n\nstruct Recommendat"
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/MovieDetailsView.swift",
    "chars": 4294,
    "preview": "//\n//  MovieDetailsView.swift\n//  MovieMoods\n//\n//  Created by Todd Hamilton on 10/29/24.\n//\n\nimport SwiftUI\n\nstruct Mov"
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/Ripple.metal",
    "chars": 1543,
    "preview": "//\n//  Ripple.metal\n//  FilmFinder\n//\n//  Created by Todd Hamilton on 6/21/24.\n//\n\n// Insert #include <metal_stdlib>\n#in"
  },
  {
    "path": "Demos/FilmFinder/FilmFinder/Ripple.swift",
    "chars": 4455,
    "preview": "//\n//  Ripple.swift\n//  FilmFinder\n//\n//  Created by Todd Hamilton on 6/21/24.\n//\n\nimport SwiftUI\n\nstruct PushEffect<T: "
  },
  {
    "path": "Demos/FilmFinder/FilmFinder.xcodeproj/project.pbxproj",
    "chars": 13358,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 77;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "Demos/PuLIDDemo/PuLIDDemo/AppConstants.swift",
    "chars": 682,
    "preview": "//\n//  AppConstants.swift\n//  PuLIDDemo\n//\n//  Created by Todd Hamilton on 9/28/24.\n//\n\nimport AIProxy\n\n#error(\n    \"\"\"\n"
  },
  {
    "path": "Demos/PuLIDDemo/PuLIDDemo/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "Demos/PuLIDDemo/PuLIDDemo/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 607,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"size\" : \"1024x1024\"\n    },\n    {\n  "
  },
  {
    "path": "Demos/PuLIDDemo/PuLIDDemo/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/PuLIDDemo/PuLIDDemo/Assets.xcassets/pulid.imageset/Contents.json",
    "chars": 303,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"pulid.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n  "
  },
  {
    "path": "Demos/PuLIDDemo/PuLIDDemo/ContentView.swift",
    "chars": 7447,
    "preview": "//\n//  ContentView.swift\n//  PuLIDDemo\n//\n//  Created by Todd Hamilton on 9/26/24.\n//\n\nimport SwiftUI\nimport AIProxy\nimp"
  },
  {
    "path": "Demos/PuLIDDemo/PuLIDDemo/Info.plist",
    "chars": 181,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "Demos/PuLIDDemo/PuLIDDemo/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/PuLIDDemo/PuLIDDemo/PuLIDDemoApp.swift",
    "chars": 230,
    "preview": "//\n//  PuLIDDemoApp.swift\n//  PuLIDDemo\n//\n//  Created by Todd Hamilton on 9/26/24.\n//\n\nimport SwiftUI\n\n@main\nstruct PuL"
  },
  {
    "path": "Demos/PuLIDDemo/PuLIDDemo/Ripple.metal",
    "chars": 1547,
    "preview": "//\n//  Ripple.metal\n//  AIColorPalette\n//\n//  Created by Todd Hamilton on 6/21/24.\n//\n\n// Insert #include <metal_stdlib>"
  },
  {
    "path": "Demos/PuLIDDemo/PuLIDDemo/Ripple.swift",
    "chars": 4459,
    "preview": "//\n//  Ripple.swift\n//  AIColorPalette\n//\n//  Created by Todd Hamilton on 6/21/24.\n//\n\nimport SwiftUI\n\nstruct PushEffect"
  },
  {
    "path": "Demos/PuLIDDemo/PuLIDDemo.xcodeproj/project.pbxproj",
    "chars": 13535,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 77;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "Demos/Stickers/Stickers/AppConstants.swift",
    "chars": 751,
    "preview": "//\n//  AppConstants.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport AIProxy\n\nenum AppConstants {\n    #e"
  },
  {
    "path": "Demos/Stickers/Stickers/AppLogger.swift",
    "chars": 639,
    "preview": "//\n//  AppLogger.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport OSLog\n\n/// Log level"
  },
  {
    "path": "Demos/Stickers/Stickers/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "Demos/Stickers/Stickers/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 211,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"sticker.png\",\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n      \"s"
  },
  {
    "path": "Demos/Stickers/Stickers/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/Stickers/Stickers/ButtonStyles.swift",
    "chars": 4753,
    "preview": "//\n//  ButtonStyles.swift\n//  AIProxyBootstrap\n//\n//  Created by Todd Hamilton\n//\n\nimport SwiftUI\n\nstruct ButtonStyles: "
  },
  {
    "path": "Demos/Stickers/Stickers/Preview Content/Preview Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/Stickers/Stickers/StickerDataLoader.swift",
    "chars": 2692,
    "preview": "//\n//  StickerDataLoader.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport Vision\nimpor"
  },
  {
    "path": "Demos/Stickers/Stickers/StickerImageView.swift",
    "chars": 1126,
    "preview": "//\n//  StickerImageView.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport SwiftUI\n\n/// "
  },
  {
    "path": "Demos/Stickers/Stickers/StickerInputView.swift",
    "chars": 1373,
    "preview": "//\n//  StickerInputView.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport SwiftUI\n\n/// "
  },
  {
    "path": "Demos/Stickers/Stickers/StickerLoadingView.swift",
    "chars": 1018,
    "preview": "//\n//  StickerLoadingView.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport SwiftUI\n\n@M"
  },
  {
    "path": "Demos/Stickers/Stickers/StickerManager.swift",
    "chars": 3168,
    "preview": "//\n//  StickerManager.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport UIKit\nimport Sw"
  },
  {
    "path": "Demos/Stickers/Stickers/StickerView.swift",
    "chars": 3734,
    "preview": "//\n//  StickerView.swift\n//  AIProxyBootstrap\n//\n//  Created by Todd Hamilton\n//\n\nimport SwiftUI\n\n@MainActor\nstruct Stic"
  },
  {
    "path": "Demos/Stickers/Stickers/StickersApp.swift",
    "chars": 302,
    "preview": "//\n//  StickersApp.swift\n//  Stickers\n//\n//  Created by Lou Zell\n//\n\nimport SwiftUI\n\n@main\n@MainActor\nstruct StickersApp"
  },
  {
    "path": "Demos/Stickers/Stickers.xcodeproj/project.pbxproj",
    "chars": 18406,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "Demos/Transcriber/Transcriber/AppConstants.swift",
    "chars": 1215,
    "preview": "//\n//  AppConstants.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport SwiftData\nimport "
  },
  {
    "path": "Demos/Transcriber/Transcriber/AppLogger.swift",
    "chars": 642,
    "preview": "//\n//  AppLogger.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport OSLog\n\n/// Log level"
  },
  {
    "path": "Demos/Transcriber/Transcriber/Assets.xcassets/AccentColor.colorset/Contents.json",
    "chars": 123,
    "preview": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }"
  },
  {
    "path": "Demos/Transcriber/Transcriber/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 214,
    "preview": "{\n  \"images\" : [\n    {\n      \"filename\" : \"transcribe.png\",\n      \"idiom\" : \"universal\",\n      \"platform\" : \"ios\",\n     "
  },
  {
    "path": "Demos/Transcriber/Transcriber/Assets.xcassets/Contents.json",
    "chars": 63,
    "preview": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "Demos/Transcriber/Transcriber/AudioFileWriter.swift",
    "chars": 2857,
    "preview": "//\n//  AudioFileWriter.swift\n//  AIProxyBootstrap\n//\n//  Created by Lou Zell\n//\n\nimport Foundation\nimport AVFoundation\n\n"
  }
]

// ... and 44 more files (download for full content)

About this extraction

This page contains the full source code of the lzell/AIProxyBootstrap GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 244 files (588.8 KB), approximately 172.0k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!