AIRequestConfiguration.swift 531 B

12345678910111213141516171819
  1. import Foundation
  2. enum AIRequestConfiguration {
  3. /// Fastest OpenAI model — optimized for low-latency structured output.
  4. static let model = "gpt-4.1-nano"
  5. static let requestTimeout: TimeInterval = 30
  6. static func titleOptimizerMaxTokens(variantCount: Int) -> Int {
  7. 80 + variantCount * 55
  8. }
  9. static func postGeneratorMaxTokens(for postType: RedditPostType) -> Int {
  10. switch postType {
  11. case .text: 450
  12. case .poll: 350
  13. case .image, .link, .video: 200
  14. }
  15. }
  16. }