1import { fetch } from "https://esm.town/v/std/fetch";
2
3export async function postHogAPICapture({ key, event, properties, distinct_id }: {
4 key: string;
5 event: string;
8}) {
9 const body = {
10 "api_key": key,
11 "event": event,
12 "properties": properties,
9async function fetchRandomJoke() {
10 const response = fetch(
11 "https://official-joke-api.appspot.com/random_joke",
12 );
13 return response.json();
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();
9export async function getGeminiModels(): Promise<GeminiModel[]> {
10 try {
11 const API_KEY = process.env.GEMINI_API_KEY;
12
13 const response = await fetch(`https://generativelanguage.googleapis.com/v1beta/models?key=${API_KEY}`);
14
15 const data = await response.json();
3async function getOpenAI() {
4 // if you don't have a key, use our std library version
5 if (Deno.env.get("OPENAI_API_KEY") === undefined) {
6 const { OpenAI } = await import("https://esm.town/v/std/openai");
7 return new OpenAI();
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();
3async function fetchRandomJoke() {
4 const response = await fetch(
5 "https://official-joke-api.appspot.com/random_joke",
6 );
7 return response.json();