TheZakynthian commited on
Commit
da44085
·
verified ·
1 Parent(s): 1acb9fd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -38,18 +38,14 @@ def get_current_time_in_timezone(timezone: str) -> str:
38
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
39
 
40
  @tool
41
- def convert_image_to_base64(image: PILImage) -> dict:
42
  """A tool that you MUST use exactly after the image_generation_tool since it encodes it's output to a printable image
43
  Args:
44
  image: An image that is the output of the image_generation_tool and is not in printable form
45
  """
46
  buffered = BytesIO()
47
  image.save(buffered, format="PNG")
48
- return {
49
- "type": "image",
50
- "format": "base64",
51
- "data": f"data:image/png;base64,{encoded}"
52
- }
53
 
54
 
55
  final_answer = FinalAnswerTool()
 
38
  return f"Error fetching time for timezone '{timezone}': {str(e)}"
39
 
40
  @tool
41
+ def convert_image_to_base64(image: PILImage) -> str:
42
  """A tool that you MUST use exactly after the image_generation_tool since it encodes it's output to a printable image
43
  Args:
44
  image: An image that is the output of the image_generation_tool and is not in printable form
45
  """
46
  buffered = BytesIO()
47
  image.save(buffered, format="PNG")
48
+ return f'<img src="data:image/png;base64,{encoded}" alt="Generated Image" style="max-width:100%; height:auto;" />'
 
 
 
 
49
 
50
 
51
  final_answer = FinalAnswerTool()