This repo is a starter for projects that use the tldraw ai module.
To use:
- Create a
.dev.vars
file in the root directory. - Add your OpenAI key to that file as an environment variable, i.e.
OPENAI_API_KEY=sk-your-key
. - Install dependencies with
pnpm i
- Run
pnpm run dev
- Open
http://localhost:5173/
in your browser.
To hack:
- Edit the example system prompt at
worker/openai/system-prompt.ts
. - Create new transforms and use them in
useTldrawAiExample
. - Maybe replace the OpenAI service with your own.
This project is provided under the MIT license found here. The tldraw SDK is provided under the tldraw license.
Copyright (c) 2024-present tldraw Inc. The tldraw name and logo are trademarks of tldraw. Please see our trademark guidelines for info on acceptable usage.
You can find the @tldraw/ai package on npm here. You can find tldraw on npm here.
Found a bug? Please submit an issue.
Have questions, comments or feedback? Join our discord. For the latest news and release notes, visit tldraw.dev.
Find us on Twitter/X at @tldraw or email us at mailto:[email protected].