utmostGoldRoosterREADME.md1 match
1112### Toolings
13* Llms can uses [tools](https://platform.openai.com/docs/guides/function-calling), meaning you can make this an agent and a whole lot more useful.
14
15
utmostGoldRoostermain.tsx3 matches
1import { zodResponseFormat } from "https://esm.sh/openai/helpers/zod";
2import { z } from "https://esm.sh/zod";
3import { email } from "https://esm.town/v/std/email";
4import { OpenAI } from "https://esm.town/v/std/openai";
56export default async function(e: Email) {
7const client = new OpenAI();
89const Messages = z.object({
photoEditingAIAppmain.tsx3 matches
144export default async function server(request: Request): Promise<Response> {
145const { blob } = await import("https://esm.town/v/std/blob");
146const { OpenAI } = await import("https://esm.town/v/std/openai");
147const openai = new OpenAI();
148149if (request.method === 'POST') {
170const { prompt } = await request.json();
171
172const response = await openai.images.generate({
173model: "dall-e-3",
174prompt: prompt,
audioManagermain.tsx7 matches
12import { OpenAI } from "https://esm.town/v/yawnxyz/OpenAI";
3import { fetch } from "https://esm.town/v/std/fetch";
444export class AudioManager {
45constructor(apiKey=null, uploadFunction = null, downloadFunction = null) {
46this.openai = new OpenAI(apiKey);
47this.uploadFunction = uploadFunction || this.blobUpload;
48}
68};
69const mergedOptions = { ...defaultOptions, ...options };
70const transcription = await this.openai.audio.transcriptions.create(mergedOptions);
71return transcription;
72}
80const mergedOptions = { ...defaultOptions, ...options };
8182const translation = await this.openai.audio.translations.create(mergedOptions);
83return translation;
84}
8586// returns an openai speech object
87async textToSpeech(text, options = {}) {
88const defaultOptions = {
92};
93const mergedOptions = { ...defaultOptions, ...options };
94const speech = await this.openai.audio.speech.create(mergedOptions);
95const arrayBuffer = await speech.arrayBuffer();
96const blob = new Blob([arrayBuffer], { type: "audio/mpeg" });
106};
107const mergedOptions = { ...defaultOptions, ...options };
108const speech = await this.openai.audio.speech.create(mergedOptions);
109const arrayBuffer = await speech.arrayBuffer();
110const blob = new Blob([arrayBuffer], { type: "audio/mpeg" });
emailSummaryHandlermain.tsx3 matches
2import { email } from "https://esm.town/v/std/email";
3import { extractValInfo } from "https://esm.town/v/stevekrouse/extractValInfo";
4import { OpenAI } from "npm:openai";
56function stripHtmlBackticks(html: string): string {
910export default async function(e: Email) {
11const openai = new OpenAI();
12console.log(`from: ${e.from} to: ${e.to} subject: ${e.subject}, cc: ${e.cc}, bcc: ${e.bcc}`);
1325}
2627const summary = await openai.chat.completions.create({
28messages: [
29{
highApricotImpalamain.tsx3 matches
390export default async function server(request: Request): Promise<Response> {
391const { sqlite } = await import("https://esm.town/v/stevekrouse/sqlite");
392const { OpenAI } = await import("https://esm.town/v/std/openai");
393const KEY = "highApricotImpala";
394const SCHEMA_VERSION = 2;
501);
502503const openai = new OpenAI();
504505const completion = await openai.chat.completions.create({
506messages: [
507{
emailSummaryHandlermain.tsx3 matches
1import { email } from "https://esm.town/v/std/email";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import { extractValInfo } from "https://esm.town/v/stevekrouse/extractValInfo";
489export default async function(e: Email) {
10const openai = new OpenAI();
1112const summary = await openai.chat.completions.create({
13messages: [
14{
emailSummaryHandlermain.tsx3 matches
1import { email } from "https://esm.town/v/std/email";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import { extractValInfo } from "https://esm.town/v/stevekrouse/extractValInfo";
49export default async function(e: Email) {
10console.log(e.from, e.subject);
11const openai = new OpenAI();
1213const summary = await openai.chat.completions.create({
14messages: [
15{
emailSummaryHandlermain.tsx3 matches
1import { email } from "https://esm.town/v/std/email";
2import { OpenAI } from "https://esm.town/v/std/openai";
3import { extractValInfo } from "https://esm.town/v/stevekrouse/extractValInfo";
49export default async function(e: Email) {
10console.log(e.from, e.subject);
11const openai = new OpenAI();
1213const summary = await openai.chat.completions.create({
14messages: [
15{