agency-swarm icon indicating copy to clipboard operation
agency-swarm copied to clipboard

Getting a "Invalid base64 image_url" error

Open vinay235 opened this issue 1 year ago • 2 comments

Trying to run a simple query - "Describe oai-widget.com" and getting the below error -

agency_error

vinay235 avatar Jan 04 '24 10:01 vinay235

Strange, can't reproduce. Do you see the browser window open when running this?

VRSEN avatar Jan 05 '24 04:01 VRSEN

Yes I do, the ReadURL is working fine and then it stops on this error, the screenshot.jpeg file 0kb as well which I think is one of the validation step?

Let me know if you want a screen recording of my steps.

vinay235 avatar Jan 05 '24 10:01 vinay235

Hey, @vinay235 this apparently happens for some users on windows. A few more people reported. Can you please try to adjust get_b64_screenshot function in tools/browsing/util and report back here if you manage to fix it? I'll browse stack overflow as well, but I am running on mac

VRSEN avatar Jan 09 '24 03:01 VRSEN

@vinay235 pull from main and try again please. Let me know if this helps

VRSEN avatar Jan 09 '24 04:01 VRSEN

Thanks for the updates @VRSEN ,I should have mentioned that I am on Windows. I tried the latest code but there seems to be some contention issue with the temp file due to the os.remove() line?

Error: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\Users\dattav\AppData\Local\Temp\tmpdoa_b5qk.png'

I commented that and it seems to work fine.

Instead of saving the file and encoding it, can I suggest using the driver.get_screenshot_as_base64() method directly?

I tried it and it worked fine, Ill raise a PR for the same. LMK

vinay235 avatar Jan 09 '24 09:01 vinay235

Opened PR - #39

vinay235 avatar Jan 09 '24 10:01 vinay235

Thanks, this should be fixed now

VRSEN avatar Jan 10 '24 06:01 VRSEN