mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-20 06:05:12 +01:00
added ENABLE_VISION_FOLLOW_UP_QUESTIONS support
This commit is contained in:
@@ -382,4 +382,9 @@ def cleanup_intermediate_files(response: any):
|
||||
|
||||
# Function to encode the image
|
||||
def encode_image(fileobj):
|
||||
return base64.b64encode(fileobj.getvalue()).decode('utf-8')
|
||||
image = base64.b64encode(fileobj.getvalue()).decode('utf-8')
|
||||
return f'data:image/jpeg;base64,{image}'
|
||||
|
||||
def decode_image(imgbase64):
|
||||
image = imgbase64[len('data:image/jpeg;base64,'):]
|
||||
return base64.b64decode(image)
|
||||
|
||||
Reference in New Issue
Block a user