From cb7599d6588b2dd08e4dbaf2caf2034329646297 Mon Sep 17 00:00:00 2001 From: Hyeonseo Nam Date: Thu, 16 Mar 2023 12:07:19 +0900 Subject: [PATCH] Edit api.ts --- src/api.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/api.ts b/src/api.ts index 3484e4b..a4ce569 100644 --- a/src/api.ts +++ b/src/api.ts @@ -4,9 +4,12 @@ export class ChatGPT { static async callAPI( prompt: string, apiKey: string, - model = 'gpt-3.5-turbo', - maxTokens = 100, - temperature = 0.7): Promise { + model = 'text-davinci-003', + maxTokens = 256, + temperature = 0.7, + top_p=1, + frequency_penalty=0, + presence_penalty=0): Promise { const headers = new Headers({ @@ -18,8 +21,12 @@ export class ChatGPT { prompt: prompt, max_tokens: maxTokens, n: 1, + // stop: '\n', stop: null, temperature: temperature, + top_p: top_p, + frequency_penalty: frequency_penalty, + presence_penalty: presence_penalty }); const response = await fetch(`${this.baseUrl}/${model}/completions`, {