2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
34export function comments({ token, since, until, offset, limit, relationship }: {
5token: string;
6since?: Date;
4import { dalleImageUrl } from "https://esm.town/v/andreterron/dalleImageUrl";
56export async function dallemail(email) {
7let imageUrl = await dalleImageUrl(email.text);
8return email2({
actuallyItsXBotmain.tsx1 match
4import { refreshActuallyBotToken } from "https://esm.town/v/andreterron/refreshActuallyBotToken";
56export async function actuallyItsXBot() {
7const token = await refreshActuallyBotToken();
8//
feedGeneratormain.tsx2 matches
29cursor?: string;
30}
31export async function feedGenerator({ feed, serviceDID, publisherDID, hostname }: {
32serviceDID?: string;
33publisherDID: string;
57return [q.toString()];
58};
59return async function (req: express.Request, res: express.Response) {
60const serviceDid = serviceDID ?? `did:web:${hostname}`;
61const didCache = new resolver.MemoryCache();
chatSampleFunctionMultiplemain.tsx7 matches
2import { chat } from "https://esm.town/v/webup/chat";
34export const chatSampleFunctionMultiple = (async () => {
5// Helper function to call and print assistant response
6const callAssistant = async (messages) => {
7const response = await chat(messages, {
8functions: schemasWeather,
9});
10typeof response === "object"
18role: "system",
19content:
20"Don't make assumptions about what values to plug into functions. Ask for clarification if a user request is ambiguous.",
21},
22{ role: "user", content: "What's the weather like today" },
23];
24let response = await callAssistant(messages);
25// Once we provide the missing info, it will generate the appropriate function arguments
26messages.push({ role: "assistant", content: response });
27messages.push({ role: "user", content: "I'm in Glasgow, Scotland." });
28response = await callAssistant(messages);
29// By prompting it differently, we can get it to target the other function we've told
30messages.length = 1;
31messages.push({
35});
36response = await callAssistant(messages);
37// Let's provide the num of days, and model will generate the call to the other function
38messages.push({ role: "assistant", content: response });
39messages.push({ role: "user", content: "5 days" });
1export function greet(name: string) {
2name = name || "world";
3return "Hello, " + name + "!";
blogRSSTrackermain.tsx1 match
7import { parseXML } from "https://esm.town/v/stevekrouse/parseXML?v=1";
89export async function blogRSSTracker() {
10// gets newest blog from rss feed
11const blogRSSLink = "https://posthog.com/rss.xml";