Skip to content

Commit

Permalink
fix: 调整光标到底部
Browse files Browse the repository at this point in the history
chore: optimize code (#1328)
fix: conversationOptions
fix: default return in  hook (#1352)
  • Loading branch information
Kerwin committed Apr 15, 2023
1 parent 796d731 commit 62501b6
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
13 changes: 3 additions & 10 deletions service/src/chatgpt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,14 @@ export async function initApi() {
apiModel = 'ChatGPTAPI'
}
else {
const OPENAI_API_MODEL = config.apiModel
const model = isNotEmptyString(config.apiModel) ? config.apiModel : 'gpt-3.5-turbo'
const options: ChatGPTUnofficialProxyAPIOptions = {
accessToken: config.accessToken,
apiReverseProxyUrl: isNotEmptyString(config.reverseProxy) ? config.reverseProxy : 'https://bypass.churchless.tech/api/conversation',
model,
debug: !config.apiDisableDebug,
}

if (isNotEmptyString(OPENAI_API_MODEL))
options.model = OPENAI_API_MODEL

if (isNotEmptyString(config.reverseProxy)) {
options.apiReverseProxyUrl = isNotEmptyString(config.reverseProxy)
? config.reverseProxy
: 'https://bypass.churchless.tech/api/conversation'
}

await setupProxy(options)

api = new ChatGPTUnofficialProxyAPI({ ...options })
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useLanguage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function useLanguage() {
return koKR
default:
setLocale('zh-CN')
return enUS
return zhCN
}
})

Expand Down
10 changes: 6 additions & 4 deletions src/views/chat/components/Message/Text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,14 @@ defineExpose({ textRef })
<template>
<div class="text-black" :class="wrapClass">
<div ref="textRef" class="leading-relaxed break-words">
<div v-if="!inversion" class="flex items-end">
<div v-if="!asRawText" class="w-full markdown-body" v-html="text" />
<div v-else class="w-full whitespace-pre-wrap" v-text="text" />
<span v-if="loading" class="dark:text-white w-[4px] h-[20px] block animate-blink" />
<div v-if="!inversion">
<div v-if="!asRawText" class="markdown-body" v-html="text" />
<div v-else class="whitespace-pre-wrap" v-text="text" />
</div>
<div v-else class="whitespace-pre-wrap" v-text="text" />
<template v-if="loading">
<span class="dark:text-white w-[4px] h-[20px] block animate-blink" />
</template>
</div>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/views/chat/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const { usingContext, toggleUsingContext } = useUsingContext()
const { uuid } = route.params as { uuid: string }
const dataSources = computed(() => chatStore.getChatByUuid(+uuid))
const conversationList = computed(() => dataSources.value.filter(item => (!item.inversion && !item.error)))
const conversationList = computed(() => dataSources.value.filter(item => (!item.inversion && !!item.conversationOptions)))
const prompt = ref<string>('')
const firstLoading = ref<boolean>(false)
Expand Down

0 comments on commit 62501b6

Please sign in to comment.