1Migrated from folder: Archive/compress_image_demo
2
3Helpers to convert files to base64 & base64-encoded data URLs,
4which are particularly helpful for sending images to LLMs
5like ChatGPT, Anthropic, and Google.
6
25 role: "user",
26 content: [{
27 type: "image_url",
28 image_url: {
29 url: dataURL,
30 },
54 "content": [
55 {
56 "type": "image",
57 "source": {
58 "type": "base64",
80import { fileToBase64 } from "https://esm.town/v/stevekrouse/fileToDataURL";
81
82const base64Image = await fileToBase64(image);
83
84const result = await model.generateContent([
86 {
87 inlineData: {
88 data: base64Image,
89 mimeType: image.type,
90 },
91 },
3Every Monday at 9am EDT send a message to our team's Discord channel to remind us to water our plant.
4
5
6
7
6
7Here's an example email from this Val:
8
9
10Every time you run it, you'll get a different feature. By default, this uses the `lg-v3-x1` model, which I think is a good one to start with, but this may change in the future as I train better feature dictionaries!
6 c.html(
7 <form action="/" method="post" enctype="multipart/form-data">
8 <input type="file" accept="image/*" name="file">Upload photo</input>
9 <button type="submit">Submit</button>
10 </form>,
5As Val Town's [most active user](https://www.val.town/v/pomdtr/leaderboard) (behind Steve Krouse, one of the founders of Val Town), I for sure agree with Tom that search feature of Val Town needs improvements. But while reading his post, I immediately thought of a different approach to the problem. And a few hours later, [Val Town Search](https://val-town-search.pomdtr.me/) was born.
6
7
8
9## Do things that don't scale
22Does it work better than the current search feature of Val Town? Absolutely!
23
24
25
26I hope that the val.town engineers will come up with a search feature that will put my little project to shame. But for now, you won't find a better way to search for vals than [Val Town Search](https://val-town-search.pomdtr.me/).
3View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stevekrouse/sqlite_admin?v=46) val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by [LibSQL Studio](https://github.com/invisal/libsql-studio) by [invisal](https://github.com/invisal). This is now more an SPA, with tables, queries and results showing up on the same page.
4
5
6
7## Install
3View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stevekrouse/sqlite_admin?v=46) val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by [LibSQL Studio](https://github.com/invisal/libsql-studio) by [invisal](https://github.com/invisal). This is now more an SPA, with tables, queries and results showing up on the same page.
4
5
6
7## Install
12 content: body.data.email_addresses[0].email_address
13 + " "
14 + body.data.profile_image_url,
15 });
16 return new Response("Success");
3View and interact with your Val Town SQLite data. It's based off Steve's excellent [SQLite Admin](https://www.val.town/v/stevekrouse/sqlite_admin?v=46) val, adding the ability to run SQLite queries directly in the interface. This new version has a revised UI and that's heavily inspired by [LibSQL Studio](https://github.com/invisal/libsql-studio) by [invisal](https://github.com/invisal). This is now more an SPA, with tables, queries and results showing up on the same page.
4
5
6
7## Install