2import { renderToString } from "npm:react-dom/server";
3
4export default async function(req: Request) {
5 return new Response(
6 renderToString(
5import { refs } from "https://esm.town/v/stevekrouse/refs?v=11";
6
7type CronFunction = (interval: Interval) => Promise<void>;
8
9export const cronEvalLogger = (cron: CronFunction): CronFunction => {
10 let interval: Interval;
11 const cronProxy = new Proxy(cron, {
106 await fetch(telegramSendUrl);
107};
108export default async function(interval: Interval) {
109 const forecast = await fetchForecast();
110 const formatted = formatWeatherForecast(forecast);
4import { renderToString } from "npm:react-dom/server";
5
6export default async function(interval: Interval) {
7 const result = await fal.subscribe("turbo1912/multiple-models/esrgan", {
8 input: {
33);`;
34
35function valToRow(val: Val) {
36 return [
37 val.id,
47}
48
49async function insertRows(rows, options: { table: string; driver: SqliteInterface }) {
50 const query = sql`INSERT OR REPLACE INTO ${
51 raw(options.table)
55}
56
57export async function valtownToSQLite(options?: { table?: string; driver?: SqliteInterface }) {
58 const table = options?.table || "vals";
59 const driver = options?.driver || sqlite;
13
14const clientCode = () => {
15 document.getElementById("input").addEventListener("submit", async function(event) {
16 event.preventDefault();
17
45 + `&assistantId=${input.getAttribute("data-assistant-id")}`,
46 );
47 eventSource.onmessage = function(event) {
48 console.log(event);
49 responseDiv.innerText += JSON.parse(event.data);
50 };
51
52 eventSource.onerror = function() {
53 eventSource.close();
54 };
1An example of using [Breadboard Board as a Service](https://www.val.town/v/dglazkov/bbaas) helper script. The board converts supplied text and voice into speech using Eleven Labs API.
2
3This board is marked as `private`, which means that it requires an additional service key to function.
4
5To use:
5import { refs } from "https://esm.town/v/stevekrouse/refs?v=11";
6
7type CronFunction = (interval: Interval) => Promise<void>;
8
9export const cronEvalLogger = (cron: CronFunction): CronFunction => {
10 let interval: Interval;
11 const cronProxy = new Proxy(cron, {
6import { blob } from "https://esm.town/v/std/blob?v=10";
7
8function App() {
9 const [comments, setComments] = useState();
10 const [newComment, setNewComment] = useState("");
33- [x] fix wonky sidebar separator height problem (thanks to @stevekrouse)
34- [x] make result tables scrollable
35- [x] add export to CSV, and JSON (CSV and JSON helper functions written in [this val](https://www.val.town/v/nbbaier/sqliteExportHelpers). Thanks to @pomdtr for merging the initial version!)
36- [x] add listener for cmd+enter to submit query
37
A helper function to build a file's email
Simple functional CSS library for Val Town
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",