@cobrowser/chatgpt

中文文档
0.7.55发布于 2026/10/29TypeScriptCommonJS近 30 天下载 5915

chatgpt services to connect our projects with chatgpt api

原始使用文档
文档目录3 节
  1. Current Available Services
  2. CoPilotService
  3. Translation Service

ChatGpt Lib

it is a list of services to use to work with ChatGPT API

Before working with the API make sure you have the `OPEN AI API KEY` in the env variables 
it should be avaliable with process.env.OPEN_AI_API_KEY

the API key will be used to make authorization with the openAI APIs OPEN_AI_API_KEY process.env.OPEN_AI_API_KEY

Current Available Services

we will have a list of services to use for different purposes

CoPilotService

a service that can be used to make products recommendation and quick replies suggestion

Usage

to suggest some quick replies for a conversation

const { CopilotService } = require('@cobrowser/chatgpt');
const copilotService = new CopilotService();
const conversation = `
  Customer: Hello
  Agent: Hello
  Customer: Need some help
`;

/**
 * return a promise that will resolve a string ( a list of suggestions )  or an undefined or an error
 */
copilotService.suggest(conversation);

Translation Service

can be used to translate a text from one language to another

Usage


const { TranslationService } = require('@cobrowser/chatgpt');
const service = new TranslationService();
const translation = await service.translate('Text to Translate');
translate(text: string, toLanguage = 'English', fromLanguage?: string)
By Default if languages didn't specifed the default language to translate to will be English 

All services will have their API documentation (thanks to Typescript)

版本与发布记录

@cobrowser/chatgpt 共发布 95 个版本,首次发布于 2023/04/11;过去 12 个月发布了 27 个版本。

版本发布日期距今
0.7.55latest2026/10/2911 天前
0.7.542026/10/2218 天前
0.7.532026/10/2119 天前
0.7.522026/06/164 个月前
0.7.512026/06/015 个月前
0.7.502026/05/195 个月前

关于 @cobrowser/chatgpt 的常见问题

@cobrowser/chatgpt 是什么?

chatgpt services to connect our projects with chatgpt api

如何安装 @cobrowser/chatgpt?

在项目目录运行 npm install @cobrowser/chatgpt,或使用 pnpm add / yarn add / bun add。

@cobrowser/chatgpt 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@cobrowser/chatgpt 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@cobrowser/chatgpt 可以商用吗?

@cobrowser/chatgpt 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@cobrowser/chatgpt 的下载量有多少?

根据 npm 官方下载统计,@cobrowser/chatgpt 在 2026/10/10 – 2026/11/08 这 30 天内被下载 5,915 次,日均约 197 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cobrowser/chatgpt 还在维护吗?

最新版本 0.7.55 发布于 2026/10/29(11 天前);至今共发布 95 个版本,其中过去 12 个月发布了 27 个;首次发布于 2023/04/11。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。