Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -142,7 +142,7 @@ def function(Textbox,Textbox2,Textbox3):
|
|
142 |
def send_request(reply):
|
143 |
try:
|
144 |
response = requests.get(f"https://api.placid.app/u/pydav4ibo?quote[text]={reply}")
|
145 |
-
print('Response HTTP Status Code: {status_code}'
|
146 |
image = Image.open(response.raw)
|
147 |
image_array = np.array(image)
|
148 |
return image_array
|
@@ -169,8 +169,9 @@ def function(Textbox,Textbox2,Textbox3):
|
|
169 |
)
|
170 |
print(messages)
|
171 |
reply = chat.choices[0].message.content
|
172 |
-
send_request(reply)
|
173 |
messages.append({"role": "assistant", "content": reply})
|
|
|
174 |
except Exception as e:
|
175 |
print(traceback.format_exc())
|
176 |
return "Please Wait!"
|
|
|
142 |
def send_request(reply):
|
143 |
try:
|
144 |
response = requests.get(f"https://api.placid.app/u/pydav4ibo?quote[text]={reply}")
|
145 |
+
print(f'Response HTTP Status Code: {response.status_code}')
|
146 |
image = Image.open(response.raw)
|
147 |
image_array = np.array(image)
|
148 |
return image_array
|
|
|
169 |
)
|
170 |
print(messages)
|
171 |
reply = chat.choices[0].message.content
|
172 |
+
image_array = send_request(reply)
|
173 |
messages.append({"role": "assistant", "content": reply})
|
174 |
+
return image_array
|
175 |
except Exception as e:
|
176 |
print(traceback.format_exc())
|
177 |
return "Please Wait!"
|