{"id":15509879,"url":"https://github.com/atorber/cozer","last_synced_at":"2025-03-20T16:47:16.355Z","repository":{"id":241704903,"uuid":"806351192","full_name":"atorber/cozer","owner":"atorber","description":"coze API非官方API","archived":false,"fork":false,"pushed_at":"2024-05-27T13:32:04.000Z","size":51,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-19T22:29:33.452Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atorber.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-05-27T03:02:49.000Z","updated_at":"2024-10-18T00:12:53.000Z","dependencies_parsed_at":"2024-05-29T19:32:24.595Z","dependency_job_id":"a5ba0150-bb50-4ec3-8a25-89269984cda7","html_url":"https://github.com/atorber/cozer","commit_stats":null,"previous_names":["atorber/cozer"],"tags_count":0,"template":false,"template_full_name":"atorber/coze-wechat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atorber%2Fcozer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atorber%2Fcozer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atorber%2Fcozer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atorber%2Fcozer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atorber","download_url":"https://codeload.github.com/atorber/cozer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244656183,"owners_count":20488637,"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":"2024-10-02T09:44:44.831Z","updated_at":"2025-03-20T16:47:16.336Z","avatar_url":"https://github.com/atorber.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cozer\n\n\u003e 即将发布\n\n## 概述\n\nCozer非官方coze SDK，基于coze API快速接入自己的业务系统\n\n- 获取bot列表\n- 获取bot详情\n- 启停bot\n- 添加bot\n- 对话bot\n- 查询bot对话列表\n- 查询bot对话历史\n- ...\n\n## 快速入门\n\n### 安装依赖\n\n```shell\nnpm i cozer\n```\n\n### 配置环境变量\n\n在根目录创建一个名称为.env的配置文件\n\n```yaml\nCOZE_ENDPOINT=https://api.coze.cn/open_api/v2/chat\nCOZE_TOKEN='coze的API token'\nBOT_ID='coze的bot id'\n```\n\n### 示例代码\n\n```typescript\n#!/usr/bin/env -S node --no-warnings --loader ts-node/esm\n/* eslint-disable camelcase */\n/* eslint-disable sort-keys */\nimport 'dotenv/config.js'\nimport { CozeBot, ChatV2Req } from '../src/coze.js'\n\nconst coze_token = process.env['COZE_TOKEN'] || ''\nconst bot_id = process.env['BOT_ID'] || ''\nconst cozeBot = new CozeBot({\n    api_key: coze_token,\n    bot_id,\n})\n\nconst data: ChatV2Req = {\n    conversation_id: '1234567890',\n    user: '张三',\n    query: '你好,你是谁?',\n    history_count: 5,\n    stream: false,\n}\n\nconst chatResp = await cozeBot.chat(data)\nconst urls = chatResp.extractImageUrls()\nconst answers = chatResp.extractAnswer()\n\nconsole.info('urls:', urls)\nconsole.info('answers:', answers)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatorber%2Fcozer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatorber%2Fcozer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatorber%2Fcozer/lists"}