Spaces:
Runtime error
Runtime error
Indented rest of program after with statement
Browse files
app.py
CHANGED
@@ -11,15 +11,15 @@ with MCPClient(
|
|
11 |
{"url": "https://techno-1-mcp-sentiment.hf.space/gradio_api/mcp/sse", "transport": "streamable-http"}
|
12 |
) as tools:
|
13 |
|
14 |
-
model = InferenceClientModel()
|
15 |
-
agent = CodeAgent(tools=[*tools], model=model)
|
16 |
-
|
17 |
-
demo = gr.ChatInterface(
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
)
|
24 |
-
|
25 |
-
demo.launch()
|
|
|
11 |
{"url": "https://techno-1-mcp-sentiment.hf.space/gradio_api/mcp/sse", "transport": "streamable-http"}
|
12 |
) as tools:
|
13 |
|
14 |
+
model = InferenceClientModel()
|
15 |
+
agent = CodeAgent(tools=[*tools], model=model)
|
16 |
+
|
17 |
+
demo = gr.ChatInterface(
|
18 |
+
fn=lambda message, history: str(agent.run(message)),
|
19 |
+
type="messages",
|
20 |
+
examples=["What's the weather like?"],
|
21 |
+
title="Agent with MCP Tools",
|
22 |
+
description="This is a simple agent that uses MCP tools to answer questions.",
|
23 |
+
)
|
24 |
+
|
25 |
+
demo.launch()
|