TypeChat is a library that makes it easy to build natural language interfaces using types.
翻译准备中
开发工具TypeScript · PythonGitHub @microsoft自行安装运营者未确认
试用过了吗? 点一下就好,无需登录。
尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
安装型项目无需部署域名也可验证。个人仓库可通过 GitHub 登录验证,组织仓库可使用上方的仓库验证文件。
制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗TypeChat is a library that makes it easy to build natural language interfaces using types.
Building natural language interfaces has traditionally been difficult. These apps often relied on complex decision trees to determine intent and collect the required inputs to take action. Large language models (LLMs) have made this easier by enabling us to take natural language input from a user and match to intent. This has introduced its own challenges including the need to constrain the model's reply for safety, structure responses from the model for further processing, and ensuring that the reply from the model is valid. Prompt engineering aims to solve these problems, but comes with a steep learning curve and increased fragility as the prompt increases in size.
TypeChat replaces prompt engineering with schema engineering.
Simply define types that represent the intents supported in your natural language application. That could be as simple as an interface for categorizing sentiment or more complex examples like types for a shopping cart or music application. For example, to add additional intents to a schema, a developer can add additional types into a discriminated union. To make schemas hierarchical, a developer can use a "meta-schema" to choose one or more sub-schemas based on user input.
After defining your types, TypeChat takes care of the rest by:
Types are all you need!
The TypeScript/JavaScript package requires Node.js 24.22.1 or newer. Development uses Node.js 24.22.1, pinned in .nvmrc, which includes the October 21, 2026 security fixes.
Install TypeChat for TypeScript/JavaScript:
npm install typechat
You can also work with TypeChat from source for:
To see TypeChat in action, we recommend exploring the TypeChat example projects. You can try them on your local machine or in a GitHub Codespace.
To learn more about TypeChat, visit the documentation which includes more information on TypeChat and how to get started.
GOALS.md defines what belongs in TypeChat, what does not, and what
is still under consideration. It is the primary repository policy for product
scope. Changes require explicit approval from the human project owner,
@robgruen; community interest and AI recommendations do not change it.
Read it before proposing a new direction. Ordinary in-scope maintenance follows
the normal contribution process.
We are experimenting with a gradual transition to a semi-automated repository. The initial agent-assisted workflow keeps humans in the loop, while our longer-term goal is to help community proposals progress from discussion to accepted, reviewed changes with less manual coordination. Read about the automation experiment and how to participate.
Status as of 2026-10-30 (UTC): The latest backlog assessment completed successfully after the higher execution limits merged through #490. The saved draft inventories 21 open issues and 25 open pull requests at the assessment time, with plain-language next steps and project-direction classifications.
The run used 195 model calls and 387.86 of the main assessment's 400 AI credits. Detection used a separate 8.82 credits. The inventory is complete, but verification remains partial: two CI definitions were inaccessible, and no tests or job logs were checked. The report is not acceptance of work, a GitHub Copilot code review, or merge approval.
| Milestone | Implemented | Current status |
|---|---|---|
| Community-facing automation plan | 2026-10-26 | Documented in AUTOMATION.md. |
| Manual backlog assessment, Copilot guidance, and workflow checks | 2026-10-26 | Merged via #482 on 2026-10-27 (UTC); manual assessment available on main. |
| Assessment model and reasoning effort | 2026-10-26 | GPT-6.1-sol and main-assessment max effort verified in the first live run on 2026-10-27 (UTC). |
| Reproducible workflow compilation | 2026-10-27 | Verified on GitHub: no generated-file drift and 17 passing tests. |
| First live backlog assessment | 2026-10-27 | Completed successfully; 24 issues and 26 PRs enumerated. PR investigation is partial; no dispositions are approved. |
| Clearer report language | 2026-10-27 | Writing guidance merged via #485. The successful October 29 report uses narrative entries and separates evidence from suggestions; human review remains required. |
| Assessment budget | 2026-10-27 | Main-assessment budget raised to 400 AI credits via #485, confirmed in the latest run. Detection remains separately budgeted. |
| Owner-controlled project direction | 2026-10-27 | Policy, assessment guidance, and merged via . The latest draft classifies every item against the pinned policy. Classifications are advisory; full GitHub enforcement still needs verification. |
Implementation dates do not mean a feature is enabled on GitHub. Existing maintenance and deployment workflows are unchanged. See the detailed status and workflow model configuration.
The saved report is a historical snapshot, not today's backlog. Later merges and decisions do not rewrite it or turn its recommendations into project policy.
Start with the project goals and non-goals. Proposals that would change these boundaries need an owner-approved policy change before their implementation can be accepted.
Repository automation experiment: We are experimenting with a gradual transition to a semi-automated repository. The initial agent-assisted workflow keeps humans in the loop, while our longer-term goal is to help community proposals progress from discussion to accepted, reviewed changes with less manual coordination. Read about the automation experiment and how to participate.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
The website source is in site. From the repository root:
npm --prefix site ci
npm --prefix site run build
npm --prefix site run serve
For UI changes, check keyboard navigation, including visible focus in Windows high-contrast themes. Focus indicators should have at least 3:1 contrast against the adjacent background. Check reflow at a 320 x 256 CSS-pixel viewport, equivalent to 400% zoom at 1280 x 1024. Also apply text-spacing overrides: line height of 1.5, letter spacing of 0.12em, word spacing of 0.16em, and paragraph spacing of 2em. The install command must remain readable and its copy button visible and keyboard-operable. With JavaScript disabled, the command should remain readable and the inactive copy button should be hidden.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
| Call and execution-time limits | 2026-10-29 | 1,000 calls, 60-minute agent execution, and a 100-minute enclosing job merged via #490 and used in the successful October 29 run. Credit budgets unchanged. |
| Successful policy-aware assessment | 2026-10-29 | Run details: 21 issues and 25 open PRs inventoried, with partial verification and human review still required. |
| Human follow-through | 2026-10-29 | Maintainers subsequently merged #433 and #437. These were human decisions, not automated acceptance. |
| Selected report archive | 2026-10-30 | The October 29 draft is preserved unchanged with provenance and review limits, for normal PR review. No automatic archiving is enabled. |
| Named project owner | 2026-10-30 | Policy and CODEOWNERS name @robgruen. Prepared for review; the change takes effect after merge. Existing branch-review protections are unchanged. |
| Tool boundaries and run diagnostics | 2026-10-30 | Restricted model tools and native-only metrics prepared for review. Offline replay corrects the misleading tool totals; live activation remains pending. CI access restrictions are not bypassed. |
| Owner-approved budget overrides | Not yet | Future work; no override input or approval mechanism is enabled. |
| Automatic Copilot PR reviews | 2026-10-30 | Active review rule for ready PRs targeting main and subsequent pushes; drafts are skipped. Configuration verified; observation on an eligible PR remains a follow-up. |
| Stricter human-review enforcement | Not enabled | Existing branch-review protections are retained at the owner's request. Copilot reviews do not replace human approval. |
| GitHub-native discussion, acceptance, and agent implementation | Not yet | Planned, with human approval initially. |
| Selective automatic adoption of community proposals | Not yet | Future work, subject to public criteria and maintainer approval. |