4 ms·
Presumably something like model.includes("gemini-nano:0.4") could work?
by luke-stanley 2y ago
Presumably something like model.includes("gemini-nano:0.4") could work?
- damacaner 2y agocan we make everything constant like C# does please Models.GeminiNano04 boom
- langcss 2y agoThat would be like making a constant for every nuget package/version tuple: unworkable because new versions and packages come out all the time. Or making constants for every device manufacturer you can connect to via web Bluetooth.
- jitl 2y agoWhat’s the point in JavaScript? At the end of the day that’s still equivalent to Models[“GeminiNano04”] In C# you can’t compile a reference to Models.Potato04 unless Potato04 exists. In JS it’s perfectly legal to have code that references non-existant properties, so there’s no real developer ergonomics benefit here. On the contrary, code like `ai.createTextSession(“Potato:4”)` can throw an error like “Model Potato:4 doesn’t exist, try Potato:1”, whereas `ai.createTextSession(ai.Models.Potato04)` can only throw an error like “undefined is not a Model. Pass a string here”. Or you can make ai.Models a special object that throws when undefined properties are accessed, but then it’s annoying to write code that sniffs out which models are available.