5}
6
7export function fetchVerificationEmailHtml({ email, token, reVerifying }: FetchVerificationEmailHtmlParams) {
8 const confirmationLink = `https://petemillspaugh.com/email-confirmation?email=${email}&token=${token}`;
9 const html = `
1export async function untitled_lavenderReptile(req: Request): Promise<Response> {
2 return Response.json([{ ime: "filip" }]);
3}
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
4
5// Fetches a random joke.
6async function fetchRandomJoke() {
7 const response = await fetch(
8 "https://official-joke-api.appspot.com/random_joke",
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",
1Migrated from folder: External_APIs/openai/function_calling/gpt4FunctionCallingExample
2
3// fetches a random joke
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
1import { html } from "https://esm.town/v/lbb00/html";
2export async function LoginRegistryExample(request: Request): Promise<Response> {
3 return new Response(
4 html`
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",
A helper function to build a file's email
Simple functional CSS library for Val Town
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": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.