eocone commited on
Commit
31605d5
·
verified ·
1 Parent(s): 7b4d620

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -10,15 +10,15 @@ from tools.final_answer import FinalAnswerTool
10
  from Gradio_UI import GradioUI
11
 
12
  @tool
13
- def dog_average_longevity(breed: str) -> str:
14
  """A tool that uses DuckDuckGo to search the web and returns the average lifespan for a given dog breed.
15
  Parameters:
16
- breed (str): The breed of the dog (e.g., "Labrador").
17
  Returns:
18
  str: The average lifespan of the specified dog breed in years.
19
  """
20
 
21
- query = f"average lifespan for {breed} dog in years"
22
 
23
  with DDGS() as ddgs:
24
  results = list(ddgs.text(query, max_results=5))
@@ -27,7 +27,7 @@ def dog_average_longevity(breed: str) -> str:
27
  for result in results:
28
  lifespan = extract_lifespan(result)
29
  if lifespan:
30
- return f"The average lifespan of a {breed} dog is {lifespan} years."
31
 
32
  return "No reliable lifespan information found. Please check with a veterinarian."
33
 
 
10
  from Gradio_UI import GradioUI
11
 
12
  @tool
13
+ def dog_average_longevity(dog_breed: str) -> str:
14
  """A tool that uses DuckDuckGo to search the web and returns the average lifespan for a given dog breed.
15
  Parameters:
16
+ dog_breed (str): The breed of the dog (e.g., "Labrador").
17
  Returns:
18
  str: The average lifespan of the specified dog breed in years.
19
  """
20
 
21
+ query = f"average lifespan for {dog_breed} dog in years"
22
 
23
  with DDGS() as ddgs:
24
  results = list(ddgs.text(query, max_results=5))
 
27
  for result in results:
28
  lifespan = extract_lifespan(result)
29
  if lifespan:
30
+ return f"The average lifespan of a {dog_breed} dog is {lifespan} years."
31
 
32
  return "No reliable lifespan information found. Please check with a veterinarian."
33