Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/$%7Bart_info.art.src%7D?q=function&page=1&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=function

Returns an array of strings in format "username" or "username/projectName"

Found 17931 results for "function"(658ms)

getFileEmail4 file matches

@shouser•Updated 1 week ago
A helper function to build a file's email
tuna

tuna8 file matches

@jxnblk•Updated 1 week ago
Simple functional CSS library for Val Town

AutomationFunction1 file match

@saradp•Updated 3 weeks ago

TwilioHelperFunctions

@vawogbemi•Updated 2 months ago

trmnl_plugins2 file matches

@camflan•Updated 2 months ago
Backend functions for TRMNL plugins

exampleTestFunctions1 file match

@willthereader•Updated 3 months ago

generateFunction1 file match

@wolf•Updated 4 months ago

functionExercise2 file matches

@willthereader•Updated 5 months ago

FunctionToHTMLForm1 file match

@dps•Updated 1 year ago

gpt4FunctionCallingExample2 file matches

@stevekrouse•Updated 1 year ago

a4595dc5b24_handleTelegramMessage.ts5 matches

@vtTestLocal•Updated 43 mins ago
36 * Store a chat message in the database
37 */
38export async function storeChatMessage(
39 chatId,
40 senderId,
69 * Retrieve chat history for a specific chat
70 */
71export async function getChatHistory(chatId, limit = 50) {
72 try {
73 const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
94 * Format chat history for Anthropic API
95 */
96function formatChatHistoryForAI(history) {
97 const messages = [];
98
118 * Analyze a Telegram message and extract memories from it
119 */
120async function analyzeMessageContent(
121 anthropic,
122 username,
499
500// Handle webhook requests
501export default async function (req: Request): Promise<Response> {
502 // Set webhook if it is not set yet
503 if (!isEndpointSet) {

a4595dc5b24_getWeather.ts5 matches

@vtTestLocal•Updated 43 mins ago
8const TABLE_NAME = `memories`;
9
10function summarizeWeather(weather: WeatherResponse) {
11 const summarizeDay = (day: WeatherResponse["weather"][number]) => ({
12 date: day.date,
25}
26
27async function generateConciseWeatherSummary(weatherDay) {
28 try {
29 // Get API key from environment
83}
84
85async function deleteExistingForecast(date: string) {
86 await sqlite.execute(
87 `
93}
94
95async function insertForecast(date: string, forecast: string) {
96 const { nanoid } = await import("https://esm.sh/nanoid@5.0.5");
97
112}
113
114export default async function getWeatherForecast(interval: number) {
115 const weather = await getWeather("Washington, DC");
116 console.log({ weather });
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.
lost1991
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": "*",