Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,7 +14,7 @@ login(token = os.getenv('nangelov_hf_token'))
|
|
14 |
FOOTBALL_DATA_TOKEN = os.getenv('football_data_token')
|
15 |
|
16 |
@tool
|
17 |
-
def getCompetitionInitials(
|
18 |
"""
|
19 |
Returns the competition initials (code) for a given competition name.
|
20 |
|
@@ -47,7 +47,7 @@ def getCompetitionInitials(competition: str) -> str:
|
|
47 |
return None
|
48 |
|
49 |
@tool
|
50 |
-
def getCompetitionMatchesResultsByDate(
|
51 |
"""
|
52 |
Gets football match results for a given competition on a specified date.
|
53 |
|
@@ -67,7 +67,7 @@ def getCompetitionMatchesResultsByDate(competitionInitials: str, match_date: dat
|
|
67 |
date_str = match_date.isoformat() # converts date to 'YYYY-MM-DD'
|
68 |
|
69 |
# Create the URL using an f-string
|
70 |
-
url = f'https://api.football-data.org/v4/competitions/{
|
71 |
|
72 |
# Set up the headers with your API token.
|
73 |
headers = {
|
|
|
14 |
FOOTBALL_DATA_TOKEN = os.getenv('football_data_token')
|
15 |
|
16 |
@tool
|
17 |
+
def getCompetitionInitials(competition_name: str) -> str:
|
18 |
"""
|
19 |
Returns the competition initials (code) for a given competition name.
|
20 |
|
|
|
47 |
return None
|
48 |
|
49 |
@tool
|
50 |
+
def getCompetitionMatchesResultsByDate(competition_code: str, match_date: date) -> dict:
|
51 |
"""
|
52 |
Gets football match results for a given competition on a specified date.
|
53 |
|
|
|
67 |
date_str = match_date.isoformat() # converts date to 'YYYY-MM-DD'
|
68 |
|
69 |
# Create the URL using an f-string
|
70 |
+
url = f'https://api.football-data.org/v4/competitions/{competition_code}/matches?date={date_str}'
|
71 |
|
72 |
# Set up the headers with your API token.
|
73 |
headers = {
|