mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-26 20:34:10 +01:00
refactor: consolidate agent marketplace endpoints into main agents API and improve data management consistency
- Remove dedicated marketplace controller and routes, merging functionality into main agents v1 API - Add countPromotedAgents function to Agent model for promoted agents count - Enhance getListAgents handler with marketplace filtering (category, search, promoted status) - Move getAgentCategories from marketplace to v1 controller with same functionality - Update agent mutations to invalidate marketplace queries and handle multiple permission levels - Improve cache management by updating all agent query variants (VIEW/EDIT permissions) - Consolidate agent data access patterns for better maintainability and consistency - Remove duplicate marketplace route definitions and middleware
This commit is contained in:
parent
3f6d7ab7c7
commit
6a28d01b20
14 changed files with 291 additions and 412 deletions
|
|
@ -150,11 +150,11 @@ export function createAgentCategoryMethods(mongoose: typeof import('mongoose'))
|
|||
*/
|
||||
async function ensureDefaultCategories(): Promise<boolean> {
|
||||
const existingCategories = await getAllCategories();
|
||||
|
||||
|
||||
if (existingCategories.length > 0) {
|
||||
return false; // Categories already exist
|
||||
}
|
||||
|
||||
|
||||
const defaultCategories = [
|
||||
{
|
||||
value: 'general',
|
||||
|
|
@ -182,14 +182,14 @@ export function createAgentCategoryMethods(mongoose: typeof import('mongoose'))
|
|||
},
|
||||
{
|
||||
value: 'it',
|
||||
label: 'Information Technology',
|
||||
label: 'IT',
|
||||
description: 'Agents for IT support, technical troubleshooting, and system administration',
|
||||
order: 4,
|
||||
},
|
||||
{
|
||||
value: 'sales',
|
||||
label: 'Sales & Marketing',
|
||||
description: 'Agents focused on sales processes, customer relations, and marketing',
|
||||
label: 'Sales',
|
||||
description: 'Agents focused on sales processes, customer relations.',
|
||||
order: 5,
|
||||
},
|
||||
{
|
||||
|
|
@ -199,7 +199,7 @@ export function createAgentCategoryMethods(mongoose: typeof import('mongoose'))
|
|||
order: 6,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
await seedCategories(defaultCategories);
|
||||
return true; // Categories were seeded
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue