TypeChat
ActiveDescription
Microsoft's TypeScript library replacing prompt engineering with type definitions for structured LLM output, using TypeScript interfaces to define AI response contracts.
Key Features
- Type-driven LLM output constraining: replaces prompt engineering with TypeScript interface definitions for structured responses
- Automatic validation and repair: validates LLM output against schema and auto-repairs non-conforming responses via further conversation
- Concise intent summarization: summarizes instances and confirms user intent without invoking an LLM
- Multi-language support: bindings for TypeScript, Python, and C#/.NET
- Hierarchical schema support: meta-schema mechanism selects sub-schemas based on user input
- Discriminated union types: extend intent types through discriminated union definitions
Use Cases
Categories
Quick Start
1. Run: npm install typechat
2. Define TypeScript interfaces describing intents and data types
3. Create a TypeChat instance and specify the schema
4. Call instance methods to process user natural language input
5. Receive validated, structured output