🤖 feat: Add Agent Duplication Functionality with Permission (#5022)

* 🤖 feat: Add Agent Duplication Functionality with Permission

* 🐛 fix: Enhance Agent Duplication Logic and Filter Sensitive Data

* refactor(agents/v1): reorganized variables and error logging

* refactor: remove duplication permission

* chore: update librechat-data-provider version to 0.7.64

* fix: optimize agent duplication

---------

Co-authored-by: Marco Beretta <81851188+berry-13@users.noreply.github.com>
This commit is contained in:
Danny Avila 2024-12-17 19:47:39 -05:00 committed by GitHub
parent 16eed5f32d
commit 18ad89be2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 270 additions and 38 deletions

View file

@ -1,6 +1,6 @@
{
"name": "librechat-data-provider",
"version": "0.7.63",
"version": "0.7.64",
"description": "data services for librechat apps",
"main": "dist/index.js",
"module": "dist/index.es.js",

View file

@ -428,6 +428,16 @@ export const updateAgent = ({
);
};
export const duplicateAgent = ({
agent_id,
}: m.DuplicateAgentBody): Promise<{ agent: a.Agent; actions: a.Action[] }> => {
return request.post(
endpoints.agents({
path: `${agent_id}/duplicate`,
}),
);
};
export const deleteAgent = ({ agent_id }: m.DeleteAgentBody): Promise<void> => {
return request.delete(
endpoints.agents({

View file

@ -126,6 +126,15 @@ export type UpdateAgentVariables = {
export type UpdateAgentMutationOptions = MutationOptions<Agent, UpdateAgentVariables>;
export type DuplicateAgentBody = {
agent_id: string;
};
export type DuplicateAgentMutationOptions = MutationOptions<
{ agent: Agent; actions: Action[] },
Pick<DuplicateAgentBody, 'agent_id'>
>;
export type DeleteAgentBody = {
agent_id: string;
};