Avatar

vlad

Joined September 11, 2022
Public vals
19
vlad avatar
tempsimplegptexample
@vlad
HTTP
// Example of action that doesn't accept any input, but returns something
vlad avatar
gptApiFramework
@vlad
Script
Allows for automatic generation of Hono API comatible with GPTs. Endpoints' inputs and outputs need to be specified via types from which the Open API spec is generated automatically and available via /gpt/schema endpoint. Usage example: import { GptApi } from "https://esm.town/v/xkonti/gptApiFramework"; import { z } from "npm:zod"; /** * COMMON TYPES */ const ResponseCommandSchema = z.object({ feedback: z.string().describe("Feedback regarding submitted action"), command: z.string().describe("The command for the Mediator AI to follow strictly"), data: z.string().optional().describe("Additional data related to the given command"), }).describe("Contains feedback and further instructions to follow"); export type ResponseCommand = z.infer<typeof ResponseCommandSchema>; /** * INITIALIZE API */ const api = new GptApi({ url: "https://xkonti-planoverseerai.web.val.run", title: "Overseer AI API", description: "The API for interacting with the Overseer AI", version: "1.0.0", }); /** * REQUIREMENTS GATHERING ENDPOINTS */ api.nothingToJson<ResponseCommand>({ verb: "POST", path: "/newproblem", operationId: "new-problem", desc: "Endpoint for informing Overseer AI about a new problem presented by the User", requestSchema: null, requestDesc: null, responseSchema: ResponseCommandSchema, responseDesc: "Instruction on how to proceed with the new problem", }, async (ctx) => { return { feedback: "User input downloaded. Problem analysis is required.", command: await getPrompt("analyze-problem"), data: "", }; }); export default api.serve();
vlad avatar
blocks
@vlad
HTTP
// Forked from @tmcw.blocks_inner
vlad avatar
saveToReadwiseReader
@vlad
Script
An interactive, runnable TypeScript val by vlad
vlad avatar
blocks_inner
@vlad
Express
// Forked from @tmcw.blocks_inner
vlad avatar
ffmpegRepro2
@vlad
Script
An interactive, runnable TypeScript val by vlad
vlad avatar
ffmpegRepro1
@vlad
Script
An interactive, runnable TypeScript val by vlad
vlad avatar
matrixMediaToHttpUrl
@vlad
Script
An interactive, runnable TypeScript val by vlad
vlad avatar
joinMatrixRoom
@vlad
Script
An interactive, runnable TypeScript val by vlad
vlad avatar
serverlessMatrixEchoBot
@vlad
Express
A example Serverless Bot for Matrix chat. See https://vlad.roam.garden/How-to-create-a-serverless-Matrix-Chat-bot for a more detailed write-up on how to set one up! To test this bot: invite serverless-echo@matrix.org to your unencrypted room Send a message starting with !echo and the bot will repeat content after. Use https://matrix-serverless.netlify.app/ to configure Matrix to call the endpoint on newly received messages
vlad avatar
watchReaderAndSendToMatrix_time4
@vlad
Cron
An interactive, runnable TypeScript val by vlad
vlad avatar
watchReaderAndSendToMatrix_time3
@vlad
Cron
An interactive, runnable TypeScript val by vlad
vlad avatar
watchReaderAndSendToMatrix_time2
@vlad
Cron
An interactive, runnable TypeScript val by vlad
vlad avatar
watchReaderAndSendToMatrix_time1
@vlad
Cron
An interactive, runnable TypeScript val by vlad
vlad avatar
formatDateToRoam
@vlad
Script
An interactive, runnable TypeScript val by vlad
vlad avatar
sendMatrixChatRoomTextMessage
@vlad
Script
An interactive, runnable TypeScript val by vlad