Improve local evidence search and AI capabilities
This commit is contained in:
@@ -154,7 +154,7 @@ export function createSidebarPageAiProfileRuntime(context) {
|
||||
|
||||
function pageAiSessionAgentFilterOptions(rows) {
|
||||
var byValue = { all: '全部 agent' };
|
||||
pageAiNormalizeArray(rows).forEach(function(session) {
|
||||
pageAiNormalizeArray(rows).filter(pageAiVisibleHistorySession).forEach(function(session) {
|
||||
var value = pageAiSessionAgentFilterValue(session);
|
||||
byValue[value] = pageAiSessionAgentLabel(session);
|
||||
});
|
||||
@@ -163,9 +163,16 @@ export function createSidebarPageAiProfileRuntime(context) {
|
||||
});
|
||||
}
|
||||
|
||||
function pageAiVisibleHistorySession(session) {
|
||||
var source = String(session && session.source || '').trim();
|
||||
var status = String(session && session.status || '').trim();
|
||||
var messages = pageAiNormalizeArray(session && session.messages);
|
||||
return !(source === 'draft' && status === 'draft' && messages.length === 0);
|
||||
}
|
||||
|
||||
function pageAiFilteredHistoryRows(rows) {
|
||||
var filterValue = String(pageUiState.pageAiSessionAgentFilter || 'all').trim() || 'all';
|
||||
var normalized = pageAiNormalizeArray(rows);
|
||||
var normalized = pageAiNormalizeArray(rows).filter(pageAiVisibleHistorySession);
|
||||
if (filterValue === 'all') return normalized;
|
||||
return normalized.filter(function(session) {
|
||||
return pageAiSessionAgentFilterValue(session) === filterValue;
|
||||
|
||||
Reference in New Issue
Block a user