Skip to content

Commit 3c3a067

Browse files
authored
bump up required reflex version (#39)
1 parent 2831749 commit 3c3a067

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

chat/state.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,6 @@
22
import reflex as rx
33
from openai import OpenAI
44

5-
_client = None
6-
7-
8-
def get_openai_client():
9-
global _client
10-
if _client is None:
11-
_client = OpenAI(api_key=os.getenv("OPENAI_API_KEY"))
12-
13-
return _client
14-
155

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

123113
# Start a new session to answer the question.
124-
session = get_openai_client().chat.completions.create(
114+
session = OpenAI().chat.completions.create(
125115
model=os.getenv("OPENAI_MODEL", "gpt-3.5-turbo"),
126116
messages=messages,
127117
stream=True,

requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
reflex>=0.4.4
1+
reflex>=0.4.7
22
openai>=1.14.0
3-

0 commit comments

Comments
 (0)