1Migrated from folder: External_APIs/openai/function_calling/gpt4FunctionCallingExample
9To use it on your own Val Town SQLite database, [fork it](https://www.val.town/v/stevekrouse/sqlite_admin/fork) to your account.
10
11It uses [basic authentication](https://www.val.town/v/pomdtr/basicAuth) with your [Val Town API Token](https://www.val.town/settings/api) as the password (leave the username field blank).
12
13Migrated from folder: utils/sqlite_admin/sqlite_admin
302 <script src="https://unpkg.com/htmx.org@1.9.6/dist/htmx.min.js">
303 </script>
304 <link rel="preconnect" href="https://fonts.googleapis.com" />
305 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
306 <link
307 href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;1,500&display=swap"
308 rel="stylesheet"
309 />
80```
81
82### Lower-level API
83
84We provide access to the lower-level getter and setters,
87
88* `async get(key: string)`: Retrieves a blob for a given key.
89* `async set(key: string, value: string | BodyInit)`: Sets the blob value for a given key. See [BodyInit](https://deno.land/api@v1.38.1?s=BodyInit).
90
91### Limitations
4 async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
8 return response.json();
2
3export const untitled_orangeImpala = fetchJSON(
4 "https://api.openai.com/v1/usage?date=2023-11-01",
5 {
6 headers: {
3This uses the brand new `gpt-4-1106-preview`.
4
5To use this, set `OPENAI_API_KEY` in your [Val Town Secrets](https://www.val.town/settings/secrets).
6
7Migrated from folder: Archive/IntroVideo/gpt4Example
6import OpenAI from "npm:openai";
7
8const openai = new OpenAI({ apiKey: process.env.openai });
9
10export async function emojiSearchBot({ lastRunAt }: Interval) {
14 }&expansions=attachments.media_keys&media.fields=duration_ms,height,media_key,preview_image_url,public_metrics,type,url,width,alt_text`;
15 const result = await twitterJSON({
16 url: `https://api.twitter.com/2/users/1721850098575908864/mentions` + query,
17 bearerToken: process.env.twitter,
18 });
2import OpenAI from "npm:openai";
3
4const openai = new OpenAI({ apiKey: process.env.openai });
5
6async function main() {
10 <style>
11 {`
12 @import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz);
13 @import url(https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic);
14 @import url(https://fonts.googleapis.com/css?family=Ubuntu+Mono:400,700,400italic);
15
16 body { font-family: 'Droid Serif'; }