TypeChat is a library that enables building natural language interfaces by leveraging type definitions (TypeScript interfaces, Zod schemas, Python TypedDicts/dataclasses) to structure LLM interactions. Instead of prompt engineering, it uses schema engineering: types define the expected output structure, which is used to construct prompts, validate LLM responses, and repair invalid outputs through iterative LLM calls. The library provides a clean abstraction over LLM APIs (OpenAI/Azure OpenAI) with retry, timeout, proxy, and response-size limiting. It supports both direct JSON translation and program generation (multi-step function calls). Implemented in TypeScript and Python with parallel APIs, it includes a rich set of examples (sentiment analysis, coffee shop ordering, calendar management, music control, math, drawing, health data, crossword, multi-agent routing) and comprehensive test suites. The codebase demonstrates strong engineering practices: clean separation of concerns (model, validator, translator), well-tested schema conversion (Python types to TypeScript declarations), and safe program interpretation. While still in early version (0.1.4), it is actively maintained with CI/CD, dependabot alerts, and a documentation site.
This repository is a research artifact from the NL2Bash project (LREC 2018), providing a dataset and neural semantic parser for translating natural language descriptions into Bash one-liners. The core contributions include a parallel corpus of ~10k NL–Bash pairs, TensorFlow-based sequence-to-sequence models with attention and copy mechanisms, a custom Bash command parser (bashlint) that normalizes commands using a grammar extracted from man pages, and evaluation tools including tree edit distance and manual judgment pipelines. The codebase is primarily a research prototype with pre-trained model checkpoints, data preprocessing scripts, and evaluation files. While the dataset and parser are valuable, the dependency on TensorFlow 1.x, JavaCC, and Python 2/3 compatibility indicates significant drift. The repository is no longer actively maintained, but the documented methodology and reusable components (e.g., tree edit distance, statistical spell checker) remain relevant for similar NL-to-code tasks.