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=1682&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 18321 results for "function"(2533ms)

5}
6
7export function fetchVerificationEmailHtml({ email, token, reVerifying }: FetchVerificationEmailHtmlParams) {
8 const confirmationLink = `https://petemillspaugh.com/email-confirmation?email=${email}&token=${token}`;
9 const html = `

usersmain.tsx1 match

@zokonil•Updated 1 year ago
1export async function untitled_lavenderReptile(req: Request): Promise<Response> {
2 return Response.json([{ ime: "filip" }]);
3}

randomJokeGeneratormain.tsx1 match

@dylanpatel16•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

untitled_redCatfishmain.tsx1 match

@remelee•Updated 1 year ago
4
5// Fetches a random joke.
6async function fetchRandomJoke() {
7 const response = await fetch(
8 "https://official-joke-api.appspot.com/random_joke",

gpt4FunctionCallingExamplemain.tsx10 matches

@stevekrouse•Updated 1 year ago
2
3const openai = new OpenAI();
4const functionExpression = await openai.chat.completions.create({
5 "messages": [
6 { "role": "user", "content": "What is the weather like in Boston?" },
7 ],
8 "functions": [
9 {
10 "name": "get_current_weather",
29 max_tokens: 30,
30});
31console.log(functionExpression);
32
33// TODO pull out function call and initial message
34let args = functionExpression.choices[0].message.function_call.arguments;
35let functionCallResult = { "temperature": "22", "unit": "celsius", "description": "Sunny" };
36
37const result = await openai.chat.completions.create({
41 "role": "assistant",
42 "content": null,
43 "function_call": { "name": "get_current_weather", "arguments": "{ \"location\": \"Boston, MA\"}" },
44 },
45 {
46 "role": "function",
47 "name": "get_current_weather",
48 "content": JSON.stringify(functionCallResult),
49 },
50 ],
51 "functions": [
52 {
53 "name": "get_current_weather",

gpt4FunctionCallingExampleREADME.md1 match

@stevekrouse•Updated 1 year ago
1Migrated from folder: External_APIs/openai/function_calling/gpt4FunctionCallingExample

emailRandomJokemain.tsx1 match

@caofanny•Updated 1 year ago
2
3// fetches a random joke
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

registryExamplemain.tsx1 match

@lbb00•Updated 1 year ago
1import { html } from "https://esm.town/v/lbb00/html";
2export async function LoginRegistryExample(request: Request): Promise<Response> {
3 return new Response(
4 html`

untitled_greenCrayfishmain.tsx1 match

@mohammed•Updated 1 year ago
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",

getFileEmail4 file matches

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

tuna8 file matches

@jxnblk•Updated 2 weeks ago
Simple functional CSS library for Val Town
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": "*",
webup
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.