Skip to content

Commit

Permalink
upgrade openai lib
Browse files Browse the repository at this point in the history
  • Loading branch information
lakhoune committed Mar 3, 2024
1 parent 31b3ba0 commit ba56499
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 0 additions & 6 deletions utils/llm_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ba56499

Please sign in to comment.