Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -36,7 +36,6 @@ def get_box_score_links() -> list:
|
|
36 |
# Return error message as a list to maintain consistent return type
|
37 |
return [f"Error fetching boxScore links: {str(e)}"]
|
38 |
|
39 |
-
@tool
|
40 |
def get_box_score_data(links: list) -> dict:
|
41 |
"""A tool that fetches the boxscores data from the provided list of URLs.
|
42 |
Args:
|
@@ -84,13 +83,14 @@ def get_box_score_data(links: list) -> dict:
|
|
84 |
return {"Error": f"Error fetching boxScore data: {str(e)}"}
|
85 |
|
86 |
@tool
|
87 |
-
def get_stats_from_boxScore_data(
|
88 |
-
"""A tool that fetches the player names and box score statistic for the provided
|
89 |
Args:
|
90 |
-
|
91 |
-
stat: A string representing the statistic that this function will return for each player
|
92 |
"""
|
93 |
try:
|
|
|
94 |
stats = {}
|
95 |
stat_key = ('Basic Box Score Stats', stat)
|
96 |
for teams in box_scores.keys():
|
|
|
36 |
# Return error message as a list to maintain consistent return type
|
37 |
return [f"Error fetching boxScore links: {str(e)}"]
|
38 |
|
|
|
39 |
def get_box_score_data(links: list) -> dict:
|
40 |
"""A tool that fetches the boxscores data from the provided list of URLs.
|
41 |
Args:
|
|
|
83 |
return {"Error": f"Error fetching boxScore data: {str(e)}"}
|
84 |
|
85 |
@tool
|
86 |
+
def get_stats_from_boxScore_data(url: str, stat: str) -> dict:
|
87 |
+
"""A tool that fetches the player names and box score statistic for the provided box score url
|
88 |
Args:
|
89 |
+
url: A string representing the URL to the box score for a game
|
90 |
+
stat: A string representing the statistic that this function will return for each player the box score
|
91 |
"""
|
92 |
try:
|
93 |
+
box_scores = get_box_score_data(url)
|
94 |
stats = {}
|
95 |
stat_key = ('Basic Box Score Stats', stat)
|
96 |
for teams in box_scores.keys():
|