n0v33n
commited on
Commit
Β·
1d0fa48
1
Parent(s):
1fc28b1
Add climate chat
Browse files- .gitignore +1 -1
- __pycache__/agent.cpython-312.pyc +0 -0
- app.py +22 -3
.gitignore
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.env
|
|
|
1 |
+
.env
|
__pycache__/agent.cpython-312.pyc
CHANGED
Binary files a/__pycache__/agent.cpython-312.pyc and b/__pycache__/agent.cpython-312.pyc differ
|
|
app.py
CHANGED
@@ -120,6 +120,24 @@ input, textarea, select {
|
|
120 |
margin-bottom: 20px;
|
121 |
background: linear-gradient(135deg, #1e1e1e 0%, #2c2c2c 100%);
|
122 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
"""
|
124 |
|
125 |
# Function to handle document processing workflow
|
@@ -239,23 +257,24 @@ async def run_tts_workflow(api_key: str, text_input):
|
|
239 |
|
240 |
# Gradio interface
|
241 |
with gr.Blocks(css=custom_css) as demo:
|
242 |
-
|
243 |
gr.Markdown("# π MistyClimate Multi-Agent System")
|
244 |
gr.Markdown("## Advanced Climate Intelligence & Multi-Agent Processing Platform")
|
245 |
gr.Markdown("Enter your Mistral API key and interact with our specialized climate chat agent and various processing systems.")
|
246 |
|
247 |
api_key_input = gr.Textbox(label="π Mistral API Key", type="password", placeholder="Enter your Mistral API key here")
|
248 |
|
249 |
-
# Climate Chat
|
250 |
with gr.Tab("π‘οΈ Climate Chat Assistant", elem_classes=["climate-chat"]):
|
251 |
gr.Markdown("### Climate Intelligence Chat")
|
252 |
gr.Markdown("Chat with our specialized climate AI assistant. Ask about climate science, environmental issues, sustainability practices, and get expert guidance on climate-related topics.")
|
253 |
|
|
|
254 |
chatbot = gr.Chatbot(
|
255 |
label="Climate Chat",
|
256 |
height=500,
|
257 |
type="tuples",
|
258 |
-
placeholder="Start chatting about climate topics..."
|
|
|
259 |
)
|
260 |
|
261 |
with gr.Row():
|
|
|
120 |
margin-bottom: 20px;
|
121 |
background: linear-gradient(135deg, #1e1e1e 0%, #2c2c2c 100%);
|
122 |
}
|
123 |
+
/* Avatar styling for emojis */
|
124 |
+
.gr-chatbot .avatar {
|
125 |
+
border-radius: 50%;
|
126 |
+
width: 40px;
|
127 |
+
height: 40px;
|
128 |
+
border: 2px solid #4db6ac;
|
129 |
+
background-color: #2c2c2c;
|
130 |
+
display: flex;
|
131 |
+
align-items: center;
|
132 |
+
justify-content: center;
|
133 |
+
font-size: 24px; /* Adjust emoji size */
|
134 |
+
}
|
135 |
+
.gr-chatbot .user .avatar {
|
136 |
+
background-color: #26a69a; /* User avatar background */
|
137 |
+
}
|
138 |
+
.gr-chatbot .assistant .avatar {
|
139 |
+
background-color: #4db6ac; /* Assistant avatar background */
|
140 |
+
}
|
141 |
"""
|
142 |
|
143 |
# Function to handle document processing workflow
|
|
|
257 |
|
258 |
# Gradio interface
|
259 |
with gr.Blocks(css=custom_css) as demo:
|
|
|
260 |
gr.Markdown("# π MistyClimate Multi-Agent System")
|
261 |
gr.Markdown("## Advanced Climate Intelligence & Multi-Agent Processing Platform")
|
262 |
gr.Markdown("Enter your Mistral API key and interact with our specialized climate chat agent and various processing systems.")
|
263 |
|
264 |
api_key_input = gr.Textbox(label="π Mistral API Key", type="password", placeholder="Enter your Mistral API key here")
|
265 |
|
266 |
+
# Climate Chat Assistant Tab with Emoji Avatars
|
267 |
with gr.Tab("π‘οΈ Climate Chat Assistant", elem_classes=["climate-chat"]):
|
268 |
gr.Markdown("### Climate Intelligence Chat")
|
269 |
gr.Markdown("Chat with our specialized climate AI assistant. Ask about climate science, environmental issues, sustainability practices, and get expert guidance on climate-related topics.")
|
270 |
|
271 |
+
# Chatbot with emoji avatars
|
272 |
chatbot = gr.Chatbot(
|
273 |
label="Climate Chat",
|
274 |
height=500,
|
275 |
type="tuples",
|
276 |
+
placeholder="Start chatting about climate topics...",
|
277 |
+
avatar_images=("π€", "π") # User: person emoji, Assistant: globe emoji
|
278 |
)
|
279 |
|
280 |
with gr.Row():
|