Public
Back
Version 10
10/7/2024
/*
- this version collects data from three ways: a free-form paragraph, a JSON text area, or a table (mimicking a form)
- it's really tempting to create a form that lets people "write anything" in a text box and have the data properly formatted by the AI, it's still kind of an accessibility nightmare.
- I can see this appearing everywhere, maybe for the novelty, but current forms with labels and ARIA etc. will still reign supreme for data-heavy bureaucratic data collection tasks
- for casual inputs though like guest books this could be a simpler alternative
- for "real data applications" like collecting info for shipping and CC, still use a "real" form
- for "real applications" this can still be used to catch errors quickly, like misspellings (which happen a LOT)
- using a really fast/cheap model like llama3.1 8b (or even smaller) is a good use case, but it should support structured outputs
*/
import { Hono } from "https://deno.land/x/hono@v3.11.7/mod.ts";
const app = new Hono();
const module = `<script type="module">
import { atom, computed } from 'https://cdn.jsdelivr.net/npm/nanostores@0.11.3/+esm'
import { produce } from 'https://cdn.jsdelivr.net/npm/immer@10.0.2/+esm'
const submitBtn = document.getElementById('submitBtn');
const inputText = document.getElementById('inputText');
const systemText = document.getElementById('systemText');
const resultContainer = document.getElementById('resultContainer');
const result = document.getElementById('result');
const timerDisplay = document.createElement('span');
timerDisplay.className = 'ml-2 text-sm';
// submitBtn.parentNode.insertBefore(timerDisplay, submitBtn.nextSibling);
let startTime;
let timerInterval;
let debounceTimer;
const $parsedResult = atom({});
yawnxyz-squishyform.web.val.run
Updated: October 27, 2024