-
Notifications
You must be signed in to change notification settings - Fork 8
/
TopLevel.qml
77 lines (68 loc) · 1.78 KB
/
TopLevel.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Qt.labs.settings
Item {
id: root
property var settings: defaultSettings
readonly property var defaultSettings: {
"tts": {
"autoplay": false,
"locale": "en",
"watson": {
"use": false,
"voice": "en-US_MichaelV3Voice",
"apiKey": "",
"apiUrl": ""
}
},
"chat": {
"defaultMessages": {
"messages": [
{"role": "system", "content": "Act as friendly and intelligent AI assistant. Your name is 'Intellicute'. Your UI is written with Qt and QML by [Machine Koder](https://machinekoder.com)."}
]},
"model": "gpt-3.5-turbo",
"maxTokens": 2048,
"temperature": 0.3,
"topP": 1.0,
"frequencyPenalty": 0.0,
"presencePenalty": 0.0,
},
"openai": {
"accessToken": ""
}
}
function resetSettings() {
root.settings = root.defaultSettings
}
Settings {
id: settingsStore
property alias settings: root.settings
}
StackView {
id: stack
anchors.fill: parent
}
Component {
id: chatPage
ChatPage {
settings: root.settings
onSettingsRequested: stack.push(settingsPage)
}
}
Component {
id: settingsPage
SettingsPage {
settings: root.settings
onCancel: stack.pop()
onReset: root.resetSettings()
onAccept: {
root.settings = settings
stack.pop()
}
}
}
Component.onCompleted: {
stack.push(chatPage)
}
}