Current collected state Current
Observed since 20 Oct, 22:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
@0xbot/chat
0xBot Studio agent chat library
一个支持 API 密钥的 Vue 3 聊天组件库。
npm install @0xbot/chat
import { createApp } from 'vue'
import ChatLibrary from '@0xbot/chat'
import "@0xbot/chat/dist/style.css"
import Avatar from "your-avatar-address"
const app = createApp(App)
app.use(ChatLibrary, {
apiKey: 'your-api-key-here', // 必填
serverUrl: 'http://localhost:3000', // 选填
AgentAvatar: 'https://example.com/agent-avatar.png', // 必填,可以是本地图片
UserAvatar: Avatar, // 必填
loadingText: 'AI is thinking...', // 选填,自定义加载文本
emptyText: 'No messages yet', // 选填,自定义空消息文本
tradeApiKey: "xxxx-xxxx-xx"
})
app.mount('#app')
| 选项 | 类型 | 是否必填 | 默认值 | 描述 |
|---|---|---|---|---|
| apiKey | string | 是 | - | 聊天服务的 API 密钥 |
| AgentAvatar | string | 是 | null | AI 助手的头像 |
| UserAvatar | string | 是 | null | 用户的头像 |
| serverUrl | string | 否 | - | 聊天服务的服务器地址 |
| loadingText | string | 否 | 'AI is thinking...' | AI 处理时的自定义文本 |
| emptyText | string | 否 | 'No messages yet' | 空消息时的自定义文本 |
| tradeApiKey | string | No | '' | 交易的apikey |
/* 主容器 */
.chat-library {
box-sizing: border-box;
height: 100%;
position: relative;
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 16px;
}
/* 底部栏 */
.chat-bar {
display: flex;
align-items: center;
gap: 16px;
}
/* 输入框 */
.chat-bar-input {
flex: 1;
height: 44px;
outline: none;
border-radius: 99999px;
border: 1px solid #ccc;
background-color: transparent;
color: #fff;
padding: 0 16px;
min-width: 0;
}
/* 发送按钮 */
.chat-bar-send {
flex: none;
width: auto;
border: 1px solid;
height: 48px;
padding: 0 32px;
border-radius: 99999px;
cursor: pointer;
background-color: transparent;
transition: all 0.2s ease-in-out;
}
/* 发送按钮悬停效果 */
.chat-bar-send:hover {
background-color: var(--primary-color);
color: white !important;
}
/* 聊天容器(不包含底部栏) */
.chat-container {
flex: 1;
overflow-y: scroll;
scrollbar-width: none;
-ms-overflow-style: none;
}
/* 隐藏滚动条 */
.chat-container::-webkit-scrollbar {
display: none;
}
/* 聊天消息列表 */
.chat-container-list {
display: flex;
flex-direction: column;
gap: 16px;
}
/* 消息气泡 */
.message-bubble {
padding: 12px 16px;
border-radius: 8px;
max-width: 90%;
font-size: 14px;
word-break: break-all;
line-height: 24px;
}
@media (min-width: 768px) {
.message-bubble {
max-width: 70%;
font-size: 13px;
}
}
/* 头像 */
.chat-avatar {
width: 44px;
height: 44px;
max-width:44px;
max-height:44px;
min-width: 44px;
min-height: 44px;
border-radius: 8px;
}
/* 消息气泡背景 */
.chat-message {
background-color: rgba(255, 255, 255, 0.1)
}
/* 消息容器 */
.message-container {
display: flex;
}
/* 删除按钮 */
.chat-bar-trash {
width: 24px;
height: 24px;
min-width: 24px;
min-height: 24px;
color: #fff;
cursor: pointer;
}
/* 加载状态 */
.message-loading {
color: #fff;
font-style: italic;
}
/* 空消息状态 */
.message-empty {
color: #fff;
font-style: italic;
text-align: center;
}
/* 交易弹窗 */
.dodo-swap {
position: fixed;
z-index: 1000;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.35);
display: flex;
align-items: center;
justify-content: center;
}
MIT
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
@dodoex/widgetsEnvironment{
"local_name": "@dodoex/widgets",
"alias": false,
"peer_metadata": null
} | ^3.1.6 | runtime |
@fingerprintjs/fingerprintjsEnvironment{
"local_name": "@fingerprintjs/fingerprintjs",
"alias": false,
"peer_metadata": null
} | 3 | runtime |
@types/markdown-itEnvironment{
"local_name": "@types/markdown-it",
"alias": false,
"peer_metadata": null
} | ^14.1.2 | runtime |
@unocss/resetEnvironment{
"local_name": "@unocss/reset",
"alias": false,
"peer_metadata": null
} | 0.63.3 | runtime |
axiosEnvironment{
"local_name": "axios",
"alias": false,
"peer_metadata": null
} | ^1.8.4 | runtime |
highlight.jsEnvironment{
"local_name": "highlight.js",
"alias": false,
"peer_metadata": null
} | ^11.11.1 | runtime |
localforageEnvironment{
"local_name": "localforage",
"alias": false,
"peer_metadata": null
} | ^1.10.0 | runtime |
markdown-itEnvironment{
"local_name": "markdown-it",
"alias": false,
"peer_metadata": null
} | ^14.1.0 | runtime |
@vitejs/plugin-vueEnvironment{
"local_name": "@vitejs/plugin-vue",
"alias": false,
"peer_metadata": null
} | ^4.0.0 | development |
typescriptEnvironment{
"local_name": "typescript",
"alias": false,
"peer_metadata": null
} | ^4.9.3 | development |
viteEnvironment{
"local_name": "vite",
"alias": false,
"peer_metadata": null
} | ^4.0.0 | development |
vueEnvironment{
"local_name": "vue",
"alias": false,
"peer_metadata": null
} | ^3.2.45 | development |
vue-tscEnvironment{
"local_name": "vue-tsc",
"alias": false,
"peer_metadata": null
} | ^1.0.11 | development |
vueEnvironment{
"local_name": "vue",
"alias": false,
"peer_metadata": null
} | ^3.0.0 | peer |
Source distribution
{
"integrity": "sha512-qIOD62jIs3QYN7ds6wGEUjfD6HRM6QJOKyIXFrBocN6SSCtuTcw1hK1ZBdW8JKCj4BKHVMbcY2UcCOmBbHgTaw==",
"shasum": "bce44cb09961c4a9a04b204b4ec97aa08acd34b8",
"tarball": "https://registry.npmjs.org/@0xbot/chat/-/chat-1.0.11.tgz",
"fileCount": 179,
"unpackedSize": 16880905,
"signatures": [
{
"keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
"sig": "MEQCIGjqh1vh6qEoWJCEsgn3KATuTyBeMrscSrNWXbLQqErbAiAV0WQ53xxRmoYYVOrA6DQsxIE5jzXDyTyhIEeyyOWV6g=="
}
]
}Observed since 20 Oct, 22:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:ee467d5483fb1e67b36ff2b707df8a95ec4c8d378188ad8b57ffeddd1d250731