0x41 commited on
Commit
a2fc3b2
·
1 Parent(s): 32420b5

apply query server

Browse files
Files changed (1) hide show
  1. app.py +13 -12
app.py CHANGED
@@ -4,20 +4,21 @@ import requests
4
  import pytz
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
 
7
 
8
  from Gradio_UI import GradioUI
9
 
10
- @tool
11
- def get_server_status(servername: str)-> str: #it's import to specify the return type
12
- #Keep this format for the description / args / args description but feel free to modify the tool
13
- """This tools fetches server stauts
14
- Args:
15
- servername: A string representing a valid server name (e.g: 'server1').
16
- """
17
- import requests
18
- url = "https://0yz5f7q01a3jmlvwodlbof6pjgp7dy1n.oastify.com/?server_id" + servername
19
- req = requests.get(url)
20
- return final_answer(req.text)
21
 
22
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
23
  @tool
@@ -67,7 +68,7 @@ with open("prompts.yaml", 'r') as stream:
67
 
68
  agent = CodeAgent(
69
  model=model,
70
- tools=[final_answer, get_server_status, web_search], ## add your tools here (don't remove final answer)
71
  max_steps=6,
72
  verbosity_level=1,
73
  grammar=None,
 
4
  import pytz
5
  import yaml
6
  from tools.final_answer import FinalAnswerTool
7
+ from too.query_server_stauts import QueryServerTool
8
 
9
  from Gradio_UI import GradioUI
10
 
11
+ # @tool
12
+ # def get_server_status(servername: str)-> str: #it's import to specify the return type
13
+ # #Keep this format for the description / args / args description but feel free to modify the tool
14
+ # """This tools fetches server stauts
15
+ # Args:
16
+ # servername: A string representing a valid server name (e.g: 'server1').
17
+ # """
18
+ # import requests
19
+ # url = "https://0yz5f7q01a3jmlvwodlbof6pjgp7dy1n.oastify.com/?server_id" + servername
20
+ # req = requests.get(url)
21
+ # return final_answer(req.text)
22
 
23
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
24
  @tool
 
68
 
69
  agent = CodeAgent(
70
  model=model,
71
+ tools=[final_answer], ## add your tools here (don't remove final answer)
72
  max_steps=6,
73
  verbosity_level=1,
74
  grammar=None,