{"id":27957866,"url":"https://github.com/tencentcloudbase/cloudbase-ai-example","last_synced_at":"2025-05-07T18:15:01.148Z","repository":{"id":277124519,"uuid":"930231151","full_name":"TencentCloudBase/cloudbase-ai-example","owner":"TencentCloudBase","description":"云开发AI能力示例项目（小程序）","archived":true,"fork":false,"pushed_at":"2025-02-17T10:08:50.000Z","size":1870,"stargazers_count":10,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-07T18:14:56.073Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TencentCloudBase.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-02-10T09:47:05.000Z","updated_at":"2025-05-05T08:07:35.000Z","dependencies_parsed_at":"2025-02-12T09:41:54.570Z","dependency_job_id":"e7875d74-aae2-4aec-87fd-6bec958bd899","html_url":"https://github.com/TencentCloudBase/cloudbase-ai-example","commit_stats":null,"previous_names":["tencentcloudbase/cloudbase-ai-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentCloudBase%2Fcloudbase-ai-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentCloudBase%2Fcloudbase-ai-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentCloudBase%2Fcloudbase-ai-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TencentCloudBase%2Fcloudbase-ai-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TencentCloudBase","download_url":"https://codeload.github.com/TencentCloudBase/cloudbase-ai-example/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252931508,"owners_count":21827112,"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":[],"created_at":"2025-05-07T18:15:00.688Z","updated_at":"2025-05-07T18:15:01.143Z","avatar_url":"https://github.com/TencentCloudBase.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 云开发 AI 调用示例项目\n\n![](https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/fc336e5e-76b2-4f6f-920a-2998baed2478.png)\n\n## 快速开始\n\n### 1. 开通云开发，获取环境 ID\n\n打开微信开发工具，点击上方「云开发」按钮，开通云开发\n\n![](https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/60c8370c-2d59-4776-b329-c946e9eabe94.png)\n\n在云开发控制台中，获取到环境 ID\n\n![](https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/af1b8049-679b-4029-b09f-29680926380c.jpg)\n\n### 2. 配置环境 ID\n\n在 `miniprogram/app.js` 中\n\n```js\nApp({\n  onLaunch: function () {\n    const envID = \"\u003c此处填入云开发环境ID\u003e\";\n    // ……\n  },\n});\n```\n\n在 `components/agent-ui/index.js` 中，启用 init，并配置 envID\n\n```js\nsdk.init({\n  envID: \"\u003c此处填入云开发环境ID\u003e\",\n  appConfig: {},\n});\n```\n\n### 3. 创建 Agent（智能体），获得 Agent ID\n\n进入 [云开发平台 AI+ 能力](https://tcb.cloud.tencent.com/dev?#/ai?tab=agent) ，创建一个新的 Agent。\n\n![](https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/15f24570-7f13-42ed-880a-1a4b2c1512c4.png)\n\n点击页面中上方的「复制 ID」，我们会获得一个 `bot-id`，即 Agent ID 唯一标识，在下面的代码中会用到。\n\n### 4. 将 Agent ID 填入示例 2 和示例 3\n\n在以下两个文件中填入第 3 步里获取到的 Agent ID：\n\n- `example2-chat-with-agent/index.js`\n- `example3-using-chat-component/index.js`\n\n随后即可使用示例 Demo\n\n## 问题反馈\n\n如您有任何模板使用问题，欢迎提交 Issue，或者加入用户交流群\n\n![](https://cloudcache.tencent-cloud.com/qcloud/ui/static/static_source_business/c14f5766-59cf-4d98-acda-0b83eb501da8.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftencentcloudbase%2Fcloudbase-ai-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftencentcloudbase%2Fcloudbase-ai-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftencentcloudbase%2Fcloudbase-ai-example/lists"}