Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -41,12 +41,12 @@ def chat_with_gpt(user_message):
|
|
41 |
hist = []
|
42 |
for i in st.session_state.chat_history:
|
43 |
hist.append(
|
44 |
-
{'role': 'user', 'content': i['user']}
|
45 |
)
|
46 |
hist.append(
|
47 |
-
{'role': 'assistant', 'content': i['assistant']}
|
48 |
)
|
49 |
-
hist.append({'role': 'user', 'content': user_message})
|
50 |
response = openai.chat.completions.create(
|
51 |
model="gpt-4o",
|
52 |
messages=[{'role': 'system', 'content': prompt, }, ] + hist
|
|
|
41 |
hist = []
|
42 |
for i in st.session_state.chat_history:
|
43 |
hist.append(
|
44 |
+
{'role': 'user', 'content': "Продавец:\n" + i['user']}
|
45 |
)
|
46 |
hist.append(
|
47 |
+
{'role': 'assistant', 'content': "Покупатель:\n" + i['assistant']}
|
48 |
)
|
49 |
+
hist.append({'role': 'user', 'content': "Продавец:\n" + user_message})
|
50 |
response = openai.chat.completions.create(
|
51 |
model="gpt-4o",
|
52 |
messages=[{'role': 'system', 'content': prompt, }, ] + hist
|