2import process from "node:process";
3import { marked } from "npm:marked";
4import { OpenAI } from "npm:openai";
5
6function emailValHandlerExtra(inboundEmail: Email) {
33 );
34
35 const client = new OpenAI({ apiKey: process.env.PERPLEXITY_API_KEY, baseURL: "https://api.perplexity.ai" });
36 const response = await client.chat.completions.create({
37 model: "sonar",
2import { parseProject } from "https://esm.town/v/std/parseImportMeta/project";
3import { contentType } from "npm:mime-types@2.1.35";
4import openAI from "npm:openai";
5
6console.log("will this show up");
1import { blob } from "https://esm.town/v/std/blob";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import Algebrite from "npm:algebrite";
4import { servePublicFile } from "./index.ts";
138 */
139async function handleProblemGeneration() {
140 const openai = new OpenAI();
141 const completion = await openai.chat.completions.create({
142 model: "gpt-4",
143 messages: [
2import process from "node:process";
3import { marked } from "npm:marked";
4import { OpenAI } from "npm:openai";
5
6function pm(...lines: string[]): string {
16 );
17
18 const client = new OpenAI({ apiKey: process.env.PERPLEXITY_API_KEY, baseURL: "https://api.perplexity.ai" });
19 const response = await client.chat.completions.create({
20 model: "sonar",
2import process from "node:process";
3import { marked } from "npm:marked";
4import { OpenAI } from "npm:openai";
5
6function pm(...lines: string[]): string {
16 );
17
18 const client = new OpenAI({ apiKey: process.env.PERPLEXITY_API_KEY, baseURL: "https://api.perplexity.ai" });
19 const response = await client.chat.completions.create({
20 model: "sonar",
13console.log(emojisWithInfo);
14
15import { OpenAI } from "npm:openai";
16
17// Initialize OpenAI client
18const openai = new OpenAI();
19
20async function getEmbedding(emoji: string): Promise<number[]> {
21 const result = await openai.embeddings.create({
22 input: emoji,
23 model: "text-embedding-3-small",
189
190export default async function server(request) {
191 const { OpenAI } = await import("https://esm.town/v/std/openai");
192 const { blob } = await import("https://esm.town/v/std/blob");
193 const url = new URL(request.url);
194
195 if (url.pathname === "/problem") {
196 const openai = new OpenAI();
197 const completion = await openai.chat.completions.create({
198 model: "gpt-4",
199 messages: [
22
23export type Provider =
24 | "openai"
25 | "text-completion-openai"
26 | "azure"
27 | "azure_text"
6const pricing = Object.fromEntries(
7 Object.entries(res).filter(([_, obj]) =>
8 obj.litellm_provider === "text-completion-openai" || obj.litellm_provider === "openai"
9 ),
10);
1import { fetchOpenAiUsageData } from "https://esm.town/v/nbbaier/fetchOpenAiUsageData";
2import { DateTime } from "npm:luxon";
3import { TextData } from "./types";
8const month = date.setZone(timeZone).toFormat("LLLL").toLowerCase();
9
10const { data }: { data: TextData[] } = await fetchOpenAiUsageData(today);
11
12function removeNullValues<T extends Record<string, any>>(obj: T): Partial<T> {