{"id":19228143,"url":"https://github.com/unit-mesh/choco-builder","last_synced_at":"2025-04-09T15:09:40.525Z","repository":{"id":191568820,"uuid":"684436166","full_name":"unit-mesh/choco-builder","owner":"unit-mesh","description":"ChocoBuilder (Chocolate Factory) is a cutting-edge LLM toolkit designed to empower you in creating your very own AI assistant.Chocolate Factory 是一款开源的 LLM 应用开发框架，旨在帮助您轻松打造强大的软件开发 SDLC + LLM 生成助手。无论您是需要生成前端页面、后端 API、SQL 图表，还是测试用例数据，Chocolate Factory 都能满足您的需求。","archived":false,"fork":false,"pushed_at":"2024-07-24T01:45:29.000Z","size":25344,"stargazers_count":214,"open_issues_count":0,"forks_count":20,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-09T15:09:31.043Z","etag":null,"topics":["agent","aigc","genaistack","llm","multi-agents","openai"],"latest_commit_sha":null,"homepage":"https://framework.unitmesh.cc/","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unit-mesh.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-29T05:52:57.000Z","updated_at":"2025-03-31T01:24:06.000Z","dependencies_parsed_at":"2023-10-17T09:45:45.943Z","dependency_job_id":"326e57cd-3915-4e86-a70d-b569f3858fe1","html_url":"https://github.com/unit-mesh/choco-builder","commit_stats":null,"previous_names":["unit-mesh/chocolate-factory","unit-mesh/choco-builder"],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unit-mesh%2Fchoco-builder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unit-mesh%2Fchoco-builder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unit-mesh%2Fchoco-builder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unit-mesh%2Fchoco-builder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unit-mesh","download_url":"https://codeload.github.com/unit-mesh/choco-builder/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055282,"owners_count":21040157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","aigc","genaistack","llm","multi-agents","openai"],"created_at":"2024-11-09T15:26:53.609Z","updated_at":"2025-04-09T15:09:40.482Z","avatar_url":"https://github.com/unit-mesh.png","language":"Kotlin","funding_links":[],"categories":["Kotlin","人工智能"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://framework.unitmesh.cc/\"\u003e\u003cimg src=\"docs/logo.svg\" alt=\"Logo\" height=170\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003ch1 align=\"center\"\u003eChocoBuilder (aka Chocolate Factory)\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://img.shields.io/github/stars/unit-mesh/chocolate-factory\" alt=\"stars\"\u003e\n\u003ca href=\"https://github.com/unit-mesh/chocolate-factory/actions/workflows/build.yml\"\u003e\u003cimg src=\"https://github.com/unit-mesh/chocolate-factory/actions/workflows/build.yml/badge.svg\" alt=\"CI\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://hub.docker.com/r/unitmesh\"\u003e\u003cimg src=\"https://img.shields.io/docker/v/unitmesh/chocolate-factory/latest\" alt=\"Docker Image Version (latest semver)\" /\u003e\u003c/a\u003e\n\u003ca href=\"https://central.sonatype.com/namespace/cc.unitmesh\"\u003e\u003cimg src=\"https://img.shields.io/maven-central/v/cc.unitmesh/cocoa-core\"  alt=\"Maven\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n[Read the docs →](https://framework.unitmesh.cc/)\n\n## What is ChocoBuilder?\n\n\u003e ChocoBuilder (origin Chocolate Factory) 是一款开源的 LLM 应用开发框架，旨在帮助您轻松打造强大的软件开发 SDLC + LLM 生成助手。\n\nFor native (Android/iOS/Embedded device) SDK:\nsee in [https://github.com/unit-mesh/edge-infer](https://github.com/unit-mesh/edge-infer)\n\n\u003cimg src=\"docs/architecture.svg\" alt=\"Architecture\" width=\"100%\" height=\"auto\" /\u003e\n\n## QuickStart\n\n方式 1：集成到 JVM 项目中\n\n模块列表：[https://central.sonatype.com/namespace/cc.unitmesh](https://central.sonatype.com/namespace/cc.unitmesh)\n\n```groovy\ndependencies {\n    // 核心模块\n    implementation 'cc.unitmesh:cocoa-core:1.0.0'\n    // Pinecone\n    implementation 'cc.unitmesh:store-pinecone:1.0.0'\n    // ElasticSearch\n    implementation 'cc.unitmesh:store-elasticsearch:1.0.0'\n    //...其它模块\n}\n```\n\n更多示例见：[examples/](https://github.com/unit-mesh/chocolate-factory-examples)\n\n方式 2：使用 RAGScript\n\n```kotlin\n@file:DependsOn(\"cc.unitmesh:rag-script:1.0.0\")\n\nimport cc.unitmesh.rag.*\n\nrag {\n    indexing {\n        val chunks = document(\"README.md\").split()\n        store.indexing(chunks)\n    }\n\n    querying {\n        store.findRelevant(\"workflow dsl design \")\n            .lowInMiddle()\n            .also {\n                println(it)\n            }\n    }\n}\n```\n\n方式 3：本地部署示例\n\n```bash\ngit clone https://github.com/unit-mesh/chocolate-factory\n# modify OPENAI_API_KEY and OPENAI_HOST in docker-compose.yml\ndocker-compose up\n```\n\n## Use Cases\n\nDesktop/IDE: \n\n- [https://github.com/unit-mesh/auto-dev](https://github.com/unit-mesh/auto-dev) - The AI-powered coding wizard with multilingual support 🌐, auto code generation 🏗️, and a helpful bug-slaying assistant \n- [https://github.com/phodal/shire](https://github.com/phodal/shire) - AI Coding Agent Language\n\nServer:\n\n- [https://github.com/unit-mesh/devops-genius/](https://github.com/unit-mesh/devops-genius/)\n\nAndroid:\n\n- [https://github.com/unit-mesh/android-semantic-search-kit](https://github.com/unit-mesh/android-semantic-search-kit)\n\n## Development\n\nSee in [https://framework.unitmesh.cc/](https://framework.unitmesh.cc/) or see in [documents](./docs)\n\n## Design Philosophy: Domain Driven Problem-Solving\n\nThe key concepts of ChocoBuilder are:\n\n![ChocoBuilder Concepts](docs/images/chocolate-factory.svg)\n\n(PS: Origin made by Michael Plöd\nat [Aligning organization and architecture with strategic DDD](https://speakerdeck.com/mploed/aligning-organization-and-architecture-with-strategic-ddd))\n\nA user's problem is processed by the following steps:\n\n1. [ProblemClarifier.kt](cocoa-core/src/main/kotlin/cc/unitmesh/cf/core/flow/ProblemClarifier.kt)\n2. [ProblemAnalyzer.kt](cocoa-core/src/main/kotlin/cc/unitmesh/cf/core/flow/ProblemAnalyzer.kt)\n3. [SolutionDesigner.kt](cocoa-core/src/main/kotlin/cc/unitmesh/cf/core/flow/SolutionDesigner.kt)\n4. [SolutionReviewer.kt](cocoa-core/src/main/kotlin/cc/unitmesh/cf/core/flow/SolutionReviewer.kt)\n5. [SolutionExecutor.kt](cocoa-core/src/main/kotlin/cc/unitmesh/cf/core/flow/SolutionExecutor.kt)\n\n- Online Demo: [https://framework.unitmesh.cc/](https://framework.unitmesh.cc/) (TODO)\n- Video Demo: [https://www.bilibili.com/video/BV1T14y1C7p2](https://www.bilibili.com/video/BV1T14y1C7p2)\n- Gif Demo: ![ChocoBuilder Demo](https://unitmesh.cc/cf/testcase-demo.gif)\n\n### Example 1: Frontend Screenshot\n\n- 步骤 1：ProblemClarifier：使用响应式布局，编写一个聊天页面\n    - 步骤 1.1：ProblemClarifier：左边是一个导航，中间是聊天区，聊天区的下方是一个输入按钮。\n- 步骤 2：SolutionDesigner：请确认以下的设计是否符合您的要求。如果符合，请回复\"YES\"，如果不符合，请提出你的要求。\n- 步骤 3：SolutionExecutor：生成一个聊天页面\n\n![Frontend](https://unitmesh.cc/cf/chocolate-factory-fe-demo-1.png)\n\n### Example 2: 语义化代码搜索\n\n- 步骤 1：ProblemAnalyzer 分析用户的需求，转为成多个语义化的查询\n    - 中文、英文、HyDE 模式\n- 步骤 2：SolutionExecutor：根据用户的需求，从数据库中检索出最相关的代码片段，由 ChatGPT 做总结\n\n示例输入：Semantic Workflow 是如何实现的？\n\n最终输出：\n\n![Semantic](https://unitmesh.cc/cf/semantic-query-example.png)\n\n### Example 3: Testcase Generator\n\n- 步骤 1：ProblemAnalyzer 分析用户的需求，确认是否是一个测试用例生成的需求\n    - [x] 多 Temperature 模式：TemperatureMode.Default, TemperatureMode.Creative\n- 步骤 2：SolutionDesigner 设计测试用例生成的方案\n- 步骤 3：SolutionReviewer 确认方案是否符合用户的需求\n\n示例输入：用户发表文章\n\n最终输出：\n\n![Testcases](https://unitmesh.cc/cf/chocolate-factory-demo-3.png)\n\n### Examples 4: Code Interpreter\n\n- 步骤 1：SolutionExecutor\n\n#### 示例 1：编写乘法表\n\n输出示例：\n\n```markdown\n1    2    3    4    5    6    7    8    9\n2    4    6    8    10    12    14    16    18\n3    6    9    12    15    18    21    24    27\n4    8    12    16    20    24    28    32    36\n5    10    15    20    25    30    35    40    45\n6    12    18    24    30    36    42    48    54\n7    14    21    28    35    42    49    56    63\n8    16    24    32    40    48    56    64    72\n9    18    27    36    45    54    63    72    81    \n```\n\n#### 示例 2：根据需求生成图表 （TODO）\n\n生成一个 2023 年上半年电费图，信息如下：###1~6 月：201.2,222,234.3,120.2,90,90.4###\n\n过程代码：\n\n```kotlin-scripting\n%use lets-plot\n\nimport kotlin.math.PI\nimport kotlin.random.Random\n\n\nval incomeData = mapOf(\n    \"x\" to listOf(\"一月\", \"二月\", \"三月\", \"四月\", \"五月\", \"六月\"),\n    \"y\" to listOf(201.2, 222, 234.3, 120.2, 90, 94.4)\n)\nletsPlot(incomeData) { x = \"x\"; y = \"y\" } +\n        geomBar(stat = Stat.identity) +\n        geomText(labelFormat = \"\\${.2f}\") { label = \"y\"; } +\n        ggtitle(\"2023 年上半年电费\")\n```\n\n最终输出：\n\n![Frontend](https://unitmesh.cc/cf/chocolate-factory-demo-2.png)\n\n## License\n\nRAG relevant modules were inspired by\n\n- [LangChain4j](https://github.com/langchain4j/langchain4j)\n- [LangChain](https://github.com/hwchase17/langchain)\n- [LlamaIndex](https://github.com/jerryjliu/llama_index)\n- [Spring AI](https://github.com/spring-projects-experimental/spring-ai)\n\nSome RAG modules based on LangChain4j and Spring AI which is licensed under the Apache License 2.0.\n\nThis code is distributed under the MPL 2.0 license. See `LICENSE` in this directory.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funit-mesh%2Fchoco-builder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funit-mesh%2Fchoco-builder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funit-mesh%2Fchoco-builder/lists"}