Aktraiser commited on
Commit
80f143f
·
verified ·
1 Parent(s): 464c744

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -185,15 +185,22 @@ def get_nba_matches(target_date: str = None) -> str:
185
  "\n\n".join(matches) # All match details
186
  ]
187
  matches_str = "\n".join(response)
188
- print(matches_str) # Print for execution logs
 
189
  return matches_str
190
  else:
191
- return f"No NBA matches found with complete information for {target_date}."
 
 
192
 
193
  except requests.exceptions.RequestException as e:
194
- return f"Error retrieving NBA matches: {str(e)}"
 
 
195
  except (KeyError, json.JSONDecodeError) as e:
196
- return f"Error parsing NBA data: {str(e)}"
 
 
197
 
198
  @tool
199
  def predict_nba_match(match_info: str) -> str:
 
185
  "\n\n".join(matches) # All match details
186
  ]
187
  matches_str = "\n".join(response)
188
+ # Print for execution logs and return the same string
189
+ print(f"NBA Matches for {target_date}:\n{matches_str}")
190
  return matches_str
191
  else:
192
+ no_matches_msg = f"No NBA matches found with complete information for {target_date}."
193
+ print(no_matches_msg)
194
+ return no_matches_msg
195
 
196
  except requests.exceptions.RequestException as e:
197
+ error_msg = f"Error retrieving NBA matches: {str(e)}"
198
+ print(error_msg)
199
+ return error_msg
200
  except (KeyError, json.JSONDecodeError) as e:
201
+ error_msg = f"Error parsing NBA data: {str(e)}"
202
+ print(error_msg)
203
+ return error_msg
204
 
205
  @tool
206
  def predict_nba_match(match_info: str) -> str: