From 71eb8d71a22d0003b933779b2dfe817715aa9cbd Mon Sep 17 00:00:00 2001 From: Sergey Melekhin Date: Thu, 28 Dec 2023 16:15:56 +0700 Subject: [PATCH] use chat completions api --- bot/skills/buktopuha.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bot/skills/buktopuha.py b/bot/skills/buktopuha.py index b282a2b..62dea31 100644 --- a/bot/skills/buktopuha.py +++ b/bot/skills/buktopuha.py @@ -328,11 +328,9 @@ def check_for_answer(update: Update, context: CallbackContext): def generate_question(prompt, word) -> str: - model = random.choice( - ["gpt-3.5-turbo-instruct", "gpt-4-1106-preview", "gemini-pro"] - ) + model = random.choice(["gpt-3.5-turbo", "gpt-4-1106-preview", "gemini-pro"]) if model.startswith("gpt"): - response = openai.Completion.create( + response = openai.ChatCompletion.create( model=model, prompt=prompt, temperature=0.9,