Skip to content

Commit 654c791

Browse files
committed
Merge branch 'develop' of https://github.com/ModelEngine-Group/nexent into develop_storage_factory
2 parents ea7ac9a + 7f838ac commit 654c791

File tree

24 files changed

+525
-84
lines changed

24 files changed

+525
-84
lines changed

backend/utils/document_vector_utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,10 @@ def summarize_document(document_content: str, filename: str, language: str = LAN
595595
{"role": MESSAGE_ROLE["USER"], "content": user_prompt}
596596
]
597597

598-
# Call LLM
599-
response = llm(messages, max_tokens=max_words * 2) # Allow more tokens for generation
598+
# Call LLM, allow more tokens for generation
599+
response = llm(messages, max_tokens=max_words * 2)
600+
if not response or not response.content:
601+
return ""
600602
return response.content.strip()
601603
else:
602604
# Fallback to placeholder if no model configuration
@@ -675,6 +677,8 @@ def summarize_cluster(document_summaries: List[str], language: str = LANGUAGE["Z
675677

676678
# Call LLM
677679
response = llm(messages, max_tokens=max_words * 2) # Allow more tokens for generation
680+
if not response or not response.content:
681+
return ""
678682
return response.content.strip()
679683
else:
680684
# Fallback to placeholder if no model configuration

doc/docs/zh/opensource-memorial-wall.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
请保持消息的礼貌和尊重,符合我们的行为准则。
1717
-->
1818

19+
::: info lzysleep - 2025-11-7
20+
非常不错的项目,很适合快速上手搭建自己的Agent,赞赞赞!
21+
:::
22+
1923
::: info fishcat - 2025-10-31
2024
很好的项目,希望蒸蒸日上
2125
:::
@@ -131,6 +135,7 @@ Nexent的自然语言生成Agent以及多智能体协同是我一直在研究的
131135
::: info lyc0502 - 2025-09-29
132136
很好的项目 希望可以借此机会学到很多技术
133137
:::
138+
134139
::: info JSH - 2025-09-30
135140
从ICT认识Nexent,希望可以从开源中学到更多
136141
:::
@@ -216,12 +221,44 @@ Nexent功能如此之强大,给我很多帮助,感谢开发者!厉害
216221

217222
::: info niceman - 2025-10-29
218223
感谢 Nexent 让我踏上了开源之旅!希望能参加ict大赛长长见识。项目不错,给个star~
224+
:::
219225

220226
:::info XxHosxX - 2025-11-5
221227
希望参与ICT大赛以及Nexent平台提升自己的能力:)
228+
:::
222229

223230
::: tip Zwer1 - 2025-11-04
224231
感谢 Nexent 让我踏上了开源之旅!平台开发智能体的能力十分强大,希望能够学习到更多东西!
225232
:::
226233

234+
::: tip Zwer1 - 2025-11-04
235+
想参加ICT创新赛
236+
:::
237+
238+
::: tip Jackie - 2025-11-07
239+
期待能使用Nexent成为智能体开发大佬
240+
:::
241+
242+
::: info xiaochenIpter - 2025-11-08
243+
希望能参加ict大赛可以学习到更多知识,感谢 Nexent 让我踏上了开源之旅!平台开发智能体的能力十分强大,希望能够学习到更多东西!
244+
:::
245+
246+
::: info user - 2025-11-08
227247
"🎉 很高兴加入Nexent社区!作为新贡献者,我期待在代码优化、文档完善或测试反馈中尽一份力。#NexentCommunity 让我们一起构建更棒的项目!🚀"
248+
:::
249+
250+
::: pxqn-xing - 2025-11-08
251+
感谢Nexent让我参与ICT大赛以提升自己的能力
252+
:::
253+
254+
::: QIYAN - 2025-11-09
255+
体验华为AI技术的一天
256+
:::
257+
258+
::: tip qiyan111 - 2025-11-10
259+
想试下华为的智能体
260+
:::
261+
262+
:::info XxHosxX - 2025-11-10
263+
自动创建agent的功能挺创新的,试过其他很多平台基本上都是只能通过一句描述语言优化提示词,很少有可以通过一句描述语言直接生成agent的功能,赞!
264+
:::

frontend/app/[locale]/chat/components/chatHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ export function ChatHeader({ title, onRename }: ChatHeaderProps) {
5050
const inputRef = useRef<HTMLInputElement>(null);
5151
const { t } = useTranslation("common");
5252
const { currentLanguage, handleLanguageChange } = useLanguageSwitch();
53-
const { user } = useAuth();
54-
const isAdmin = user?.role === USER_ROLES.ADMIN;
53+
const { user, isSpeedMode } = useAuth();
54+
const isAdmin = isSpeedMode || user?.role === USER_ROLES.ADMIN;
5555

5656
const goToModelSetup = () => {
5757
router.push(`/${currentLanguage}/setup/models`);

frontend/app/[locale]/chat/internal/chatInterface.tsx

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import type React from "react";
44

5-
import { useState, useRef, useEffect } from "react";
5+
import { useState, useRef, useEffect, useCallback } from "react";
66
import { useRouter } from "next/navigation";
77
import { v4 as uuidv4 } from "uuid";
88
import { useTranslation } from "react-i18next";
@@ -61,7 +61,7 @@ const getI18nKeyByType = (type: string): string => {
6161

6262
export function ChatInterface() {
6363
const router = useRouter();
64-
const { user } = useAuth(); // Get user information
64+
const { user, isSpeedMode } = useAuth(); // Get user information
6565
const [input, setInput] = useState("");
6666
// Replace the original messages state
6767
const [sessionMessages, setSessionMessages] = useState<{
@@ -208,6 +208,45 @@ export function ChatInterface() {
208208
setShowRightPanel(false);
209209
}, [conversationManagement.conversationId]);
210210

211+
// Helper function to clear completed conversation indicator
212+
const clearCompletedIndicator = useCallback(() => {
213+
if (
214+
conversationManagement.conversationId &&
215+
conversationManagement.conversationId !== -1
216+
) {
217+
setCompletedConversations((prev) => {
218+
// Use functional update to avoid dependency on completedConversations
219+
if (prev.has(conversationManagement.conversationId)) {
220+
const newSet = new Set(prev);
221+
newSet.delete(conversationManagement.conversationId);
222+
return newSet;
223+
}
224+
return prev;
225+
});
226+
}
227+
}, [conversationManagement.conversationId]);
228+
229+
// Add useEffect to clear completed conversation indicator when user is viewing the current conversation
230+
useEffect(() => {
231+
// If current conversation is in completedConversations, clear it when user is viewing it
232+
clearCompletedIndicator();
233+
}, [conversationManagement.conversationId, clearCompletedIndicator]);
234+
235+
// Add click event listener to clear completed conversation indicator when user clicks anywhere on the page
236+
useEffect(() => {
237+
const handlePageClick = (e: MouseEvent) => {
238+
// Clear completed indicator when user clicks anywhere on the page
239+
clearCompletedIndicator();
240+
};
241+
242+
// Add click event listener to the document
243+
document.addEventListener('click', handlePageClick, true);
244+
245+
return () => {
246+
document.removeEventListener('click', handlePageClick, true);
247+
};
248+
}, [clearCompletedIndicator]);
249+
211250

212251
// Clear all timers and requests when component unmounts
213252
useEffect(() => {
@@ -1539,8 +1578,8 @@ export function ChatInterface() {
15391578
// Both admin and regular users now use dropdown menus
15401579
};
15411580

1542-
// Settings menu items based on user role
1543-
const settingsMenuItems = user?.role === "admin" ? [
1581+
// Settings menu items based on user role (speed mode is treated as admin)
1582+
const settingsMenuItems = (isSpeedMode || user?.role === "admin") ? [
15441583
// Admin has three options
15451584
{
15461585
key: "models",
@@ -1635,6 +1674,8 @@ export function ChatInterface() {
16351674
shouldScrollToBottom={shouldScrollToBottom}
16361675
selectedAgentId={selectedAgentId}
16371676
onAgentSelect={setSelectedAgentId}
1677+
onCitationHover={clearCompletedIndicator}
1678+
onScroll={clearCompletedIndicator}
16381679
/>
16391680
</div>
16401681

frontend/app/[locale]/chat/internal/memory/memoryManageModal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,10 @@ const MemoryManageModal: React.FC<MemoryManageModalProps> = ({
4545
userRole,
4646
}) => {
4747
// Get user role from authentication context
48-
const { user } = useAuth();
48+
const { user, isSpeedMode } = useAuth();
4949
const { message } = App.useApp();
5050
const role: (typeof USER_ROLES)[keyof typeof USER_ROLES] = (userRole ??
51-
(user?.role === USER_ROLES.ADMIN ? USER_ROLES.ADMIN : USER_ROLES.USER)) as (typeof USER_ROLES)[keyof typeof USER_ROLES];
51+
(isSpeedMode || user?.role === USER_ROLES.ADMIN ? USER_ROLES.ADMIN : USER_ROLES.USER)) as (typeof USER_ROLES)[keyof typeof USER_ROLES];
5252

5353
// Get user role from other hooks / context
5454
const currentUserId = "user1";

frontend/app/[locale]/chat/streaming/chatStreamFinalMessage.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ interface FinalMessageProps {
3232
hideButtons?: boolean;
3333
index?: number;
3434
currentConversationId?: number;
35+
onCitationHover?: () => void;
3536
}
3637

3738
// TTS playback status
@@ -48,6 +49,7 @@ export function ChatStreamFinalMessage({
4849
hideButtons = false,
4950
index,
5051
currentConversationId,
52+
onCitationHover,
5153
}: FinalMessageProps) {
5254
const { t } = useTranslation("common");
5355

@@ -269,6 +271,7 @@ export function ChatStreamFinalMessage({
269271
<MarkdownRenderer
270272
content={message.finalAnswer || message.content || ""}
271273
searchResults={message?.searchResults}
274+
onCitationHover={onCitationHover}
272275
/>
273276

274277
{/* Button group - only show when hideButtons is false and message is complete */}
@@ -287,6 +290,11 @@ export function ChatStreamFinalMessage({
287290
isSelected ? "bg-gray-100" : ""
288291
}`}
289292
onClick={handleMessageSelect}
293+
onMouseEnter={() => {
294+
if (onCitationHover) {
295+
onCitationHover();
296+
}
297+
}}
290298
>
291299
<span>
292300
{searchResultsCount > 0 &&

frontend/app/[locale]/chat/streaming/chatStreamMain.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export function ChatStreamMain({
3737
shouldScrollToBottom,
3838
selectedAgentId,
3939
onAgentSelect,
40+
onCitationHover,
41+
onScroll,
4042
}: ChatStreamMainProps) {
4143
const { t } = useTranslation();
4244
// Animation variants for ChatInput
@@ -325,6 +327,11 @@ export function ChatStreamMain({
325327
setAutoScroll(false);
326328
}
327329
}
330+
331+
// Clear completed conversation indicator when scrolling
332+
if (onScroll) {
333+
onScroll();
334+
}
328335
};
329336

330337
// Add scroll event listener
@@ -336,7 +343,7 @@ export function ChatStreamMain({
336343
return () => {
337344
scrollAreaElement.removeEventListener("scroll", handleScroll);
338345
};
339-
}, [shouldScrollToBottom]);
346+
}, [shouldScrollToBottom, onScroll]);
340347

341348
// Scroll to bottom function
342349
const scrollToBottom = (smooth = false) => {
@@ -544,6 +551,7 @@ export function ChatStreamMain({
544551
onOpinionChange={onOpinionChange}
545552
index={index}
546553
currentConversationId={currentConversationId}
554+
onCitationHover={onCitationHover}
547555
/>
548556
{message.role === "user" &&
549557
processedMessages.conversationGroups.has(message.id!) && (

frontend/app/[locale]/page.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default function Home() {
7777

7878
// Handle operations that require login
7979
const handleAuthRequired = (e: React.MouseEvent) => {
80-
if (!user) {
80+
if (!isSpeedMode && !user) {
8181
e.preventDefault();
8282
setLoginPromptOpen(true);
8383
}
@@ -102,7 +102,7 @@ export default function Home() {
102102

103103
// Handle operations that require admin privileges
104104
const handleAdminRequired = (e: React.MouseEvent) => {
105-
if (user?.role !== "admin") {
105+
if (!isSpeedMode && user?.role !== "admin") {
106106
e.preventDefault();
107107
setAdminRequiredPromptOpen(true);
108108
}
@@ -244,15 +244,15 @@ export default function Home() {
244244
transition={{ duration: 0.8, delay: 0.4 }}
245245
className="flex flex-col sm:flex-row gap-4"
246246
>
247-
<Link href={user ? "/chat" : "#"} onClick={handleAuthRequired}>
247+
<Link href={isSpeedMode || user ? "/chat" : "#"} onClick={handleAuthRequired}>
248248
<Button className="bg-blue-600 hover:bg-blue-700 text-white px-8 py-6 rounded-full text-lg font-medium shadow-lg hover:shadow-xl transition-all duration-300 group">
249249
<Bot className="mr-2 h-5 w-5 group-hover:animate-pulse" />
250250
{t("page.startChat")}
251251
</Button>
252252
</Link>
253253

254254
<Link
255-
href={user?.role === "admin" ? "/setup" : "#"}
255+
href={isSpeedMode || user?.role === "admin" ? "/setup" : "#"}
256256
onClick={handleAdminRequired}
257257
>
258258
<Button className="bg-blue-600 hover:bg-blue-700 text-white px-8 py-6 rounded-full text-lg font-medium shadow-lg hover:shadow-xl transition-all duration-300 group">

0 commit comments

Comments
 (0)