New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@chatopera/sdk

Package Overview
Dependencies
Maintainers
3
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chatopera/sdk

Deliver chatbot for Enterprises, https://bot.chatopera.com

  • 2.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
96
increased by433.33%
Maintainers
3
Weekly downloads
 
Created
Source

Chatopera开发者平台:809987971, 点击链接加入群聊

Chatopera


Chatopera提供聊天机器人开发者平台,Chatopera SDK 用于在 Node.js 应用中集成聊天机器人服务

安装


npm install @chatopera/sdk --save

使用文档

快速开始,类接口定义和实例化文档等,参考 文档中心

https://docs.chatopera.com/products/chatbot-platform/integration.html

命令行工具

Chatopera Node.js SDK 包括一些常用的命令,辅助开发者实现对话机器人。

获得帮助

打印可用命令。

bot --help

连接聊天机器人

在命令行终端连接 Bot 并进行对话。

Usage: connect [options]

Options:
  -c, --clientid <value>      ClientId of the bot, *required.
  -u, --username <value>      Username to chat with bot, *required.
  -s, --clientsecret [value]  Client Secret of the bot, optional, default null
  -p, --provider [value]      Chatopera Superbrain Instance URL, optional, default https://bot.chatopera.com
  -h, --help                  output usage information

其中,clientidclientsecret从每个机器人的设置页面获取,username代表用户名,是一个不含空格或特殊符号的字符串,每个用户的唯一标识,providerChatopera 机器人平台地址,默认为 Chatopera 云服务

示例:

bot connect -c xxx -s xxx -u zhangsan

上传多轮对话脚本

在命令行终端发布脚本文件到多轮对话中。

Usage: deploy [options]

Options:
  -c, --clientid <value>      ClientId of the bot, *required.
  -b, --botarchive <value>    Conversation Bundle, *required.
  -s, --clientsecret [value]  Client Secret of the bot, optional, default null.
  -p, --provider [value]      Chatopera Superbrain Instance URL, optional, default https://bot.chatopera.com
  -h, --help                  output usage information

其中 botarchive 为机器人的文件目录和xx.c66文件,支持相对路径绝对路径

标准目录结构:

botarchive
├── index.json
├── plugin.js
└── zh_CN.greeting.ms

其中,index.json描述机器人多轮对话属性:

{
    "name": "大白",
    "primaryLanguage": "zh_CN",
    "version": "0.5.0",
    "conversations": [
        {
            "name": "greeting",
            "enabled": true
        }
    ],
    "config": // 环境变量Key-Value
    {
    }
}

plugin.js函数,参考说明文档

Contribute

打印调试日志

export DEBUG=chatopera*
cp sample.env .env # edit .env
npm run test

license

Apache 2.0

Copyright 2018-2020, 北京华夏春松科技有限公司. All rights reserved. This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

chatoper banner

Keywords

FAQs

Package last updated on 22 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc