Back to results
joy-void-joy/zodchat(opens in a new tab)
Language: TypeScript
Like Typechat, but with Zod!
- stars
- 4
- watchers
- 1
- forks
- 0
- open issues
- 0
- Last updated
- 02/15/2024
Language: TypeScript
Like Typechat, but with Zod!
Zodchat is a GPT-4 interface that allows you to get well-typed and structured data It is like TypeChat but with Zod and function calls
see more in examples/
const Song = zod .object({ name: zod.string().describe('Name of the song to play'), artist: zod.string().describe('Name of the artist of the song'), genre: zod .string() .array() .describe('Genre of the song using whimsical words'), vibe: zod .string() .describe('General vibe of the song using whimsical words'), }) .describe('A song to play') await prompt({ output_schema: Playlist, system_prompt: 'Please give a chill instrumental song', })
With bun:
bun add zodchat
Or yarn:
yarn add zodchat
Generate an API key, then put it in your local .env.local file:
OPENAI_API_KEY=your_key_here
or use ```sh export OPENAI_API_KEY=your_key_here
Then you can directly import and use the library:
```ts
import { prompt } from 'zodchat'