diff options
Diffstat (limited to 'src/client/apis/gpt')
| -rw-r--r-- | src/client/apis/gpt/GPT.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/apis/gpt/GPT.ts b/src/client/apis/gpt/GPT.ts index fc4347a64..8f58ec364 100644 --- a/src/client/apis/gpt/GPT.ts +++ b/src/client/apis/gpt/GPT.ts @@ -35,8 +35,8 @@ let lastResp = ''; * @param inputText Text to process * @returns AI Output */ -const gptAPICall = async (inputText: string, callType: GPTCallType, prompt?: any) => { - if (callType === GPTCallType.SUMMARY) inputText += '.'; +const gptAPICall = async (inputTextIn: string, callType: GPTCallType, prompt?: any) => { + const inputText = callType === GPTCallType.SUMMARY ? inputTextIn + '.' : inputTextIn; const opts: GPTCallOpts = callTypeMap[callType]; if (lastCall === inputText) return lastResp; try { @@ -47,8 +47,8 @@ const gptAPICall = async (inputText: string, callType: GPTCallType, prompt?: any lastCall = inputText; const openai = new OpenAI(configuration); - let usePrompt = prompt ? opts.prompt + prompt : opts.prompt; - let messages: ChatCompletionMessageParam[] = [ + const usePrompt = prompt ? opts.prompt + prompt : opts.prompt; + const messages: ChatCompletionMessageParam[] = [ { role: 'system', content: usePrompt }, { role: 'user', content: inputText }, ]; |
