🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

agent-universe-chat

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agent-universe-chat

agentUniverse-chat 是面向业务的 Chat UI SDK,提供了一套完整的聊天机器人解决方案,包括会话管理、消息管理、技能管理、Copilot模式、事件订阅、移动端适配、主题切换等功能。 能够帮助业务侧快速的实现商业级别的大模型对话服务。

latest
npmnpm
Version
0.0.1
Version published
Weekly downloads
3
-57.14%
Maintainers
1
Weekly downloads
 
Created
Source

agentUniverse-chat

agentUniverse-chat 是面向业务的 Chat UI SDK,提供了一套完整的聊天机器人解决方案,包括会话管理、消息管理、技能管理、Copilot模式、事件订阅、移动端适配、主题切换等功能。 能够帮助业务侧快速的实现商业级别的大模型对话服务。

快速使用

import AuChat from 'agentUniverse-chat';

const chat = new AuChat({
  container: document.getElementById('chat'), // 挂载的 DOM 元素
  disableSession: true, // 是否禁用会话管理
});

chat.open();

Config 配置项

Method 方法

会话&消息管理

配置消息

interface Config {
  // 管理左侧会话的增删改查
  sessionHandler?: {
    initSessionList(): Promise<Session[]>;
    addSession({title}: {title: string}): Promise<void>;
    deleteSession(sessionId: string): Promise<void>;
    updateSession(sessionId: string, title: string): Promise<void>;
  }

  // 管理消息列表的初始化
  messageHandler?: {
    initMessageList(sessionId: string): Promise<{ messageList: any[], attachment: Session['attachment'] }>;
  }

session 实例的数据结构见: message 实例的数据结构见:

监听消息

import { Event } from 'agentUniverse-chat';

chat.on(Event.MESSAGE_SEND, (role, message) => {
  console.log(role, message);
});

发送消息

模块

Card 卡片

import { Card } from 'agentUniverse-chat';

chat.
<Card.Markdown type={'text'}>{ message.content }</Card.Markdown>

Skill 技能

MessageAction 消息动作

Event 事件

插槽

HeadSlot 头部插槽

AsideSlot 侧边插槽

WelcomeSlot 欢迎页插槽

FAQs

Package last updated on 08 Jul 2025

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