Skip to content

Commit

Permalink
fix(gen_title) add openaiApiKey to request body
Browse files Browse the repository at this point in the history
  • Loading branch information
WongSaang committed Apr 18, 2023
1 parent f1b5f8c commit 4795185
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions utils/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,14 @@ export const addConversation = (conversation) => {


export const genTitle = async (conversationId) => {
const { $i18n } = useNuxtApp()
const { $i18n, $settings } = useNuxtApp()
const openaiApiKey = useApiKey()
const { data, error } = await useAuthFetch('/api/gen_title/', {
method: 'POST',
body: {
conversationId: conversationId,
prompt: $i18n.t('genTitlePrompt')
prompt: $i18n.t('genTitlePrompt'),
openaiApiKey: $settings.open_api_key_setting === 'True' ? openaiApiKey.value : null,
}
})
if (!error.value) {
Expand Down

0 comments on commit 4795185

Please sign in to comment.