40
41 // Also delete the blob!
42 blob.delete("pondiverse_image" + id);
43
44 return Response.json({ ok: true });
9 // - data (string)
10 // - type (string)
11 // - image (data url string)
12 // sanity checks:
13 // - title, not toooo long
14 // - data, hmm this needs to be long i guess.. maybe some crazy upper limit sanity check though
15 // - type, not too long
16 // - image, not toooo large a file size
17 let body;
18 try {
25 const data = body.data;
26 const type = body.type;
27 const image = body.image;
28
29 // Sanity checks
37 }
38
39 if (image.length > 20 * 1024 * 1024) {
40 return Response.json({ ok: false, error: "Thumbnail too large" });
41 }
57 );
58
59 // only creates blob if there is indeed an image and updates the image column to represent that
60 if (image) {
61 const imageName = "pondiverse_image" + id.lastInsertRowid;
62 const imageAddr = `${Deno.env.get("PONDIVERSE_STORE_BASE_PATH")}/images&id=${id.lastInsertRowid}`;
63 await blob.set(imageName, image);
64 await sqlite.execute(
65 `UPDATE ${TABLE_NAME} SET image = "${imageAddr}" WHERE id = ${id.lastInsertRowid}`,
66 );
67 }
9 data TEXT,
10 type TEXT,
11 image TEXT,
12 time DATETIME NOT NULL,
13 )`,
1export default async function(req: Request): Promise<Response> {
2 return Response.json({
3 image_url: "https://jon.bo/IMG_9387.png",
4 video_url:
5 "https://res.cloudinary.com/dzkwltgyd/video/upload/v1746459827/glif-run-outputs/z58xo3zbuknyr7wek59i.mp4",
19 }
20
21 const { messages, project, branchId, anthropicApiKey, selectedFiles, images } = await c.req.json();
22 console.log("Original messages:", JSON.stringify(messages, null, 2));
23 console.log("Images received:", JSON.stringify(images, null, 2));
24
25 // Still allow users to pass their own key, or use ours
31 let coreMessages = convertToCoreMessages(messages);
32
33 // If there are images, we need to add them to the last user message
34 if (images && Array.isArray(images) && images.length > 0) {
35 // Find the last user message
36 const lastUserMessageIndex = coreMessages.findIndex(
54 };
55
56 // Add each image to the content array using the correct ImagePart format
57 for (const image of images) {
58 if (image && image.url) {
59 // Extract mime type from data URL if available
60 let mimeType = undefined;
61 if (image.url.startsWith("data:")) {
62 const matches = image.url.match(/^data:([^;]+);/);
63 if (matches && matches.length > 1) {
64 mimeType = matches[1];
67
68 newUserMessage.content.push({
69 type: "image",
70 image: image.url,
71 mimeType,
72 });
2import deleteCreation from "./deleteCreation";
3import getCreation from "./getCreation";
4import getCreationImage from "./getCreationImage";
5import getCreations from "./getCreations";
6import updateTable from "./updateTable";
15 case "/get-creation":
16 return getCreation(req);
17 case "/get-creation-image":
18 return getCreationImage(req);
19 case "/get-creations":
20 return getCreations(req);
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
16- Generate ideas and outlines
17- Improve writing style and grammar
18- Create complementary images
19- Optimize content for search engines
20
23## Interactive and Immersive Content
24
25Static text and images are giving way to more interactive experiences:
26
27- Embedded interactive data visualizations
48```
49
50### Images
51
52```
53
54```
55
67- Implement categories in addition to tags
68- Add search functionality
69- Support for images in blog posts
70- RSS feed generation