Skip to content

Commit

Permalink
refactor: rewrite OpenAI service with Swift (tisfeng#473)
Browse files Browse the repository at this point in the history
* docs: update sponsor list

* refactor: rewrite OpenAI service with Swift

* perf: move swift services to swift file group

* perf: remove all #import "Easydict-Swift.h", since it has been added to pch file

* refactor: replace hardcode apikey with plist apikey

* perf: improve file structure and naming

* perf: remove unused var defaultModel

* fix: try to fix ci error

* fix: custom OpenAI service cannot directly inherit from OpenAI tisfeng#473

* perf: replace UserDefaults with Defaults

* perf: remove deprecated key EZOpenAIDomainKey

* perf: remove reverted EZTableTipsCell files

* docs: remove EZOpenAIDomainKey

* chore: update issue templates

* Update Easydict/Swift/Service/OpenAI/BaseOpenAIService.swift

Co-authored-by: Phillip Song <[email protected]>

* perf: replace EZOpenAIService with EZBaseOpenAIService

* Update Easydict/objc/ViewController/View/ResultView/EZResultView.m

Co-authored-by: Phillip Song <[email protected]>

* Update Easydict/objc/ViewController/View/ResultView/EZResultView.m

Co-authored-by: Phillip Song <[email protected]>

---------

Co-authored-by: Phillip Song <[email protected]>
  • Loading branch information
tisfeng and phlpsong authored Apr 2, 2024
1 parent 3d5ea5b commit 4175b9f
Show file tree
Hide file tree
Showing 460 changed files with 1,180 additions and 1,560 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/cn_feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: 功能建议
description: 功能建议
title: "🚀 功能建议:{{请填写标题,不要留空}}"
title: "🚀 功能建议:请填写标题,不要留空"
labels: ["enhancement"]

body:
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/en_feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Feature request
description: Request a new feature
title: "🚀 Feature Request: {{Please fill in the title, don't leave it blank}}"
title: "🚀 Feature Request: Please fill in the title, don't leave it blank"
labels: ["enhancement"]

body:
Expand Down
21 changes: 0 additions & 21 deletions .github/ISSUE_TEMPLATE/others.md

This file was deleted.

157 changes: 104 additions & 53 deletions Easydict.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions Easydict.xcworkspace/xcshareddata/swiftpm/Package.resolved
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"originHash" : "ca4d31aa1a70fb6a354fe9e139a2e74a189e4fcff55ed959a3adc71522905fc4",
"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
1 change: 0 additions & 1 deletion Easydict/App/AppDelegate+EZURLScheme.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#import <JLRoutes.h>
#import "EZWindowManager.h"
#import "EZSchemeParser.h"
#import "Easydict-Swift.h"

@implementation AppDelegate (EZURLScheme)

Expand Down
1 change: 0 additions & 1 deletion Easydict/App/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#import "EZShortcut.h"
#import "MMCrash.h"
#import "AppDelegate+EZURLScheme.h"
#import "Easydict-Swift.h"

@interface AppDelegate ()

Expand Down
3 changes: 1 addition & 2 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 "EZOpenAILikeService.h"
#import "EZNiuTransTranslate.h"
#import "EZDeepLTranslate.h"
#import "EZBingService.h"

#import "NSString+EZUtils.h"

File renamed without changes.
1 change: 0 additions & 1 deletion Easydict/App/entry.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#import <Cocoa/Cocoa.h>
#import "EZWindowManager.h"
#import "Easydict-Swift.h"
#import "XPMArguments.h"
#include <stdio.h>
#include <sys/ioctl.h>
Expand Down
107 changes: 0 additions & 107 deletions Easydict/Feature/Service/OpenAI/EZOpenAIChatResponse.h

This file was deleted.

62 changes: 0 additions & 62 deletions Easydict/Feature/Service/OpenAI/EZOpenAIChatResponse.m

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4175b9f

Please sign in to comment.