mirror of
https://github.com/aljazceru/chatgpt-telegram-bot.git
synced 2025-12-20 14:14:52 +01:00
added support for vision
This commit is contained in:
@@ -5,6 +5,7 @@ import itertools
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import base64
|
||||
|
||||
import telegram
|
||||
from telegram import Message, MessageEntity, Update, ChatMember, constants
|
||||
@@ -376,4 +377,10 @@ def cleanup_intermediate_files(response: any):
|
||||
|
||||
if format == 'path':
|
||||
if os.path.exists(value):
|
||||
os.remove(value)
|
||||
os.remove(value)
|
||||
|
||||
|
||||
# Function to encode the image
|
||||
def encode_image(image_path):
|
||||
with open(image_path, "rb") as image_file:
|
||||
return base64.b64encode(image_file.read()).decode('utf-8')
|
||||
Reference in New Issue
Block a user