jdan-emojiguessr.web.val.run
  • stevekrouse avatar
    openai
    @stevekrouse
    OpenAI ChatGPT helper function This val uses your OpenAI token if you have one, and the @std/openai if not, so it provides limited OpenAI usage for free. import { chat } from "https://esm.town/v/stevekrouse/openai"; const { content } = await chat("Hello, GPT!"); console.log(content); import { chat } from "https://esm.town/v/stevekrouse/openai"; const { content } = await chat( [ { role: "system", content: "You are Alan Kay" }, { role: "user", content: "What is the real computer revolution?"} ], { max_tokens: 50, model: "gpt-4o" } ); console.log(content);
    Script
  • stevekrouse avatar
    fileToDataURL
    @stevekrouse
    File to Data URL Was built for uploading base64 encoded images to GPT4v
    Script
  • jdan avatar
    gpt4o_emoji
    @jdan
    // await getGPT4oEmoji(
    Script
  • stevekrouse avatar
    modifyImage
    @stevekrouse
    Code from https://deno.com/blog/build-image-resizing-api Useful for compressing an image before sending to chatgpt4v, for example
    Script
1
Next
v7
May 18, 2024