This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Maker Link by @levelsio --> | |
<!-- MIT License --> | |
<style> | |
body { | |
background:#333; | |
} | |
.levelsio-by { | |
font-family:"Helvetica Neue",sans-serif; | |
right:0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { z } from "zod"; | |
import { zodToTs, printNode } from "zod-to-ts"; | |
// Replace with your `openai` thing | |
import { openai } from "../openai.server"; | |
import endent from "endent"; | |
function createJSONCompletion<T extends z.ZodType>({ | |
prompt, | |
schema_name, |