Mohamed284 commited on
Commit
4e95c6c
·
verified ·
1 Parent(s): 6142c70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -23
app.py CHANGED
@@ -197,32 +197,20 @@ def chat_interface(question: str, history: List[Tuple[str, str]]):
197
  response = generate_response(question)
198
  return "", history + [(question, response)]
199
 
200
- with gr.Blocks(title="AskNature BioStrategy Interface", theme=gr.themes.Soft()) as demo:
201
- gr.Markdown("""
202
- # 🍃 AskNature BioDialogue """)
203
-
204
  with gr.Row():
205
- chatbot = gr.Chatbot(
206
- label="Organism Strategy Dialogue",
207
- height=500,
208
- bubble_full_width=False,
209
- avatar_images=("🧬", "🌐") # DNA + Earth icons
210
- )
211
-
212
  with gr.Row():
213
- question = gr.Textbox(
214
- placeholder="Explore biological strategiess (e.g., 'How are TISSIUM polymers inspired by skin and used in medicine?')...",
215
- label="Biological Inquiry",
216
- scale=4
217
- )
218
- clear_btn = gr.Button("🌱 New Exploration Thread", variant="secondary")
219
-
220
- gr.Markdown("""
221
- <div style="text-align: center; color: #4a7c59;">
222
- <small>Powered by AskNature's Database |
223
- Explore nature's blueprints at <a href="https://asknature.org">asknature.org</a></small>
224
- </div>""")
225
 
 
 
 
 
 
226
  question.submit(chat_interface, [question, chatbot], [question, chatbot])
227
  clear_btn.click(lambda: [], None, chatbot)
228
 
 
197
  response = generate_response(question)
198
  return "", history + [(question, response)]
199
 
200
+ with gr.Blocks(title="AskNature BioRAG Expert", theme=gr.themes.Soft()) as demo:
201
+ gr.Markdown("# 🌿 AskNature RAG-based Chatbot ")
 
 
202
  with gr.Row():
203
+ chatbot = gr.Chatbot(label="Dialogue History", height=500)
 
 
 
 
 
 
204
  with gr.Row():
205
+ question = gr.Textbox(placeholder="Ask about biomimicry (e.g. 'How does Werewool use coral proteins to make fibers?')",
206
+ label="Inquiry", scale=4)
207
+ clear_btn = gr.Button("Clear History", variant="secondary")
 
 
 
 
 
 
 
 
 
208
 
209
+ gr.Markdown("""
210
+ <div style="text-align: center; color: #4a7c59;">
211
+ <small>Powered by AskNature's Database |
212
+ Explore nature's blueprints at <a href="https://asknature.org">asknature.org</a></small>
213
+ </div>""")
214
  question.submit(chat_interface, [question, chatbot], [question, chatbot])
215
  clear_btn.click(lambda: [], None, chatbot)
216