Spaces:
Runtime error
Runtime error
app.py
CHANGED
|
@@ -7,13 +7,14 @@ content = '请你扮演《西游记》中的唐三藏,使用唐三藏的语气
|
|
| 7 |
|
| 8 |
def callapi(p):
|
| 9 |
try:
|
|
|
|
| 10 |
response = openai.ChatCompletion.create(
|
| 11 |
model="gpt-3.5-turbo",
|
| 12 |
messages= [{"role":"system", "content":content},
|
| 13 |
{"role":"user", "content":p}
|
| 14 |
]
|
| 15 |
)
|
| 16 |
-
|
| 17 |
response = response["choices"][0]["message"]["content"]
|
| 18 |
while response.startswith("\n"):
|
| 19 |
response = response[1:]
|
|
|
|
| 7 |
|
| 8 |
def callapi(p):
|
| 9 |
try:
|
| 10 |
+
print(p)
|
| 11 |
response = openai.ChatCompletion.create(
|
| 12 |
model="gpt-3.5-turbo",
|
| 13 |
messages= [{"role":"system", "content":content},
|
| 14 |
{"role":"user", "content":p}
|
| 15 |
]
|
| 16 |
)
|
| 17 |
+
print(response)
|
| 18 |
response = response["choices"][0]["message"]["content"]
|
| 19 |
while response.startswith("\n"):
|
| 20 |
response = response[1:]
|