betki commited on
Commit
3ce858a
Β·
verified Β·
1 Parent(s): 0716324

Update mcp_client.py

Browse files
Files changed (1) hide show
  1. mcp_client.py +11 -3
mcp_client.py CHANGED
@@ -1,6 +1,5 @@
1
  """
2
  This is a Gradio MCP client that connects to my MCP server (mcp-rag-workflow).
3
-
4
  This script initializes a Gradio interface for an agent that uses tools from the MCP server.
5
  It connects to the MCP server, retrieves available tools, and sets up a chat interface where users can interact with the agent.
6
  """
@@ -25,11 +24,20 @@ try:
25
  model = InferenceClientModel(token=os.getenv("HUGGINGFACE_API_TOKEN"))
26
  agent = CodeAgent(tools=[*tools], model=model)
27
 
 
 
 
 
 
 
 
28
  demo = gr.ChatInterface(
29
  fn=lambda message, history: str(agent.run(message)),
 
30
  type="messages",
31
- title="Agent with MCP Tools",
32
- description="MCP Client build with Gradio to use (mcp-rag-workflow) MCP tools.",
 
33
  )
34
 
35
  demo.launch()
 
1
  """
2
  This is a Gradio MCP client that connects to my MCP server (mcp-rag-workflow).
 
3
  This script initializes a Gradio interface for an agent that uses tools from the MCP server.
4
  It connects to the MCP server, retrieves available tools, and sets up a chat interface where users can interact with the agent.
5
  """
 
24
  model = InferenceClientModel(token=os.getenv("HUGGINGFACE_API_TOKEN"))
25
  agent = CodeAgent(tools=[*tools], model=model)
26
 
27
+ mcp_description = """
28
+ **Example Queries**:
29
+ - "What are the main features of fuel system of SU-35?"
30
+ - "What is the combat potential of SU-35?"
31
+ - "Write me a report on origin of the universe."
32
+ - "Write me a report on the impact of climate change on polar bears."
33
+ """
34
  demo = gr.ChatInterface(
35
  fn=lambda message, history: str(agent.run(message)),
36
+ chatbot=gr.Chatbot(height=450, placeholder="Ask me about Sukhoi SU-35 or ask to write report on any topic."),
37
  type="messages",
38
+ title="A Gradio MCP client that uses Tools from my Hackathon MCP server",
39
+ examples=[ "What are the main features of fuel system of SU-35?", "What is the combat potential of SU-35?", "Write me a report on origin of the universe."],
40
+ description=mcp_description,
41
  )
42
 
43
  demo.launch()