Skip to content

Commit

Permalink
优化一些功能
Browse files Browse the repository at this point in the history
优化一些功能
  • Loading branch information
crazypoo committed Mar 19, 2023
1 parent cdcc582 commit d8db9f0
Show file tree
Hide file tree
Showing 11 changed files with 187 additions and 110 deletions.
128 changes: 65 additions & 63 deletions PTChatGPT/Base/PTAppConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -620,79 +620,81 @@ class PTAppConfig {
}
}

func getAiModelPickerDate(currentAi:String,handle:@escaping (_ pickerArr:[BRResultModel],_ currentAiIndex:[NSNumber])->Void)
func getAiModelPickerDate(currentAi:String,currentChatModel:PTSegHistoryModel?,handle:@escaping (_ pickerArr:[BRResultModel],_ currentAiIndex:[NSNumber])->Void)
{
var modelArr = [BRResultModel]()

let gptMainModel = BRResultModel()
gptMainModel.parentKey = "-1"
gptMainModel.parentValue = ""
gptMainModel.key = "GPT"
gptMainModel.value = "GPT"
modelArr.append(gptMainModel)

let gptDavinciModel = BRResultModel()
gptDavinciModel.parentKey = "GPT"
gptDavinciModel.parentValue = OpenAIModelType.gpt3(.davinci).modelName
gptDavinciModel.key = "1"
gptDavinciModel.value = OpenAIModelType.gpt3(.davinci).modelName
modelArr.append(gptDavinciModel)

let gptCurieModel = BRResultModel()
gptCurieModel.parentKey = "GPT"
gptCurieModel.parentValue = OpenAIModelType.gpt3(.curie).modelName
gptCurieModel.key = "2"
gptCurieModel.value = OpenAIModelType.gpt3(.curie).modelName
modelArr.append(gptCurieModel)
if (currentChatModel?.systemContent ?? "").stringIsEmpty() {
let gptMainModel = BRResultModel()
gptMainModel.parentKey = "-1"
gptMainModel.parentValue = ""
gptMainModel.key = "GPT"
gptMainModel.value = "GPT"
modelArr.append(gptMainModel)

let gptDavinciModel = BRResultModel()
gptDavinciModel.parentKey = "GPT"
gptDavinciModel.parentValue = OpenAIModelType.gpt3(.davinci).modelName
gptDavinciModel.key = "1"
gptDavinciModel.value = OpenAIModelType.gpt3(.davinci).modelName
modelArr.append(gptDavinciModel)

let gptCurieModel = BRResultModel()
gptCurieModel.parentKey = "GPT"
gptCurieModel.parentValue = OpenAIModelType.gpt3(.curie).modelName
gptCurieModel.key = "2"
gptCurieModel.value = OpenAIModelType.gpt3(.curie).modelName
modelArr.append(gptCurieModel)

let gptBabbageModel = BRResultModel()
gptBabbageModel.parentKey = "GPT"
gptBabbageModel.parentValue = OpenAIModelType.gpt3(.babbage).modelName
gptBabbageModel.key = "3"
gptBabbageModel.value = OpenAIModelType.gpt3(.babbage).modelName
modelArr.append(gptBabbageModel)
let gptBabbageModel = BRResultModel()
gptBabbageModel.parentKey = "GPT"
gptBabbageModel.parentValue = OpenAIModelType.gpt3(.babbage).modelName
gptBabbageModel.key = "3"
gptBabbageModel.value = OpenAIModelType.gpt3(.babbage).modelName
modelArr.append(gptBabbageModel)

let gptAdaModel = BRResultModel()
gptAdaModel.parentKey = "GPT"
gptAdaModel.parentValue = OpenAIModelType.gpt3(.ada).modelName
gptAdaModel.key = "4"
gptAdaModel.value = OpenAIModelType.gpt3(.ada).modelName
modelArr.append(gptAdaModel)
let gptAdaModel = BRResultModel()
gptAdaModel.parentKey = "GPT"
gptAdaModel.parentValue = OpenAIModelType.gpt3(.ada).modelName
gptAdaModel.key = "4"
gptAdaModel.value = OpenAIModelType.gpt3(.ada).modelName
modelArr.append(gptAdaModel)

let codexMainModel = BRResultModel()
codexMainModel.parentKey = "-1"
codexMainModel.parentValue = ""
codexMainModel.key = "CODEX"
codexMainModel.value = "CODEX"
modelArr.append(codexMainModel)
let codexMainModel = BRResultModel()
codexMainModel.parentKey = "-1"
codexMainModel.parentValue = ""
codexMainModel.key = "CODEX"
codexMainModel.value = "CODEX"
modelArr.append(codexMainModel)

let codexDavinciModel = BRResultModel()
codexDavinciModel.parentKey = "CODEX"
codexDavinciModel.parentValue = OpenAIModelType.codex(.davinci).modelName
codexDavinciModel.key = "1"
codexDavinciModel.value = OpenAIModelType.codex(.davinci).modelName
modelArr.append(codexDavinciModel)
let codexDavinciModel = BRResultModel()
codexDavinciModel.parentKey = "CODEX"
codexDavinciModel.parentValue = OpenAIModelType.codex(.davinci).modelName
codexDavinciModel.key = "1"
codexDavinciModel.value = OpenAIModelType.codex(.davinci).modelName
modelArr.append(codexDavinciModel)

let codexCushmanModel = BRResultModel()
codexCushmanModel.parentKey = "CODEX"
codexCushmanModel.parentValue = OpenAIModelType.codex(.cushman).modelName
codexCushmanModel.key = "2"
codexCushmanModel.value = OpenAIModelType.codex(.cushman).modelName
modelArr.append(codexCushmanModel)
let codexCushmanModel = BRResultModel()
codexCushmanModel.parentKey = "CODEX"
codexCushmanModel.parentValue = OpenAIModelType.codex(.cushman).modelName
codexCushmanModel.key = "2"
codexCushmanModel.value = OpenAIModelType.codex(.cushman).modelName
modelArr.append(codexCushmanModel)

let featureMainModel = BRResultModel()
featureMainModel.parentKey = "-1"
featureMainModel.parentValue = ""
featureMainModel.key = "FEATURE"
featureMainModel.value = "FEATURE"
modelArr.append(featureMainModel)
let featureMainModel = BRResultModel()
featureMainModel.parentKey = "-1"
featureMainModel.parentValue = ""
featureMainModel.key = "FEATURE"
featureMainModel.value = "FEATURE"
modelArr.append(featureMainModel)

let featureDavinciModel = BRResultModel()
featureDavinciModel.parentKey = "FEATURE"
featureDavinciModel.parentValue = OpenAIModelType.feature(.davinci).modelName
featureDavinciModel.key = "3"
featureDavinciModel.value = OpenAIModelType.feature(.davinci).modelName
modelArr.append(featureDavinciModel)
let featureDavinciModel = BRResultModel()
featureDavinciModel.parentKey = "FEATURE"
featureDavinciModel.parentValue = OpenAIModelType.feature(.davinci).modelName
featureDavinciModel.key = "3"
featureDavinciModel.value = OpenAIModelType.feature(.davinci).modelName
modelArr.append(featureDavinciModel)
}

let gptXMainModel = BRResultModel()
gptXMainModel.parentKey = "-1"
Expand Down
1 change: 1 addition & 0 deletions PTChatGPT/Chat/Models/PTSegHistoryModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ import PooTools

class PTSegHistoryModel: PTBaseModel {
var keyName:String = ""
var systemContent:String = ""
var historyJson:String = ""
}
Loading

0 comments on commit d8db9f0

Please sign in to comment.