AugustinMORVAL commited on
Commit
0532d61
·
1 Parent(s): 440ef6d

Add tool description

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -13,13 +13,17 @@ try:
13
 
14
  model = InferenceClientModel(token=os.getenv("HUGGINGFACE_API_TOKEN"))
15
  agent = CodeAgent(tools=[*tools], model=model, additional_authorized_imports=["json", "ast", "urllib", "base64"])
 
16
 
17
  demo = gr.ChatInterface(
18
  fn=lambda message, history: str(agent.run(message)),
19
  type="messages",
20
  examples=["Analyze the sentiment of the following text 'This is awesome'"],
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()
 
13
 
14
  model = InferenceClientModel(token=os.getenv("HUGGINGFACE_API_TOKEN"))
15
  agent = CodeAgent(tools=[*tools], model=model, additional_authorized_imports=["json", "ast", "urllib", "base64"])
16
+ tools_description = "\n".join(f"• **{tool.name}**: {tool.description}" for tool in tools)
17
 
18
  demo = gr.ChatInterface(
19
  fn=lambda message, history: str(agent.run(message)),
20
  type="messages",
21
  examples=["Analyze the sentiment of the following text 'This is awesome'"],
22
  title="Agent with MCP Tools",
23
+ description=f"""This is a simple agent that uses MCP tools to answer questions:
24
+
25
+ Available tools:
26
+ {tools_description}""",
27
  )
28
 
29
  demo.launch()