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();
31 const client = new PineconeClient();
32 await client.init({
33 apiKey: process.env.PINECONE,
34 environment: "asia-southeast1-gcp-free",
35 });
39 ...options,
40 }, {
41 apiKey: process.env.ASSEMBLYAI,
42 });
43 },
11 // const { LangChainTracer } = await import("npm:langchain/callbacks");
12 // const client = new Client({
13 // apiUrl: "https://api.smith.langchain.com",
14 // apiKey: process.env.LANGSMITH,
15 //});
16
17 // const tracer = new LangChainTracer({ client });
18 const callbacks = options?.verbose !== false ? [] : [];
19 // Set up API key for each providers
20 const args = extend({ callbacks }, options);
21
22 if (spec?.provider === "openai")
23 args.openAIApiKey = process.env.OPENAI_API_KEY;
24 else if (spec?.provider === "huggingface")
25 args.apiKey = process.env.HUGGINGFACE;
26 // Populate model builders
27 const setup = cond([
10 <link rel="preconnect" href="https://fonts.gstatic.com" />
11 <link
12 href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap"
13 rel="stylesheet"
14 />
5 options = {},
6) => {
7 // Initialize OpenAI API stub
8 const { OpenAI } = await import(
9 "https://esm.sh/openai"
7async function fetchRandomJoke() {
8 const response = await fetch(
9 "https://official-joke-api.appspot.com/random_joke",
10 );
11 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();
1export const getDevToPublicPosts = async (username: string) => {
2 let data = await fetch(`https://dev.to/api/articles?username=${username}`);
3 return await data.json();
4};