added ENABLE_VISION_FOLLOW_UP_QUESTIONS support

This commit is contained in:
gilcu3
2023-11-25 14:26:37 +01:00
parent 6de497dac8
commit 237705cec0
5 changed files with 77 additions and 47 deletions

View File

@@ -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)