File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,26 +60,33 @@ struct OpenAIView: View {
6060 }
6161 }
6262
63+ TextField (
64+ text: $settings. chatGPTEndpoint,
65+ prompt: Text ( " https://api.openai.com/v1/chat/completions " )
66+ ) {
67+ Text ( " ChatGPT Server " )
68+ } . textFieldStyle ( . roundedBorder)
69+
6370 Picker ( selection: $settings. chatGPTLanguage) {
64- ForEach ( Locale . availableLocales , id: \. identifier ) { locale in
65- Text ( locale . languageName ) . tag ( locale . languageName )
71+ ForEach ( Locale . availableLocalizedLocales , id: \. self ) { localizedLocales in
72+ Text ( localizedLocales ) . tag ( localizedLocales )
6673 }
6774 } label: {
6875 Text ( " Reply in Language " )
6976 } . pickerStyle ( . menu)
7077
71- HStack {
72- if let model = ChatGPTModel ( rawValue: settings. chatGPTModel) {
73- let binding = Binding (
74- get: { String ( settings. chatGPTMaxToken) } ,
75- set: {
76- if let selectionMaxToken = Int ( $0) {
77- settings. chatGPTMaxToken = model. maxToken < selectionMaxToken ? model. maxToken : selectionMaxToken
78- } else {
79- settings. chatGPTMaxToken = 0
80- }
78+ if let model = ChatGPTModel ( rawValue: settings. chatGPTModel) {
79+ let binding = Binding (
80+ get: { String ( settings. chatGPTMaxToken) } ,
81+ set: {
82+ if let selectionMaxToken = Int ( $0) {
83+ settings. chatGPTMaxToken = model. maxToken < selectionMaxToken ? model. maxToken : selectionMaxToken
84+ } else {
85+ settings. chatGPTMaxToken = 0
8186 }
82- )
87+ }
88+ )
89+ HStack {
8390 Stepper (
8491 value: $settings. chatGPTMaxToken,
8592 in: 0 ... model. maxToken,
You can’t perform that action at this time.
0 commit comments