hardknee commited on
Commit
f22d7fd
·
verified ·
1 Parent(s): 399dfd4

Update app.py

Browse files

First draft of generate_image function

Files changed (1) hide show
  1. app.py +10 -0
app.py CHANGED
@@ -50,6 +50,16 @@ def get_current_time_in_timezone(timezone: str) -> str:
50
  except Exception as e:
51
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
52
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  final_answer = FinalAnswerTool()
55
 
 
50
  except Exception as e:
51
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
52
 
53
+ @tool
54
+ def generate_image(description: str) -> image:
55
+ """A tool that generates an image from a text description.
56
+ Args:
57
+ description: A string representing the text description to generate an image of.
58
+ """
59
+ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_code=True)
60
+ return image_generation_tool(description)
61
+
62
+
63
 
64
  final_answer = FinalAnswerTool()
65