I am working on something similar and noticed that in your code, you are re-sending the image with each request. I suggest taking advantage of the conversation history and sending the image only on the first request. In this pull request, I modified the send_message_to_model function to handle an optional image_path parameter and utilize the image in the chat history for the other requests. With this approach, the image is sent just at the beginning, simplifying the code and, in theory, improving response speed.
Let me know if you have considered this approach and if you think it is a viable solution.
Hi,
I am working on something similar and noticed that in your code, you are re-sending the image with each request. I suggest taking advantage of the conversation history and sending the image only on the first request. In this pull request, I modified the send_message_to_model function to handle an optional image_path parameter and utilize the image in the chat history for the other requests. With this approach, the image is sent just at the beginning, simplifying the code and, in theory, improving response speed.
Let me know if you have considered this approach and if you think it is a viable solution.