Skip to content

Commit

Permalink
fix: openai usage status does not work (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
tisfeng authored Apr 9, 2024
1 parent 27b7e54 commit e5eebce
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Easydict/Swift/Service/OpenAI/OpenAIService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,18 @@
// Copyright © 2023 izual. All rights reserved.
//

import Defaults
import Foundation

// MARK: - OpenAIService

@objcMembers
@objc(EZOpenAIService)
public class OpenAIService: BaseOpenAIService {}
class OpenAIService: BaseOpenAIService {
public override func serviceUsageStatus() -> EZServiceUsageStatus {
// swiftlint:disable:next todo
// TODO: Later, we need to support all services to use usage status.
let usageStatus = Defaults[.openAIServiceUsageStatus]
guard let value = UInt(usageStatus.rawValue) else { return .default }
return EZServiceUsageStatus(rawValue: value) ?? .default
}
}

0 comments on commit e5eebce

Please sign in to comment.