diff --git a/matrix_gpt/generate_clients/openai.py b/matrix_gpt/generate_clients/openai.py index d99c4ae..2bb5936 100644 --- a/matrix_gpt/generate_clients/openai.py +++ b/matrix_gpt/generate_clients/openai.py @@ -25,6 +25,10 @@ class OpenAIClient(ApiClient): self._context.append({'role': role, 'content': content}) async def append_img(self, img_event: RoomMessageImage, role: str): + """ + We crop the largest dimension of the image to 512px and then let the AI decide + if it should use low or high res analysis. + """ assert role in [self._HUMAN_NAME, self._BOT_NAME] img_bytes = await download_mxc(img_event.url, self._client_helper.client) encoded_image = await process_image(img_bytes, resize_px=512) @@ -34,7 +38,7 @@ class OpenAIClient(ApiClient): 'type': 'image_url', 'image_url': { 'url': f"data:image/png;base64,{encoded_image}", - 'detail': 'low' + 'detail': 'auto' } }] })