imessam commited on
Commit
0b0dd57
·
verified ·
1 Parent(s): 7c32caf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -32,20 +32,20 @@ def generate_podcast(prompt : str, history: list) -> str:
32
 
33
  response = ""
34
 
35
- try:
36
- mcp_client = MCPClient(
37
  {"url": "https://agents-mcp-hackathon-websearch.hf.space/gradio_api/mcp/sse", "transport": "sse"}# This is the MCP Server we created in the previous section
38
  )
39
- tools = mcp_client.get_tools()
40
 
41
- model = InferenceClientModel()
42
- agent = CodeAgent(tools=[*tools], model=model)
43
 
44
- response = str(agent.run(prompt))
45
 
46
 
47
- finally:
48
- mcp_client.disconnect()
49
 
50
 
51
  return response
 
32
 
33
  response = ""
34
 
35
+ #try:
36
+ mcp_client = MCPClient(
37
  {"url": "https://agents-mcp-hackathon-websearch.hf.space/gradio_api/mcp/sse", "transport": "sse"}# This is the MCP Server we created in the previous section
38
  )
39
+ tools = mcp_client.get_tools()
40
 
41
+ model = InferenceClientModel()
42
+ agent = CodeAgent(tools=[*tools], model=model)
43
 
44
+ response = str(agent.run(prompt))
45
 
46
 
47
+ #finally:
48
+ mcp_client.disconnect()
49
 
50
 
51
  return response