Spaces:
Runtime error
Runtime error
Commit ·
a3a374d
1
Parent(s): 2b6ca1f
Add prompt info
Browse filesSigned-off-by: Aivin V. Solatorio <avsolatorio@gmail.com>
- mcp_client.py +17 -14
mcp_client.py
CHANGED
|
@@ -24,7 +24,9 @@ Do not make up data or information and never simulate the `get_wdi_data` tool. I
|
|
| 24 |
|
| 25 |
You can use multiple tools if needed.
|
| 26 |
|
| 27 |
-
If the user asks for any information beyond what the tools available to you provide, you must say that you do not have that information.
|
|
|
|
|
|
|
| 28 |
|
| 29 |
LLM_MODEL = "claude-3-5-haiku-20241022"
|
| 30 |
|
|
@@ -271,23 +273,24 @@ client = MCPClientWrapper()
|
|
| 271 |
def gradio_interface():
|
| 272 |
with gr.Blocks(title="MCP WDI Client") as demo:
|
| 273 |
gr.Markdown("# WDI MCP Client")
|
| 274 |
-
gr.Markdown("Connect to the WDI MCP server and chat with the assistant")
|
| 275 |
-
|
| 276 |
-
with gr.
|
| 277 |
-
with gr.
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
|
|
|
| 285 |
|
| 286 |
-
|
| 287 |
|
| 288 |
chatbot = gr.Chatbot(
|
| 289 |
value=[],
|
| 290 |
-
height=
|
| 291 |
type="messages",
|
| 292 |
show_copy_button=True,
|
| 293 |
avatar_images=("👤", "🤖"),
|
|
|
|
| 24 |
|
| 25 |
You can use multiple tools if needed.
|
| 26 |
|
| 27 |
+
If the user asks for any information beyond what the tools available to you provide, you must say that you do not have that information.
|
| 28 |
+
|
| 29 |
+
Avoid making statements based on stereotypes or biases. Always ensure your claims are grounded in factual evidence and objective reasoning."""
|
| 30 |
|
| 31 |
LLM_MODEL = "claude-3-5-haiku-20241022"
|
| 32 |
|
|
|
|
| 273 |
def gradio_interface():
|
| 274 |
with gr.Blocks(title="MCP WDI Client") as demo:
|
| 275 |
gr.Markdown("# WDI MCP Client")
|
| 276 |
+
# gr.Markdown("Connect to the WDI MCP server and chat with the assistant")
|
| 277 |
+
|
| 278 |
+
with gr.Accordion("Connect to the WDI MCP server and chat with the assistant"):
|
| 279 |
+
with gr.Row(equal_height=True):
|
| 280 |
+
with gr.Column(scale=4):
|
| 281 |
+
server_path = gr.Textbox(
|
| 282 |
+
label="Server Script Path",
|
| 283 |
+
placeholder="Enter path to server script (e.g., wdi_mcp_server.py)",
|
| 284 |
+
value="wdi_mcp_server.py",
|
| 285 |
+
)
|
| 286 |
+
with gr.Column(scale=1):
|
| 287 |
+
connect_btn = gr.Button("Connect")
|
| 288 |
|
| 289 |
+
status = gr.Textbox(label="Connection Status", interactive=False)
|
| 290 |
|
| 291 |
chatbot = gr.Chatbot(
|
| 292 |
value=[],
|
| 293 |
+
height=600,
|
| 294 |
type="messages",
|
| 295 |
show_copy_button=True,
|
| 296 |
avatar_images=("👤", "🤖"),
|