Further Reference
Type Safety
Puzzlet allows you to collaborate on prompts while maintaining type safety in a production environment.
Puzzlet allows you to collaborate on prompts while maintaining type safety in a production environment. This includes type generation from remote environments, local development, versioning, and integration with the Puzzlet platform.
Example
Here’s a prompt with schema definitions:
math/addition.prompt.mdx
Running generate-types
will create:
puzzlet.types.ts
Generating Types
Puzzlet provides multiple ways to generate types from your prompts:
Local Development
Using Generated Types
The Puzzlet SDK is fully type-safe when using generated types:
Best Practices
-
Development:
- Use
--local
during development - Keep types in sync with your prompts
- Use
-
CICD (coming soon):
- Run type checking against the Puzzlet platform
- Check for any diffs between Puzzlet and your branch, and fail if there are any
Further Reading
Was this page helpful?