Caching Input with Google Gemini / / No Comments A little over a month ago, Google announced multiple updates to their GenAI platform. I made a note of it for research later and finally got time to look at one aspect – context caching. When you send prompts to a GenAI system, your input is tokenized for analysis. While not a "one token per word" relation, basically the bigger the input (context) the more the cost (tokens). The process of converting your input into tokens takes time, especially when dealing with large media, for example, a video. Google introduced a "Context caching" system that helps improve the performance of your queries. As the docs suggest, this is really suited for cases where you’ve got... more → Posted in: JavaScript Tagged with: Caching, Gemini, Google, input
Input valueAsNumber / / No Comments Every once in a while I learn about a JavaScript property that I wish I had known about years earlier — valueAsNumber is one of them. The valueAsNumber provides the value of an input[type=number] as a Number type, instead of the traditional string representation when you get the value: /* Assuming an <input type="number" value="1.234" /> */ // BAD: Get the value and convert the number input.value // "1.234" const numberValue = parseFloat(input.value, 10); // GOOD: Use valueAsNumber input.valueAsNumber // 1.234 This property allows us to avoid parseInt/parseFloat, but one gotcha with valueAsNumber is that it will return NaN if the input is empty. Thank you to Steve Sewell for... more → Posted in: JavaScript Tagged with: input, valueAsNumber
Tybee encourages public input for computer app that studies coastal flood hazards – WSAV-TV / / No Comments Tybee encourages public input for computer app that studies coastal flood hazards WSAV-TV “map app” – Google News… more → Posted in: Interactive Maps Tagged with: coastal, computer, encourages, Flood, hazards, input, public, studies, Tybee, WSAVTV