Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please give example code for passing in a specific model #2

Open
stanchiang opened this issue Sep 23, 2024 · 0 comments
Open

please give example code for passing in a specific model #2

stanchiang opened this issue Sep 23, 2024 · 0 comments

Comments

@stanchiang
Copy link

hi I got your project to work but I'm curious where exactly I'd pass in optional params for model, temperature, etc.

import SwiftUI
import AIReceiptScanner

struct ContentView: View {
    @State private var scanStatus: ScanStatus = .idle
    let apiKey = "sk-proj-..."
    
    var body: some View {
        VStack {
            ReceiptPickerScannerView(apiKey: apiKey, scanStatus: $scanStatus)
                .onChange(of: scanStatus) { _, newValue in
                    switch newValue {
                    case .pickingImage:
                        print("Picking image")
                    case .prompting(let image):
                        print("prompting gpt-4 with receipt image")
                    case .success(let scanResult):
                        print("Success with \(scanResult)")
                    case .failure(let error, let image):
                        print("Error \(error.localizedDescription)")
                    case .idle:
                        print("Idle state")
                    }
                }
        }
        .padding()
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant