Merge remote-tracking branch 'origin/master' into feat/memory
This commit is contained in:
2
.github/workflows/docker-image.yml
vendored
2
.github/workflows/docker-image.yml
vendored
@@ -113,7 +113,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
|
||||
GHCR_OWNER: ${{ github.repository_owner }}
|
||||
GHCR_OWNER: soulter
|
||||
HAS_GHCR_TOKEN: ${{ secrets.GHCR_GITHUB_TOKEN != '' }}
|
||||
|
||||
steps:
|
||||
|
||||
@@ -4,7 +4,7 @@ import os
|
||||
|
||||
from astrbot.core.utils.astrbot_path import get_astrbot_data_path
|
||||
|
||||
VERSION = "4.5.8"
|
||||
VERSION = "4.6.0"
|
||||
DB_PATH = os.path.join(get_astrbot_data_path(), "data_v4.db")
|
||||
|
||||
# 默认配置
|
||||
|
||||
@@ -299,7 +299,7 @@ class ProviderGoogleGenAI(Provider):
|
||||
# we should set thought_signature back to part if exists
|
||||
# for more info about thought_signature, see:
|
||||
# https://ai.google.dev/gemini-api/docs/thought-signatures
|
||||
if "extra_content" in tool:
|
||||
if "extra_content" in tool and tool["extra_content"]:
|
||||
ts_bs64 = (
|
||||
tool["extra_content"]
|
||||
.get("google", {})
|
||||
|
||||
23
changelogs/v4.6.0.md
Normal file
23
changelogs/v4.6.0.md
Normal file
@@ -0,0 +1,23 @@
|
||||
## What's Changed
|
||||
|
||||
1. 新增: 支持 gemini-3 系列的 thought signature ([#3698](https://github.com/AstrBotDevs/AstrBot/issues/3698))
|
||||
2. 新增: 支持知识库的 Agentic 检索功能 ([#3667](https://github.com/AstrBotDevs/AstrBot/issues/3667))
|
||||
3. 新增: 为知识库添加 URL 文档解析器 ([#3622](https://github.com/AstrBotDevs/AstrBot/issues/3622))
|
||||
4. 修复(core.platform): 修复启用多个企业微信智能机器人适配器时消息混乱的问题 ([#3693](https://github.com/AstrBotDevs/AstrBot/issues/3693))
|
||||
5. 修复: MCP Server 连接成功一段时间后,调用 mcp 工具时可能出现 `anyio.ClosedResourceError` 错误 ([#3700](https://github.com/AstrBotDevs/AstrBot/issues/3700))
|
||||
6. 新增(chat): 重构聊天组件结构并添加新功能 ([#3701](https://github.com/AstrBotDevs/AstrBot/issues/3701))
|
||||
7. 修复(dashboard.i18n): 完善缺失的英文国际化键值 ([#3699](https://github.com/AstrBotDevs/AstrBot/issues/3699))
|
||||
8. 重构: 实现 WebChat 会话管理及从版本 4.6 迁移到 4.7
|
||||
9. 持续集成(docker-build): 每日构建 Nightly 版本 Docker 镜像 ([#3120](https://github.com/AstrBotDevs/AstrBot/issues/3120))
|
||||
|
||||
---
|
||||
|
||||
1. feat: add supports for gemini-3 series thought signature ([#3698](https://github.com/AstrBotDevs/AstrBot/issues/3698))
|
||||
2. feat: supports knowledge base agentic search ([#3667](https://github.com/AstrBotDevs/AstrBot/issues/3667))
|
||||
3. feat: Add URL document parser for knowledge base ([#3622](https://github.com/AstrBotDevs/AstrBot/issues/3622))
|
||||
4. fix(core.platform): fix message mix-up issue when enabling multiple WeCom AI Bot adapters ([#3693](https://github.com/AstrBotDevs/AstrBot/issues/3693))
|
||||
5. fix: fix `anyio.ClosedResourceError` that may occur when calling mcp tools after a period of successful connection to MCP Server ([#3700](https://github.com/AstrBotDevs/AstrBot/issues/3700))
|
||||
6. feat(chat): refactor chat component structure and add new features ([#3701](https://github.com/AstrBotDevs/AstrBot/issues/3701))
|
||||
7. fix(dashboard.i18n): complete the missing i18n keys for en([#3699](https://github.com/AstrBotDevs/AstrBot/issues/3699))
|
||||
8. refactor: Implement WebChat session management and migration from version 4.6 to 4.7
|
||||
9. ci(docker-build): build nightly image everyday ([#3120](https://github.com/AstrBotDevs/AstrBot/issues/3120))
|
||||
145
dashboard/src/composables/useConversations.ts
Normal file
145
dashboard/src/composables/useConversations.ts
Normal file
@@ -0,0 +1,145 @@
|
||||
import { ref, computed } from 'vue';
|
||||
import axios from 'axios';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
export interface Conversation {
|
||||
cid: string;
|
||||
title: string;
|
||||
updated_at: number;
|
||||
}
|
||||
|
||||
export function useConversations(chatboxMode: boolean = false) {
|
||||
const router = useRouter();
|
||||
const conversations = ref<Conversation[]>([]);
|
||||
const selectedConversations = ref<string[]>([]);
|
||||
const currCid = ref('');
|
||||
const pendingCid = ref<string | null>(null);
|
||||
|
||||
// 编辑标题相关
|
||||
const editTitleDialog = ref(false);
|
||||
const editingTitle = ref('');
|
||||
const editingCid = ref('');
|
||||
|
||||
const getCurrentConversation = computed(() => {
|
||||
if (!currCid.value) return null;
|
||||
return conversations.value.find(c => c.cid === currCid.value);
|
||||
});
|
||||
|
||||
async function getConversations() {
|
||||
try {
|
||||
const response = await axios.get('/api/chat/conversations');
|
||||
conversations.value = response.data.data;
|
||||
|
||||
// 处理待加载的会话
|
||||
if (pendingCid.value) {
|
||||
const conversation = conversations.value.find(c => c.cid === pendingCid.value);
|
||||
if (conversation) {
|
||||
selectedConversations.value = [pendingCid.value];
|
||||
pendingCid.value = null;
|
||||
}
|
||||
} else if (!currCid.value && conversations.value.length > 0) {
|
||||
// 默认选择第一个会话
|
||||
const firstConversation = conversations.value[0];
|
||||
selectedConversations.value = [firstConversation.cid];
|
||||
}
|
||||
} catch (err: any) {
|
||||
if (err.response?.status === 401) {
|
||||
router.push('/auth/login?redirect=/chatbox');
|
||||
}
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
async function newConversation() {
|
||||
try {
|
||||
const response = await axios.get('/api/chat/new_conversation');
|
||||
const cid = response.data.data.conversation_id;
|
||||
currCid.value = cid;
|
||||
|
||||
// 更新 URL
|
||||
const basePath = chatboxMode ? '/chatbox' : '/chat';
|
||||
router.push(`${basePath}/${cid}`);
|
||||
|
||||
await getConversations();
|
||||
return cid;
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
async function deleteConversation(cid: string) {
|
||||
try {
|
||||
await axios.get('/api/chat/delete_conversation?conversation_id=' + cid);
|
||||
await getConversations();
|
||||
currCid.value = '';
|
||||
selectedConversations.value = [];
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
function showEditTitleDialog(cid: string, title: string) {
|
||||
editingCid.value = cid;
|
||||
editingTitle.value = title || '';
|
||||
editTitleDialog.value = true;
|
||||
}
|
||||
|
||||
async function saveTitle() {
|
||||
if (!editingCid.value) return;
|
||||
|
||||
const trimmedTitle = editingTitle.value.trim();
|
||||
try {
|
||||
await axios.post('/api/chat/rename_conversation', {
|
||||
conversation_id: editingCid.value,
|
||||
title: trimmedTitle
|
||||
});
|
||||
|
||||
// 更新本地会话标题
|
||||
const conversation = conversations.value.find(c => c.cid === editingCid.value);
|
||||
if (conversation) {
|
||||
conversation.title = trimmedTitle;
|
||||
}
|
||||
editTitleDialog.value = false;
|
||||
} catch (err) {
|
||||
console.error('重命名对话失败:', err);
|
||||
}
|
||||
}
|
||||
|
||||
function updateConversationTitle(cid: string, title: string) {
|
||||
const conversation = conversations.value.find(c => c.cid === cid);
|
||||
if (conversation) {
|
||||
conversation.title = title;
|
||||
}
|
||||
}
|
||||
|
||||
function newChat(closeMobileSidebar?: () => void) {
|
||||
currCid.value = '';
|
||||
selectedConversations.value = [];
|
||||
|
||||
const basePath = chatboxMode ? '/chatbox' : '/chat';
|
||||
router.push(basePath);
|
||||
|
||||
if (closeMobileSidebar) {
|
||||
closeMobileSidebar();
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
conversations,
|
||||
selectedConversations,
|
||||
currCid,
|
||||
pendingCid,
|
||||
editTitleDialog,
|
||||
editingTitle,
|
||||
editingCid,
|
||||
getCurrentConversation,
|
||||
getConversations,
|
||||
newConversation,
|
||||
deleteConversation,
|
||||
showEditTitleDialog,
|
||||
saveTitle,
|
||||
updateConversationTitle,
|
||||
newChat
|
||||
};
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "AstrBot"
|
||||
version = "4.5.8"
|
||||
version = "4.6.0"
|
||||
description = "Easy-to-use multi-platform LLM chatbot and development framework"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
@@ -26,7 +26,7 @@ dependencies = [
|
||||
"docstring-parser>=0.16",
|
||||
"faiss-cpu==1.10.0",
|
||||
"filelock>=3.18.0",
|
||||
"google-genai>=1.14.0",
|
||||
"google-genai>=1.14.0, <1.51.0",
|
||||
"lark-oapi>=1.4.15",
|
||||
"lxml-html-clean>=0.4.2",
|
||||
"mcp>=1.8.0",
|
||||
|
||||
Reference in New Issue
Block a user