Skip to content

Commit 62501b6

Browse files
author
Kerwin
committed
fix: 调整光标到底部
chore: optimize code (#1328) fix: conversationOptions fix: default return in hook (#1352)
1 parent 796d731 commit 62501b6

File tree

4 files changed

+11
-16
lines changed

4 files changed

+11
-16
lines changed

service/src/chatgpt/index.ts

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,14 @@ export async function initApi() {
6666
apiModel = 'ChatGPTAPI'
6767
}
6868
else {
69-
const OPENAI_API_MODEL = config.apiModel
69+
const model = isNotEmptyString(config.apiModel) ? config.apiModel : 'gpt-3.5-turbo'
7070
const options: ChatGPTUnofficialProxyAPIOptions = {
7171
accessToken: config.accessToken,
72+
apiReverseProxyUrl: isNotEmptyString(config.reverseProxy) ? config.reverseProxy : 'https://bypass.churchless.tech/api/conversation',
73+
model,
7274
debug: !config.apiDisableDebug,
7375
}
7476

75-
if (isNotEmptyString(OPENAI_API_MODEL))
76-
options.model = OPENAI_API_MODEL
77-
78-
if (isNotEmptyString(config.reverseProxy)) {
79-
options.apiReverseProxyUrl = isNotEmptyString(config.reverseProxy)
80-
? config.reverseProxy
81-
: 'https://bypass.churchless.tech/api/conversation'
82-
}
83-
8477
await setupProxy(options)
8578

8679
api = new ChatGPTUnofficialProxyAPI({ ...options })

src/hooks/useLanguage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function useLanguage() {
2222
return koKR
2323
default:
2424
setLocale('zh-CN')
25-
return enUS
25+
return zhCN
2626
}
2727
})
2828

src/views/chat/components/Message/Text.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,14 @@ defineExpose({ textRef })
6666
<template>
6767
<div class="text-black" :class="wrapClass">
6868
<div ref="textRef" class="leading-relaxed break-words">
69-
<div v-if="!inversion" class="flex items-end">
70-
<div v-if="!asRawText" class="w-full markdown-body" v-html="text" />
71-
<div v-else class="w-full whitespace-pre-wrap" v-text="text" />
72-
<span v-if="loading" class="dark:text-white w-[4px] h-[20px] block animate-blink" />
69+
<div v-if="!inversion">
70+
<div v-if="!asRawText" class="markdown-body" v-html="text" />
71+
<div v-else class="whitespace-pre-wrap" v-text="text" />
7372
</div>
7473
<div v-else class="whitespace-pre-wrap" v-text="text" />
74+
<template v-if="loading">
75+
<span class="dark:text-white w-[4px] h-[20px] block animate-blink" />
76+
</template>
7577
</div>
7678
</div>
7779
</template>

src/views/chat/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const { usingContext, toggleUsingContext } = useUsingContext()
3939
const { uuid } = route.params as { uuid: string }
4040
4141
const dataSources = computed(() => chatStore.getChatByUuid(+uuid))
42-
const conversationList = computed(() => dataSources.value.filter(item => (!item.inversion && !item.error)))
42+
const conversationList = computed(() => dataSources.value.filter(item => (!item.inversion && !!item.conversationOptions)))
4343
4444
const prompt = ref<string>('')
4545
const firstLoading = ref<boolean>(false)

0 commit comments

Comments
 (0)