18})();
1920export default async function(req: Request): Promise<Response> {
21await init;
22await pg.query(`
7`https://api.stlouisfed.org/fred/series/observations?series_id=MORTGAGE30US&api_key=${fredApiKey}&file_type=json&sort_order=desc&limit=1`;
89export default async function main(req: Request) {
10try {
11const response = await fetch(fredApiUrl);
MuxAITranscriptmain.tsx6 matches
19});
2021async function getMuxAsset(assetId: string) {
22if (!assetId) throw "A Mux asset ID is required.";
235152// transform ["Matt", "Nick"] into { "A": "Matt" , "B": "Nick" }
53function createSpeakersObject(speakersArray: string[]) {
54if (speakersArray.length > 26) {
55throw new Error("We only support 26 speakers for now");
6364type MuxCuePoint = { startTime: number; endTime?: number; value: string };
65async function getCuePointsFromMux(asset: Mux.Video.Assets.Asset): Promise<MuxCuePoint[]> {
66const transcriptTrack = asset.tracks.find(track => track.type === "text");
67const playbackId = asset.playback_ids.find(playbackId => playbackId.policy === "public");
8788type AssemblyAICuePoint = { startTime: number; endTime?: number; value: { speaker: string; text: string } };
89async function getCuePointsFromAssemblyAI(
90asset: Mux.Video.Assets.Asset,
91speakers: { [key: string]: string },
121}
122123async function formatTextWithGPT4o(aaiCuePoints: AssemblyAICuePoint[]) {
124const cues = aaiCuePoints.map(cue => ({
125speaker: cue.value.speaker,
162}
163164export default async function(req: Request): Promise<Response> {
165if (req.method !== "POST") {
166return Response.json({ nope: "we (currently) just POST in these parts " });
5const toolset = new OpenAIToolSet({ apiKey: COMPOSIO_API_KEY });
67// Creating an authentication function for the user
8const appName = "github";
910async function setupUserConnectionIfNotExists(entityId) {
11const entity = toolset.client.getEntity(entityId);
12const connection = await entity.getConnection(appName);
21}
2223// Execution function
24async function executeAgent(entityName) {
25const entity = toolset.client.getEntity(entityName);
26await setupUserConnectionIfNotExists(entity.id);
47}
4849// Call the execution function
50executeAgent("default");
htmlinhydeRSVPsmain.tsx1 match
14* When hit with a POST, it saves the name _and_ email of the person who has RSVPed.
15*/
16export default async function(req: Request): Promise<Response> {
17let rsvps = await blob.getJSON("rsvps") as RSVP[];
18rsvps ??= [];
misleadingScarletMongoosemain.tsx4 matches
2* Returns a response to the user's query
3*/
4async function getResponse(req: Query, send: SendEventFn) {
5send("meta", { content_type: "text/markdown" });
6send("text", {
22* Returns your bot's settings
23*/
24async function getBotSettings(): Promise<BotSettings> {
25return {
26allow_attachments: true,
93) => void;
9495function encodeEvent(event: string, data: any = {}) {
96return new TextEncoder().encode(`event: ${event}\ndata: ${JSON.stringify(data)}\n\n`);
97}
9899export default async function(req: Request): Promise<Response> {
100const reqBody = await req.json()
101.catch((e) => {
sqliteExplorerAppREADME.md1 match
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
gltf_torusmain.tsx1 match
9const app = new Hono();
1011function createTorus(radius = 1, tube = 0.4, radialSegments = 12, tubularSegments = 48, arc = Math.PI * 2) {
12const indicesArray = [];
13const positionArray = [];
dateme_homemain.tsx1 match
5import Layout from "https://esm.town/v/vawogbemi/dateme_layout";
67export default function Home(c) {
8return c.html(
9<Layout activeTab={new URL(c.req.url).pathname}>