SKekana commited on
Commit
e49bf1a
·
1 Parent(s): 323f805

Updated interface

Browse files
Files changed (1) hide show
  1. app.py +29 -11
app.py CHANGED
@@ -68,17 +68,35 @@ Request: {user_text}"""
68
  except Exception as e:
69
  return None, f"Error: {e}", "", ""
70
 
71
- iface = gr.Interface(
72
- fn=mcp_tool,
73
- inputs=[gr.Textbox(label="Describe your simulation (e.g., 'Optimize a water molecule')")],
74
- outputs=[
75
- gr.Textbox(label="Prompt Sent to Gemini"),
76
- gr.Image(label="Simulation Result"),
77
- gr.Textbox(label="LLM Analysis"),
78
- gr.Code(label="Generated ASE Code")
79
- ],
80
- title="ASE+Gemini MCP Tool"
81
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
 
83
  if __name__ == "__main__":
84
  iface.launch()
 
68
  except Exception as e:
69
  return None, f"Error: {e}", "", ""
70
 
71
+ with gr.Blocks(title="ASE+Gemini MCP Tool") as iface:
72
+ gr.Markdown("# ASE+Gemini Molecular Simulation Tool")
73
+
74
+ with gr.Row():
75
+ with gr.Column(scale=2):
76
+ user_prompt = gr.Textbox(
77
+ label="Enter your simulation prompt",
78
+ placeholder="e.g., 'Optimize a water molecule with DFTB+ calculator'",
79
+ lines=3
80
+ )
81
+ submit_btn = gr.Button("Run Simulation")
82
+
83
+ with gr.Row():
84
+ with gr.Column():
85
+ result_image = gr.Image(label="Simulation Result")
86
+ with gr.Column():
87
+ analysis = gr.Textbox(label="LLM Analysis")
88
+
89
+ with gr.Row():
90
+ with gr.Column():
91
+ prompt_sent = gr.Textbox(label="Prompt Sent to Gemini")
92
+ with gr.Column():
93
+ generated_code = gr.Code(label="Generated ASE Code")
94
+
95
+ submit_btn.click(
96
+ fn=mcp_tool,
97
+ inputs=user_prompt,
98
+ outputs=[result_image, analysis, prompt_sent, generated_code]
99
+ )
100
 
101
  if __name__ == "__main__":
102
  iface.launch()