一覧へ戻る
joy-void-joy/zodchat(新しいタブで開きます)
主要言語: TypeScript
Like Typechat, but with Zod!
- star 数
- 4
- watcher 数
- 1
- fork 数
- 0
- issue 数
- 0
- 最終更新
- 2024/02/15
主要言語: 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'