Deinigu commited on
Commit
85f2c09
·
verified ·
1 Parent(s): aa45770

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -13,17 +13,17 @@ from Gradio_UI import GradioUI
13
  @tool
14
  def my_custom_tool(pokemon_name: str) -> str: # it's import to specify the return type
15
  # Keep this format for the description / args / args description but feel free to modify the tool
16
- """A tool that does nothing yet
17
  Args:
18
  pokemon_name: A string representing a existing pokemon name (e.g., 'Metapod')
19
- Returns a json with all the info from a Pokemon
20
  """
21
  try:
22
  pokemon = requests.get(
23
  f"https://pokeapi.co/api/v2/pokemon/{pokemon_name.casefold()}"
24
  )
25
 
26
- return json.dumps(pokemon.json(), indent=4)
27
  except Exception as ex:
28
  return "An error ocurred: " + ex.with_traceback()
29
 
 
13
  @tool
14
  def my_custom_tool(pokemon_name: str) -> str: # it's import to specify the return type
15
  # Keep this format for the description / args / args description but feel free to modify the tool
16
+ """A tool that fetches information about a pokemon given its name.
17
  Args:
18
  pokemon_name: A string representing a existing pokemon name (e.g., 'Metapod')
19
+ Returns a json with all the info from a Pokemon.
20
  """
21
  try:
22
  pokemon = requests.get(
23
  f"https://pokeapi.co/api/v2/pokemon/{pokemon_name.casefold()}"
24
  )
25
 
26
+ return pokemon.json()
27
  except Exception as ex:
28
  return "An error ocurred: " + ex.with_traceback()
29