mrpe24 commited on
Commit
3bbdc2d
·
1 Parent(s): d368e74

Fixed formatting output of tool

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -1,4 +1,5 @@
1
  import datetime
 
2
 
3
  import pytz
4
  import yaml
@@ -18,8 +19,14 @@ def convert_to_ascii(text: str) -> str:
18
  text: input text to be converted.
19
  Returns:
20
  A string in ascii format.
21
- """
22
- return f"<pre>{figlet_format(text, font='roman')}</pre>"
 
 
 
 
 
 
23
 
24
  @tool
25
  def get_current_time_in_timezone(timezone: str) -> str:
 
1
  import datetime
2
+ import random
3
 
4
  import pytz
5
  import yaml
 
19
  text: input text to be converted.
20
  Returns:
21
  A string in ascii format.
22
+ """
23
+ if not text:
24
+ return "Sorry: No Text - No Art 😙"
25
+
26
+ font = random.choice(['ogre', 'roman', 'rozzo', 'colossal', 'big', 'doh', 'doom', 'isometric1', 'larry3d', 'nancyj', 'smisome1', 'speed', 'univers', 'weird'])
27
+ result = figlet_format(text, font=font)
28
+ return f"```\n{result}```"
29
+
30
 
31
  @tool
32
  def get_current_time_in_timezone(timezone: str) -> str: