0.0.26 • Published 12 months ago

shimo-lizard-sdk v0.0.26

Weekly downloads
-
License
-
Repository
-
Last release
12 months ago

shimo-lizard-sdk

拥有主站的创建和生成文件,上传云文件的能力

安装

yarn add shimo-lizard-sdk
# or
npm i shimo-lizard-sdk

使用

import { LizardSDK, ChatStatus, Events } from 'shimo-lizard-sdk'

const lizardSDK = new LizardSDK()

const menus = lizardSDK.getCreateMenus()

说明

// 获取一键生成菜单的列表
const menus = lizardSDK.getCreateMenus()

// 实时监听右侧文件列表的变化
lizardSDK.on(Events.FileListChange, (fileList) => {
  // 文件列表
})

// 新文档选区发生变化时触发 内容为 string
lizardSDK.on(Events.NewdocSectionChange, (content) => {
  //
})

// 灯片随机主题变化的时候
lizardSDK.on(Events.PresentationThemesRandomlyChange, (themes)) => {
  // 主题列表
})

// 幻灯片主题应用时,成后后的返回
lizardSDK.on(Events.ApplyPresentationThemeStatusChange, (status) => {
  // success | failed
})

/**
 * 对话框显隐状体啊变化 true 显示 | false 隐藏
 */
lizardSDK.on(Events.DialogVisibleChange, (visible) => {
  // true 显示 | false 隐藏
})

// 实时监听AI的聊天状态
lizardSDK.on(Events.ChatStatusChange, (statusData) => {
  // statusData 结构如下 具体可以参考 ChatStatus 的相关类型说明
  // {
  //   status: ChatStatus.Generating,
  //   info: {
  //     data, 为any
  //     text: '石小墨生成中'
  //   }
  // }
  // {
  //   status: ChatStatus.EstablishCommunication,
  //   info: {
  //     text: ''
  //    data: {
  //      conversationId: 'asdfasdf',
  //      isNewdoc: true,
  //      file: {
  //        guid: 'sdfads',
  //        name: '标题'
  //      },
  //    }
  //   }
  // }
})

// 隐藏AI对话框
lizardSDK.hideAIDialog()

// 清空 AI 对话框 调用此方法后,需要在UI层面清空对话内容
lizardSDK.clearAIDialog('conversationId')

// 发送文本内容
lizardSDK.sendText({
  text: "这是文字内容",
  conversationId: 'conversationId'
})

// 发送文本和文件列表
lizardSDK.sendTextAndFiles({ text: “请帮我翻译这些文档”, files: [{
  name: '调研报告',
  guid: 'abcabc',
  conversationId: 'conversationId'
}]})

// 取消某个文件的上传
lizardSDK.cancelUpload({
  name: '调研报告',
  guid: 'abcabc',
})

// 重新上传文件
lizardSDK.reUpload({
  name: '调研报告',
  guid: 'abcabc',
})

// 停止 AI 继续生成内容
lizardSDK.stopGenerateContent('conversationId')

// 重新生成
lizardSDK.regenerateContent({
  messageId: 'messageId',
  conversationId: 'conversationId',
})

// 复制内容
lizardSDK.copyContent('这是要复制的文本内容')

// 根据类型 创建文件 目前只支持 新文档、幻灯片 newdoc presentation
lizardSDK.createFileByType({
  createType: 'newdoc',
  content: '这是要初始化的内容',
  conversationId: 'conversationId',
})

// 保存图片
lizardSDK.saveImage({
  b64Image: 'this_is_base64_string',
  name: '这是图片标题',
  conversationId: 'conversationId'
})

// 跳转链接
lizardSDK.gotoUrl('/docs/:guiid')

// 向新文档插入内容
lizardSDK.insertTextTonNewdoc('content')


// 应用幻灯片主题
lizardSDK.applyPresentationTheme({
  type: 'all', // 'all' | 'selected'
  id: 'asdfasdf',
})


// 获取幻灯片随机主题
lizardSDK.getPresentationThemesRandomly(4) // number 默认为4

// 对文本生成幻灯片可以展示的大纲
lizardSDK.getPPTOutlineByText({
  text: '这是需要生成的内容',
  conversationId: 'asdfasdf',
})
0.0.26

12 months ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.22

1 year ago

0.0.23

1 year ago

0.0.20

1 year ago

0.0.21

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.16

1 year ago

0.0.17

1 year ago

0.0.15

1 year ago

0.0.14

1 year ago

0.0.10

1 year ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.13

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.5

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1-1

1 year ago

0.0.1

1 year ago