Vaib9 commited on
Commit
55ba7d2
·
verified ·
1 Parent(s): 29e91b8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -10
app.py CHANGED
@@ -8,17 +8,20 @@ from tools.final_answer import FinalAnswerTool
8
  from Gradio_UI import GradioUI
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
- """
12
  @tool
13
- def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
14
- Keep this format for the description / args / args description but feel free to modify the tool
15
- A tool that does nothing yet
16
  Args:
17
- arg1: the first argument
18
- arg2: the second argument
19
-
20
- returnWhat magic will you build ?
21
- """
 
 
 
22
 
23
  @tool
24
  def get_current_time_in_timezone(timezone: str) -> str:
@@ -44,7 +47,7 @@ final_answer = FinalAnswerTool()
44
  model = HfApiModel(
45
  max_tokens=2096,
46
  temperature=0.5,
47
- model_id='deepseek-ai/DeepSeek-R1-Distill-Llama-8B',# it is possible that this model may be overloaded
48
  custom_role_conversions=None,
49
  )
50
 
 
8
  from Gradio_UI import GradioUI
9
 
10
  # Below is an example of a tool that does nothing. Amaze us with your creativity !
11
+
12
  @tool
13
+ def web_search_tool(search_text:str)-> str: #it's import to specify the return type
14
+ # Keep this format for the description / args / args description but feel free to modify the tool
15
+ """A tool that does nothing yet
16
  Args:
17
+ search_text: a string representing a search query from user
18
+ """
19
+ try:
20
+ # Create a search object
21
+ query = DuckDuckGoSearchTool(search_text)
22
+ return f"The result for your search query is {query}."
23
+ except Exception as e:
24
+ return f"Error fetching the search query text."
25
 
26
  @tool
27
  def get_current_time_in_timezone(timezone: str) -> str:
 
47
  model = HfApiModel(
48
  max_tokens=2096,
49
  temperature=0.5,
50
+ model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud',# it is possible that this model may be overloaded
51
  custom_role_conversions=None,
52
  )
53