aboutsummaryrefslogtreecommitdiff
path: root/src/client/apis/gpt/GPT.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/apis/gpt/GPT.ts')
-rw-r--r--src/client/apis/gpt/GPT.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/client/apis/gpt/GPT.ts b/src/client/apis/gpt/GPT.ts
index 63563cb79..e3e87e017 100644
--- a/src/client/apis/gpt/GPT.ts
+++ b/src/client/apis/gpt/GPT.ts
@@ -27,9 +27,9 @@ const callTypeMap: { [type: string]: GPTCallOpts } = {
*/
let lastCall = '';
let lastResp = '';
-const gptAPICall = async (inputText: string, callType: GPTCallType) => {
- if (callType === GPTCallType.SUMMARY) inputText += '.';
- const opts: GPTCallOpts = callTypeMap[callType];
+const gptAPICall = async (inputTextIn: string, callType: GPTCallType) => {
+ const inputText = callType === GPTCallType.SUMMARY ? inputTextIn + '.' : inputTextIn;
+ const opts = callTypeMap[callType];
if (lastCall === inputText) return lastResp;
try {
const configuration: ClientOptions = {
@@ -69,8 +69,8 @@ const gptImageCall = async (prompt: string, n?: number) => {
// return response.data.data[0].url;
} catch (err) {
console.error(err);
- return;
}
+ return undefined;
};
export { gptAPICall, gptImageCall, GPTCallType };