feat(chat): unify resource chips and browse recent files in @ mention
Add recent=true to knowledge search so the mention picker can list recent files without a keyword, and consolidate KB/FAQ/file chip styling across chat input and message history.
This commit is contained in:
@@ -458,16 +458,19 @@ export function searchKnowledge(
|
||||
offset = 0,
|
||||
limit = 20,
|
||||
fileTypes?: string[],
|
||||
options?: { agent_id?: string }
|
||||
options?: { agent_id?: string; recent?: boolean }
|
||||
) {
|
||||
const query = new URLSearchParams();
|
||||
query.set('keyword', keyword);
|
||||
if (keyword) {
|
||||
query.set('keyword', keyword);
|
||||
}
|
||||
query.set('offset', String(offset));
|
||||
query.set('limit', String(limit));
|
||||
if (fileTypes && fileTypes.length > 0) {
|
||||
query.set('file_types', fileTypes.join(','));
|
||||
}
|
||||
if (options?.agent_id) query.set('agent_id', options.agent_id);
|
||||
if (options?.recent) query.set('recent', 'true');
|
||||
return get(`/api/v1/knowledge/search?${query.toString()}`);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user