[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-71308":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":15,"forks30d":15,"starsTrendScore":19,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":30,"readmeContent":31,"aiSummary":32,"trendingCount":15,"starSnapshotCount":15,"syncStatus":33,"lastSyncTime":34,"discoverSource":35},71308,"TypeChat","microsoft\u002FTypeChat","microsoft","TypeChat is a library that makes it easy to build natural language interfaces using types.","https:\u002F\u002Fmicrosoft.github.io\u002FTypeChat\u002F",null,"TypeScript",8664,414,57,0,1,6,12,3,70.05,"MIT License",false,"main",true,[26,27,28,29],"ai","llm","natural-language","types","2026-06-12 04:01:00","# TypeChat\n\nTypeChat is a library that makes it easy to build natural language interfaces using types.\n\nBuilding 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.\n\nTypeChat replaces _prompt engineering_ with _schema engineering_.\n\nSimply 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.\n\nAfter defining your types, TypeChat takes care of the rest by:\n\n1. Constructing a prompt to the LLM using types.\n2. Validating the LLM response conforms to the schema. If the validation fails, repair the non-conforming output through further language model interaction.\n3. Summarizing succinctly (without use of a LLM) the instance and confirm that it aligns with user intent.\n\nTypes are all you need!\n\n# Getting Started\n\nInstall TypeChat for TypeScript\u002FJavaScript:\n\n```\nnpm install typechat\n```\n\n\u003C!--\n\nOr from PyPI:\n\n...\n\nOr NuGet\n\n...\n\n-->\n\nYou can also work with TypeChat from source for:\n\n* [Python](.\u002Fpython\u002FREADME.md)\n* [TypeScript](.\u002Ftypescript\u002FREADME.md)\n* [C#\u002F.NET](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FTypeChat.net)\n\nTo see TypeChat in action, we recommend exploring the [TypeChat example projects](.\u002Ftypescript\u002Fexamples). You can try them on your local machine or in a GitHub Codespace.\n\nTo learn more about TypeChat, visit the [documentation](https:\u002F\u002Fmicrosoft.github.io\u002FTypeChat) which includes more information on TypeChat and how to get started.\n\n## Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https:\u002F\u002Fcla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https:\u002F\u002Fopensource.microsoft.com\u002Fcodeofconduct\u002F).\nFor more information see the [Code of Conduct FAQ](https:\u002F\u002Fopensource.microsoft.com\u002Fcodeofconduct\u002Ffaq\u002F) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft \ntrademarks or logos is subject to and must follow \n[Microsoft's Trademark & Brand Guidelines](https:\u002F\u002Fwww.microsoft.com\u002Fen-us\u002Flegal\u002Fintellectualproperty\u002Ftrademarks\u002Fusage\u002Fgeneral).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n","TypeChat 是一个使用类型构建自然语言接口的库。它通过定义类型来替代传统的提示工程，使得开发者能够轻松地为应用程序添加意图识别功能，支持从简单的文本分类到复杂的购物车或音乐应用等多种场景。项目利用大语言模型处理自然语言输入，并根据预定义的类型结构生成符合预期格式的响应，同时确保回复的有效性和安全性。TypeChat 适用于需要高效、准确处理用户自然语言输入的各种应用场景，如客户服务聊天机器人、个性化推荐系统等。",2,"2026-06-11 03:37:06","high_star"]