Няма описание

OpenAIConfiguration.swift 471B

123456789101112131415
  1. import Foundation
  2. enum OpenAIConfiguration {
  3. /// Read key from Info.plist (`OPENAI_API_KEY`) populated by build settings.
  4. static var apiKey: String {
  5. let fromPlist = Bundle.main.object(forInfoDictionaryKey: "OPENAI_API_KEY") as? String ?? ""
  6. return fromPlist.trimmingCharacters(in: .whitespacesAndNewlines)
  7. }
  8. /// Whether `apiKey` is currently populated with a real value.
  9. static var hasAPIKey: Bool {
  10. !apiKey.isEmpty
  11. }
  12. }