Spaces:
Running
Running
update token count
Browse files
app.py
CHANGED
@@ -13,7 +13,7 @@ bot_name = "bbDemo"
|
|
13 |
|
14 |
def get_response_from_chatgpt(text):
|
15 |
#try:
|
16 |
-
response_api = openai.Completion.create(engine='text-davinci-003', prompt=str(text), max_tokens=
|
17 |
response_str = response_api["choices"][0]["text"].replace("\n", "")
|
18 |
response_str = response_str.split(user_name + ": ", 1)[0].split(bot_name + ": ", 1)[0]
|
19 |
print("RESPONSE response_api", response_api)
|
|
|
13 |
|
14 |
def get_response_from_chatgpt(text):
|
15 |
#try:
|
16 |
+
response_api = openai.Completion.create(engine='text-davinci-003', prompt=str(text), max_tokens=50)
|
17 |
response_str = response_api["choices"][0]["text"].replace("\n", "")
|
18 |
response_str = response_str.split(user_name + ": ", 1)[0].split(bot_name + ": ", 1)[0]
|
19 |
print("RESPONSE response_api", response_api)
|