powered by
Extracts base64-encoded image data from the Gemini API response text and saves it as a binary image file.
save_image(res_txt, output_path)
The path to the saved image file, or NULL if no image data was found.
Character string. The raw response text from the Gemini API.
Character string. The file path to save the decoded image.
if (FALSE) { save_image(res_txt, "output.png") }
Run the code above in your browser using DataLab