Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ openai.api_key = os.getenv('OpenAPI')
|
|
| 7 |
|
| 8 |
chat_history = ""
|
| 9 |
|
| 10 |
-
def call_openai_api(user_prompt):
|
| 11 |
global chat_history
|
| 12 |
|
| 13 |
text = """
|
|
@@ -35,7 +35,6 @@ def call_openai_api(user_prompt):
|
|
| 35 |
for attempt in range(max_retries):
|
| 36 |
try:
|
| 37 |
response = openai.ChatCompletion.create(
|
| 38 |
-
stream="true"
|
| 39 |
model="gpt-3.5-turbo",
|
| 40 |
messages=[
|
| 41 |
{"role": "system", "content": "You are a research assistant. Provide factual short answers to your prompts."},
|
|
|
|
| 7 |
|
| 8 |
chat_history = ""
|
| 9 |
|
| 10 |
+
def call_openai_api(user_prompt, stream=true):
|
| 11 |
global chat_history
|
| 12 |
|
| 13 |
text = """
|
|
|
|
| 35 |
for attempt in range(max_retries):
|
| 36 |
try:
|
| 37 |
response = openai.ChatCompletion.create(
|
|
|
|
| 38 |
model="gpt-3.5-turbo",
|
| 39 |
messages=[
|
| 40 |
{"role": "system", "content": "You are a research assistant. Provide factual short answers to your prompts."},
|