Search

Results include substring matches and semantically similar vals. Learn more
webup avatar
getModelBuilder
@webup
An interactive, runnable TypeScript val by webup
Script
// Set up LangSmith tracer
const { Client } = await import("npm:langsmith");
const { LangChainTracer } = await import("npm:langchain/callbacks");
const client = new Client({
apiUrl: "https://api.smith.langchain.com",
apiKey: process.env.LANGSMITH,
const tracer = new LangChainTracer({ client });
const callbacks = options?.verbose !== false ? [tracer] : [];
stevekrouse avatar
mt
@stevekrouse
This val is a demonstration of Modern Treasury's Embedded Integration for KYC https://docs.moderntreasury.com/docs/embedded-integation To run this val and see the resulting HTML page, go to: https://stevekrouse-mt.express.val.run
Express
// handle error event (e.g. open the iframe again)
const onCancel = function (event) {
// handle cancel event (e.g. email the user later to try and reactivate them)
// note: this event will not be triggered if the user closes their browser.
const userOnboardingId = document.getElementById('userOnboardingId').value;
mewtru avatar
linkInBioTemplate
@mewtru
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
export default async function(req: Request) {
return new Response(
saolsen avatar
codemirrorTsBrowserEmacs
@saolsen
codemirror emacs This doesn't work :( I hate it. Gonna have to write my own emacs mode probably, this one (that basically every codemirror based editor uses) is broken.
Script
target: ts.ScriptTarget.ESNext,
module: ts.ModuleKind.ESNext,
jsx: ts.JsxEmit.React,
lib: ["esnext", "dom"],
moduleDetection: ModuleDetectionKind.Force,
stevekrouse avatar
chatGPT
@stevekrouse
ChatGPT Implemented in Val Town Demonstrated how to use assistants and threads with the OpenAI SDK and how to stream the response with Server-Sent Events. ⚠️ Note: Requires your own OpenAI API key to get this to run in a fork
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { Hono } from "npm:hono@3";
import OpenAI from "npm:openai";
import { renderToString } from "npm:react-dom/server";
const jsxResponse = (jsx) => {
return new Response(renderToString(jsx), { headers: { "Content-Type": "text/html" } });
const clientCode = () => {
document.getElementById("input").addEventListener("submit", function(event) {
</form>
<script dangerouslySetInnerHTML={{ __html: `(${clientCode.toString()})()` }}>
</script>
janpaul123 avatar
valle_tmp_562580635116363837652861654341074
@janpaul123
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import valleGetValsContextWindow from "https://esm.town/v/janpaul123/valleGetValsContextWindow";
import archiveVal from "https://esm.town/v/nbbaier/archiveVal?v=10";
import _ from "npm:lodash@4";
import OpenAI from "npm:openai";
import { renderToString } from "npm:react-dom/server";
// Set these to your own
const username = "janpaul123";
stevekrouse avatar
push
@stevekrouse
@jsxImportSource npm:hono@3/jsx
HTTP (deprecated)
addEventListener("notificationclick", (event) => {
if (typeof event.notification.data?.url === "string") {
clients.openWindow(event.notification.data?.url);
200,
{ "Content-Type": "text/javascript" },
thomasatflexos avatar
askLexi
@thomasatflexos
An interactive, runnable TypeScript val by thomasatflexos
Script
const { OpenAIEmbeddings } = await import("npm:langchain/embeddings");
const { createClient } = await import(
"https://esm.sh/@supabase/supabase-js@2"
const client = createClient(
process.env.supabaseURL,
openAIApiKey: process.env.OPEN_API_KEY,
client,
tableName: "documents",
easrng avatar
getValTownTrpc
@easrng
An interactive, runnable TypeScript val by easrng
Script
import { httpLink, createTRPCProxyClient } from "npm:@trpc/client";
export const trpc = createTRPCProxyClient({
links: [
httpLink({
yawnxyz avatar
push
@yawnxyz
@jsxImportSource npm:hono@3/jsx
HTTP (deprecated)
addEventListener("notificationclick", (event) => {
if (typeof event.notification.data?.url === "string") {
clients.openWindow(event.notification.data?.url);
200,
{ "Content-Type": "text/javascript" },
k45zl avatar
linkInBioTemplate
@k45zl
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
export default async function(req: Request) {
{ name: "Challenge insurance assessment" },
{ name: "Consider consolidating claims" },
{ name: "Monitor repairs closely" }
janpaul123 avatar
valwriter
@janpaul123
[ ] streaming [ ] send the code of the valwriter back to gpt (only if it's related, might need some threads, maybe a custom gpt would be a better fix, of course, could do it as a proxy...) [ ] make it easy to send errors back to gpt [ ] make it easy to get screenshots of the output back to gpt
HTTP (deprecated)
const examples = [
user: "website that shows the current time",
content: `/** @jsxImportSource npm:react */
export default function() {
return <h1>{new Date().toLocaleTimeString()}</h1>;
jxnblk avatar
avatar
@jxnblk
Jxnblk's SVG avatar React import { Avatar } from "https://esm.town/v/jxnblk/avatar"; Props <Avatar size={96} color="tomato" reverse={true} /> SVG import { svg } from "https://esm.town/v/jxnblk/avatar"; img <img src="https://jxnblk-avatar.web.val.run" alt="Jxnblk" /> img params https://jxnblk-avatar.web.val.run?size=96&color=tomato&reverse=true md ![Jxnblk](https://jxnblk-avatar.web.val.run)
HTTP
![](https://jxnblk-avatar.web.val.run?size=96)
**React**
```tsx
// jxnblk avatar
/** @jsxImportSource https://esm.sh/react */
import { SVGProps } from "https://esm.sh/react";
import { renderToStaticMarkup } from "https://esm.sh/react-dom/server";
type AvatarProps = SVGProps<SVGSVGElement> & {
ghsaboias avatar
linkInBioTemplate
@ghsaboias
@jsxImportSource https://esm.sh/react
HTTP (deprecated)
/** @jsxImportSource https://esm.sh/react */
import { renderToString } from "npm:react-dom/server";
export default async function(req: Request) {
return new Response(
stevekrouse avatar
status
@stevekrouse
Uptime Status Page This is the status page for the data generated by this uptime cron: @stevekrouse/uptime
HTTP
/** @jsxImportSource https://esm.sh/react */
import { sqlite } from "https://esm.town/v/std/sqlite?v=6";
import { html } from "https://esm.town/v/stevekrouse/html";
import { SparklineSVG } from "https://esm.town/v/stevekrouse/sparklineSVGReact";
import { renderToString } from "npm:react-dom/server";
function StatusRow({ rows }) {