bugfix: format
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import requests
|
|
4 |
import json
|
5 |
|
6 |
# Funci贸n que hace la solicitud a la API y muestra la respuesta progresivamente
|
7 |
-
def
|
8 |
url = "https://data-monopolio.dev.dd360.mx/ai-assistant/v1"
|
9 |
|
10 |
# Crea el payload con el mensaje proporcionado
|
@@ -13,7 +13,7 @@ def slow_api_response(message, history):
|
|
13 |
"sessionId": "12345",
|
14 |
"numMessages": "1",
|
15 |
"userId": "user-01",
|
16 |
-
"property_id":
|
17 |
})
|
18 |
|
19 |
headers = {
|
@@ -32,8 +32,11 @@ def slow_api_response(message, history):
|
|
32 |
except requests.RequestException as e:
|
33 |
yield f"Error: {str(e)}"
|
34 |
|
35 |
-
|
36 |
-
|
37 |
|
38 |
-
|
39 |
-
|
|
|
|
|
|
|
|
4 |
import json
|
5 |
|
6 |
# Funci贸n que hace la solicitud a la API y muestra la respuesta progresivamente
|
7 |
+
def llm(message, history, property_id="c0ced2220b87fc23762facf617157a4f"):
|
8 |
url = "https://data-monopolio.dev.dd360.mx/ai-assistant/v1"
|
9 |
|
10 |
# Crea el payload con el mensaje proporcionado
|
|
|
13 |
"sessionId": "12345",
|
14 |
"numMessages": "1",
|
15 |
"userId": "user-01",
|
16 |
+
"property_id": property_id
|
17 |
})
|
18 |
|
19 |
headers = {
|
|
|
32 |
except requests.RequestException as e:
|
33 |
yield f"Error: {str(e)}"
|
34 |
|
35 |
+
with gr.Blocks() as demo:
|
36 |
+
property_id = gr.Textbox("Introduce id", label="Property ID")
|
37 |
|
38 |
+
gr.ChatInterface(
|
39 |
+
llm, additional_inputs=[property_id]
|
40 |
+
)
|
41 |
+
|
42 |
+
demo.launch()
|