phspoden commited on
Commit
c178866
·
1 Parent(s): 7cc484e

Lesson learned: By making the error message texts of my tools more meaningful (adding API status code and reason(text) -> the agent actually understood what the problem was (too many requests) -> And adjusted its actions (added time.sleep to its code)!

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -65,7 +65,7 @@ def get_corporate_bullshit_text()-> str:
65
  data = response.json()
66
  return data['phrase']
67
  else:
68
- return f'Error - get_corporate_bullshit_text() -> Response status code was not good ({response.status_code})'
69
 
70
  except Exception as e:
71
  return f"Error - get_corporate_bullshit_text() -> -> Exception: {e}"
@@ -86,7 +86,7 @@ def get_techy_phrases_text()-> str:
86
  data = response.json()
87
  return data['message']
88
  else:
89
- return f'Error - get_techy_bullshit_text() -> Response status code was not good ({response.status_code})'
90
 
91
  except Exception as e:
92
  return f"Error - get_techy_bullshit_text() -> -> Exception: {e}"
 
65
  data = response.json()
66
  return data['phrase']
67
  else:
68
+ return f'Error - get_corporate_bullshit_text() -> Response status code: {response.status_code}. Response reason: {response.reason}'
69
 
70
  except Exception as e:
71
  return f"Error - get_corporate_bullshit_text() -> -> Exception: {e}"
 
86
  data = response.json()
87
  return data['message']
88
  else:
89
+ return f'Error - get_techy_bullshit_text() -> Response status code: {response.status_code}. Response reason: {response.reason}'
90
 
91
  except Exception as e:
92
  return f"Error - get_techy_bullshit_text() -> -> Exception: {e}"