Using the Gemini File API for Prompts with Media / / No Comments Using media in your prompts (what’s called ‘multimodal’) with the Gemini API is fairly simple in small cases. You can encode your input with base64 and pass it along with your prompt. While this works well, it’s got limitations that may be quickly hit – most specifically a file size limit of 20 megs. A few months ago, I shared a demo of using your device’s camera to detect cat breeds. With today’s cameras taking incredibly detailed pictures, I hit that limit right away and had to write some code to resize the image to a smaller size. Luckily, the Gemini API has a better way of handling that, the File API. The File API # This API provides a separate method... more → Posted in: JavaScript Tagged with: file, Gemini, Media, Prompts, using
Testing Multiple Variations of Generative AI Prompts / / No Comments In nearly all of my recent explorations of Generative AI, I’ve come to realize how important prompts are. That hasn’t necessarily translated me into writing better prompts all the time, but being aware of the problem is at least one step towards correcting it, right? One of the things that I thought would help me personally would be to have a tool to quickly compare and contrast different prompts. Obviously, I could just open up multiple tabs in a browser, but I really wanted something more direct and simplified for my purposes. With that in mind, let me share what I’ve built. Prompt Tester # Prompt Tester is my incredibly imaginatively named tool to… um… test prompts.... more → Posted in: JavaScript Tagged with: Generative, multiple, Prompts, Testing, Variations