File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 5
5
from openai import OpenAI
6
6
from utils .sidebar_info import display_sidebar_info , display_main_info
7
7
from utils .lakera_guard import LakeraGuard
8
+ from streamlit_echarts import st_echarts
8
9
9
10
from utils .chatbot_utils import (
10
11
handle_chat_message ,
@@ -38,8 +39,11 @@ def chat_bot(username=None):
38
39
content = message ["content" ]
39
40
avatar = message .get ("avatar" )
40
41
41
- with st .chat_message (role , avatar = avatar ):
42
- st .markdown (content )
42
+ if content == "chart" :
43
+ st_echarts (options = message ["chart_options" ], height = "400px" , theme = "dark" )
44
+ else :
45
+ with st .chat_message (role , avatar = avatar ):
46
+ st .markdown (content )
43
47
44
48
lakera_guard = LakeraGuard (lakera_guard_api_key )
45
49
user_input = st .chat_input ("Ingresa tu pregunta:" )
Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ def display_chart_and_warning(
33
33
if key
34
34
else st_echarts (options = options , height = height , theme = theme )
35
35
)
36
+ st .session_state .chat_history .append (
37
+ {"role" : "assistant" , "content" : "chart" , "chart_options" : options }
38
+ )
39
+
36
40
if write_s and s is not None :
37
41
st .write (s )
38
42
st .markdown (
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ def display_sidebar_info():
154
154
"Doc hazme una plantilla de email de problema de conexión" ,
155
155
"doc ¿Quál es la operativa para responder un email?" ,
156
156
"!como se llama el programa de ticketing? enumera los puntos de como utilizarlo" ,
157
- "! qual es el roadmap del proyecto, que se ha cumplido y que no?" ,
157
+ "!Roadmap del proyecto, que se ha cumplido y que no? marca con un check y dame links " ,
158
158
"!¿Qué podemos hacer con el chatbot?" ,
159
159
"!Operativa flujo de trabajo con emails porfavor" ,
160
160
]
You can’t perform that action at this time.
0 commit comments