BioCodeFusion commited on
Commit
0f6f64b
·
verified ·
1 Parent(s): 5c2b81b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -5
app.py CHANGED
@@ -19,17 +19,14 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
19
  return "What magic will you build ?"
20
 
21
  @tool
22
- def grocery_info(version=1, grocery_id=1, sprak=2) -> str:
23
  """A tool that fetches the grocery information from the Swedish Food Agency api
24
  Args:
25
- version: version of tool argument.
26
  grocery_id: The id of the grocery (e.g, and int expected)
27
- language: Choose between Swedish or English language: (1 for Swedish, set to two for English)
28
-
29
  """
30
 
31
  base_url = "https://dataportal.livsmedelsverket.se/livsmedel"
32
- grocery_api_url = f"{base_url}/api/v{version}/livsmedel/{grocery_id}?sprak={sprak}"
33
 
34
  response = requests.get(grocery_api_url)
35
  data = response.json()
 
19
  return "What magic will you build ?"
20
 
21
  @tool
22
+ def grocery_info(grocery_id:int) -> str:
23
  """A tool that fetches the grocery information from the Swedish Food Agency api
24
  Args:
 
25
  grocery_id: The id of the grocery (e.g, and int expected)
 
 
26
  """
27
 
28
  base_url = "https://dataportal.livsmedelsverket.se/livsmedel"
29
+ grocery_api_url = f"{base_url}/api/v1/livsmedel/{grocery_id}?sprak=2"
30
 
31
  response = requests.get(grocery_api_url)
32
  data = response.json()