From ba56499ca07584ec9ebe23490fdf78bf971f1efd Mon Sep 17 00:00:00 2001 From: lakhoune Date: Sun, 3 Mar 2024 12:21:02 +0100 Subject: [PATCH] upgrade openai lib --- requirements.txt | 2 +- utils/llm_interface.py | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/requirements.txt b/requirements.txt index 2a0e1b6..b89c63d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -80,4 +80,4 @@ tzdata==2023.3 urllib3==2.0.4 wcwidth==0.2.6 Werkzeug==2.3.7 -openai==1.3.2 +openai==1.13.3 diff --git a/utils/llm_interface.py b/utils/llm_interface.py index 31036a6..5ed209b 100644 --- a/utils/llm_interface.py +++ b/utils/llm_interface.py @@ -58,12 +58,6 @@ def send_prompt(prompt, api_key, openai_model="gpt-3.5-turbo-1106"): {"role": "user", "content": prompt} ]) - if response.status != 200: - raise Exception(response) - if "choices" not in response: - if "error" in response: - return response - return "Error: No response from OpenAI. Please try again later." content = response.choices[0].message.content return content