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

refactor: add OpenAIService in Swift #312

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 98 additions & 21 deletions Easydict.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion Easydict.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"originHash" : "a995ca1e217de6a305cfafa6275749b61cb5fb17e18c35671935a1737e5aa34b",
"pins" : [
{
"identity" : "abseil-cpp-binary",
Expand Down Expand Up @@ -189,6 +190,15 @@
"version" : "2.30909.0"
}
},
{
"identity" : "openai",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tisfeng/OpenAI",
"state" : {
"branch" : "dev",
"revision" : "9490fa07602cef2979715dc0ee80877e78dc3872"
}
},
{
"identity" : "plcrashreporter",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -298,5 +308,5 @@
}
}
],
"version" : 2
"version" : 3
}
5 changes: 2 additions & 3 deletions Easydict/App/Easydict-Bridging-Header.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@
#import "EZLanguageManager.h"
#import "DarkModeManager.h"
#import "EZScriptExecutor.h"
#import "EZOpenAIService.h"
#import "EZNiuTransTranslate.h"
#import "EZDeepLTranslate.h"
#import "EZBingService.h"


#import "EZObjcOpenAIService.h"
#import "NSString+EZUtils.h"
2 changes: 1 addition & 1 deletion Easydict/Feature/Service/Model/EZQueryResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ NS_ASSUME_NONNULL_BEGIN

eg. https://dict.youdao.com/result?word=%E4%BD%A0%E5%AF%B9%E4%B9%A0%E4%B8%BB%E5%B8%AD%E6%80%8E%E4%B9%88%E7%9C%8B%EF%BC%9F&lang=en
*/
@property (nonatomic, copy, nullable) NSString *translatedText;
@property (readonly, nonatomic, copy, nullable) NSString *translatedText;

@property (nonatomic, strong, nullable) EZError *error;

Expand Down
1 change: 0 additions & 1 deletion Easydict/Feature/Service/Model/EZServiceTypes.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
#import "EZDeepLTranslate.h"
#import "EZVolcanoTranslate.h"
#import "EZAppleService.h"
#import "EZOpenAIService.h"
#import "EZBingService.h"
#import "EZConfiguration.h"
#import "EZAppleDictionary.h"
Expand Down
3 changes: 0 additions & 3 deletions Easydict/Feature/Service/Niutrans/EZNiuTransTranslate.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

@interface EZNiuTransTranslate ()

@property (nonatomic, copy) NSString *defaultAPIKey;
@property (nonatomic, copy) NSString *apiKey;

@end
Expand All @@ -21,8 +20,6 @@ @implementation EZNiuTransTranslate

- (instancetype)init {
if (self = [super init]) {
// This is a test APIKey, please do not abuse it. It is recommended to go to the official website to apply for a personal APIKey.
self.defaultAPIKey = [@"XOoEyjDMoM2MuMInzySOjGucFWXRj1wXQivVYDGTi6X7iDe7EkuHVVPOy2Op3RlD" decryptAES];
}
return self;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface EZOpenAIService : EZQueryService
@interface EZObjcOpenAIService : EZQueryService

@end

Expand Down
Loading