Skip to content

Commit

Permalink
bump up required reflex version (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinxu9 authored Apr 9, 2024
1 parent 2831749 commit 3c3a067
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
12 changes: 1 addition & 11 deletions chat/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
import reflex as rx
from openai import OpenAI

_client = None


def get_openai_client():
global _client
if _client is None:
_client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))

return _client


# Checking if the API key is set properly
if not os.getenv("OPENAI_API_KEY"):
Expand Down Expand Up @@ -121,7 +111,7 @@ async def openai_process_question(self, question: str):
messages = messages[:-1]

# Start a new session to answer the question.
session = get_openai_client().chat.completions.create(
session = OpenAI().chat.completions.create(
model=os.getenv("OPENAI_MODEL", "gpt-3.5-turbo"),
messages=messages,
stream=True,
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
reflex>=0.4.4
reflex>=0.4.7
openai>=1.14.0

0 comments on commit 3c3a067

Please sign in to comment.