Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -272,11 +272,14 @@ def chat(id, npc, text):
|
|
272 |
#output = f"{npc}μ μλ΅μ
λλ€."
|
273 |
|
274 |
|
275 |
-
response = client.completions.create(
|
276 |
model=os.environ['MODEL'],
|
277 |
-
|
|
|
|
|
|
|
278 |
)
|
279 |
-
output = response.choices[0].
|
280 |
output = output.replace(".",".\n")
|
281 |
time.sleep(10)
|
282 |
print(output)
|
|
|
272 |
#output = f"{npc}μ μλ΅μ
λλ€."
|
273 |
|
274 |
|
275 |
+
response = client.chat.completions.create(
|
276 |
model=os.environ['MODEL'],
|
277 |
+
messages=[
|
278 |
+
{"role": "system", "content": prom},
|
279 |
+
{"role": "user", "content": f"{npc}μ λλ΅μ λ€μ λ¬Έμ₯μ λ§μΆ° μμ°μ€λ½κ² μμ±ν΄μ£ΌμΈμ. ν λ¬Έμ₯λ§ μμ±νμΈμ.\n\n{id}:" + text+f"\n\n{npc}:"},
|
280 |
+
]
|
281 |
)
|
282 |
+
output = response.choices[0].message.content
|
283 |
output = output.replace(".",".\n")
|
284 |
time.sleep(10)
|
285 |
print(output)
|