Compare commits

..

3 Commits

3 changed files with 18 additions and 2 deletions

View File

@@ -98,6 +98,15 @@ const signOut = async () => {
}
}
const settings = useSettings()
const showApiKeySetting = ref(false)
watchEffect(() => {
if (settings.value) {
const settingsValue = toRaw(settings.value)
showApiKeySetting.value = settingsValue.open_api_key_setting && settingsValue.open_api_key_setting === 'True'
}
})
onMounted(async () => {
loadConversations()
loadSettings()
@@ -239,6 +248,10 @@ onMounted(async () => {
</v-card>
</v-dialog>
<ApiKeyDialog
v-if="showApiKeySetting"
/>
<ModelParameters/>
<v-menu

View File

@@ -1,5 +1,5 @@
// https://nuxt.com/docs/api/configuration/nuxt-config
const appName = 'ChatGPT UI'
const appName = process.env.NUXT_PUBLIC_APP_NAME ?? 'ChatGPT UI'
export default defineNuxtConfig({
dev: false,
@@ -14,6 +14,7 @@ export default defineNuxtConfig({
appName: appName,
typewriter: false,
typewriterDelay: 50,
customApiKey: false
}
},
build: {

View File

@@ -60,7 +60,7 @@ const fetchReply = async (message) => {
}
const data = Object.assign({}, currentModel.value, {
openaiApiKey: openaiApiKey.value,
openaiApiKey: enableCustomApiKey.value ? openaiApiKey.value : null,
message: message,
conversationId: currentConversation.value.id
}, webSearchParams)
@@ -165,6 +165,7 @@ const deleteMessage = (index) => {
const showWebSearchToggle = ref(false)
const enableWebSearch = ref(false)
const enableCustomApiKey = ref(false)
const settings = useSettings()
@@ -172,6 +173,7 @@ watchEffect(() => {
if (settings.value) {
const settingsValue = toRaw(settings.value)
showWebSearchToggle.value = settingsValue.open_web_search && settingsValue.open_web_search === 'True'
enableCustomApiKey.value = settingsValue.open_api_key_setting && settingsValue.open_api_key_setting === 'True'
}
})