blobStoragemain.tsx5 matches
440{profile && (
441<div className="flex items-center space-x-4">
442<img src={profile.profileImageUrl} alt="Profile" className="w-8 h-8 rounded-full" />
443<span>{profile.username}</span>
444<a href="/auth/logout" className="text-blue-400 hover:text-blue-300">Logout</a>
583alt="Blob content"
584className="max-w-full h-auto"
585onError={() => console.error("Error loading image")}
586/>
587</div>
635<li>Create public shareable links for blobs</li>
636<li>View and manage public folder</li>
637<li>Preview images directly in the interface</li>
638</ul>
639</div>
694const { ValTown } = await import("npm:@valtown/sdk");
695const vt = new ValTown();
696const { email: authorEmail, profileImageUrl, username } = await vt.me.profile.retrieve();
697// const authorEmail = me.email;
698762763c.set("email", email);
764c.set("profile", { profileImageUrl, username });
765await next();
766};
emailValHandlermain.tsx25 matches
11- Parse and analyze various types of content:
12- PDF attachments
13- Image attachments (using GPT-4 Vision)
14- Website content from links in your email
15- Get detailed, context-aware responses directly to your inbox
294. Compose your email:
30- Write your query or request in the email body
31- Attach any relevant PDFs or images
32- Include links to websites you want analyzed
33- Send it to the Val email address
4546- PDFs: Text content will be extracted and analyzed
47- Images: Will be analyzed using GPT-4 Vision API
48- Websites: Content will be extracted and converted to markdown for analysis
49- Other file types are not currently supported and will be ignored
7980// Step 3: Process different types of content
81const { pdfTexts, imageAnalysis } = await processAttachments(attachments, openaiKey, transformedPrompt);
82const websiteMarkdown = await extractWebsiteMarkdown(links, mdApiKey);
8386transformedPrompt,
87pdfTexts,
88imageAnalysis,
89websiteMarkdown,
90receivedEmail,
176}
177178// Process image attachments with GPT-4V
179async function analyzeImage(imageAttachment, apiKey, transformedPrompt) {
180try {
181const response = await fetch("https://api.openai.com/v1/chat/completions", {
191role: "system",
192content:
193`You are an AI assistant tasked with analyzing images in the context of a specific query. Use the following transformed prompt to guide your analysis and provide relevant context:\n\n${transformedPrompt}\n\nFocus your analysis on aspects that are most relevant to this prompt.`,
194},
195{
198{
199type: "text",
200text: "Analyze this image and provide relevant context based on the given prompt:${transformedPrompt}",
201},
202{
203type: "image_url",
204image_url: {
205url: `data:${imageAttachment.type};base64,${imageAttachment.content}`,
206},
207},
215return data.choices[0]?.message?.content || "No analysis available";
216} catch (error) {
217console.error("Error analyzing image:", error);
218return "Error analyzing image";
219}
220}
310}
311312// Process all attachments (PDFs and Images)
313async function processAttachments(attachments, apiKey, transformedPrompt) {
314const pdfTexts = [];
315const imageAnalysis = [];
316317for (const attachment of attachments) {
319const pdfText = await extractPdfText([attachment]);
320pdfTexts.push(...pdfText);
321} else if (attachment.type.startsWith("image/")) {
322const analysis = await analyzeImage(attachment, apiKey, transformedPrompt);
323imageAnalysis.push({
324filename: attachment.filename,
325analysis,
328}
329330return { pdfTexts, imageAnalysis };
331}
332365366// Generate the final prompt with all context
367function generateFinalPrompt(transformedPrompt, pdfTexts, imageAnalysis, websiteMarkdown, email) {
368let contextDump = [];
369373}
374375// Add image analysis
376if (imageAnalysis.length > 0) {
377contextDump.push("Image Analysis:", ...imageAnalysis.map(img => `${img.filename}: ${img.analysis}`));
378}
379401role: "system",
402content:
403`You are a helpful AI that replies to emails. Address the sender by their first name if provided, and sign off as 'AI Assistant' in a friendly and professional tone. Be concise and thorough in your analysis. As you're replying via email, use email syntax and not markdown. Analyze all provided content, including PDFs, images, and website content, in the context of the email request. Follow the structured format provided in the transformed prompt to organize your response. Here's the transformed prompt to guide your response:\n\n${transformedPrompt}`,
404},
405{
blob_adminREADME.md1 match
3This is a lightweight Blob Admin interface to view and debug your Blob data.
45
67Versions 0-17 of this val were done with Hono and server-rendering.
blob_adminmain.tsx5 matches
440{profile && (
441<div className="flex items-center space-x-4">
442<img src={profile.profileImageUrl} alt="Profile" className="w-8 h-8 rounded-full" />
443<span>{profile.username}</span>
444<a href="/auth/logout" className="text-blue-400 hover:text-blue-300">Logout</a>
583alt="Blob content"
584className="max-w-full h-auto"
585onError={() => console.error("Error loading image")}
586/>
587</div>
635<li>Create public shareable links for blobs</li>
636<li>View and manage public folder</li>
637<li>Preview images directly in the interface</li>
638</ul>
639</div>
694const { ValTown } = await import("npm:@valtown/sdk");
695const vt = new ValTown();
696const { email: authorEmail, profileImageUrl, username } = await vt.me.profile.retrieve();
697// const authorEmail = me.email;
698762763c.set("email", email);
764c.set("profile", { profileImageUrl, username });
765await next();
766};
tangibleIvoryCanidaemain.tsx1 match
48"<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" ",
49),
50{ headers: { "Content-Type": "image/svg+xml" } },
51);
52}
11|-----|-----|
12| Web page | https://alexwein-fabwbogglelike.web.val.run |
13| Observable Plot for image | https://observablehq.com/plot/ |
14| wordnik from words | https://github.com/wordnik/wordlist |
bluesky_bot_templatemain.tsx5 matches
24}
25const svgText = await response.text();
26return `data:image/svg+xml;base64,${btoa(svgText)}`;
27}
2853// Upload blob to Bluesky
54const { data } = await agent.uploadBlob(convertDataURIToUint8Array(svgDataUri), {
55encoding: "image/svg+xml",
56});
5760text: "",
61embed: {
62$type: "app.bsky.embed.images",
63images: [{
64alt: "Generated SVG visualization",
65image: data.blob,
66aspectRatio: {
67width: 600,
vividCopperWrenmain.tsx1 match
1111<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1112<meta property="og:type" content="website">
1113<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1114
1115
reverentAquaCuckoomain.tsx1 match
1111<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1112<meta property="og:type" content="website">
1113<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1114
1115
1111<meta property="og:description" content="Turn your ideas into fully functional apps in less than a second – powered by Llama3.3-70b on Cerebras's super-fast wafer chips. Code is 100% open-source, hosted on Val Town."">
1112<meta property="og:type" content="website">
1113<meta property="og:image" content="https://stevekrouse-blob_admin.web.val.run/api/public/CerebrasCoderOG.jpg">
1114
1115