diff options
| author | bobzel <zzzman@gmail.com> | 2024-04-24 19:15:35 -0400 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-04-24 19:15:35 -0400 |
| commit | 8928ba1f332e319cab025987a098c87de607e853 (patch) | |
| tree | f3c3ed84556286e00cea69e86134fdb094d38c2a /src/client/apis/gpt | |
| parent | b9825ff743ea853139a4072ce871d36d00227c4b (diff) | |
post merge eslint cleanup
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 }, ]; |
