3export async function time() {
4 return await fetchJSON(
5 "https://api.openaq.org/v2/latest?" +
6 new URLSearchParams({
7 limit: "10",
3// GitHub followers
4export let githubFollowers = fetchJSON(
5 "https://api.github.com/users/stevekrouse/followers"
6);
4export async function getTangleComments({ lastRunAt }) {
5 let response = await fetch(
6 "https://www.readtangle.com/members/api/comments/?limit=5&order=created_at%20DESC%2C%20id%20DESC&filter=post_id%3A6525827c68f969000134e052%2Bcreated_at%3A%3C%3D2023-10-13T20%3A55%3A23.163Z&page=2",
7 );
8 let commentsData = await response.json();
1export function myApi(name) {
2 return "hi " + name;
3}
1export function myApi(name) {
2 name = name || "Guest";
3 return `Hello, ${name}`;
1export const untitled_rt2wovqo = (async () => {
2 function myApi(name) {
3 return "hi " + name;
4 console.email("hi");
31 const client = new PineconeClient();
32 await client.init({
33 apiKey: process.env.PINECONE,
34 environment: "asia-southeast1-gcp-free",
35 });
2
3export const complete = async (prompt: string | object, options = {}) => {
4 // Initialize OpenAI API stub
5 const { Configuration, OpenAIApi } = await import("https://esm.sh/openai");
6 const configuration = new Configuration({
7 apiKey: process.env.OPENAI,
8 });
9 const openai = new OpenAIApi(configuration);
10 // Request chat completion
11 const completion = await openai.createCompletion({
21 const model = await builder();
22 const input = await prompt.format({
23 question: "What is the capital of France?",
24 });
25 const response = await model.call(input);
1import { chatMessages } from "https://esm.town/v/mario/chatMessages";
2
3// https://api.val.town/express/@nimalu.chat
4export const chat = (req, res) => {
5 const messages = chatMessages
27 li.innerHTML = '<span class="font-semibold text-gray-900">' + sender + '</span>: ' + message;
28 ul.appendChild(li)
29 fetch("https://api.val.town/eval/@nimalu.sendChatMessage('" + message + "','"+ sender + "')")
30 }
31