mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-02 14:20:18 +01:00
Merge branch 'dev' into feat/Multitenant-login-OIDC
This commit is contained in:
commit
edaa357e9d
26 changed files with 2362 additions and 16 deletions
|
|
@ -187,6 +187,8 @@ export const agents = ({ path = '', options }: { path?: string; options?: object
|
|||
return url;
|
||||
};
|
||||
|
||||
export const revertAgentVersion = (agent_id: string) => `${agents({ path: `${agent_id}/revert` })}`;
|
||||
|
||||
export const files = () => '/api/files';
|
||||
|
||||
export const images = () => `${files()}/images`;
|
||||
|
|
|
|||
|
|
@ -431,6 +431,14 @@ export const listAgents = (params: a.AgentListParams): Promise<a.AgentListRespon
|
|||
);
|
||||
};
|
||||
|
||||
export const revertAgentVersion = ({
|
||||
agent_id,
|
||||
version_index,
|
||||
}: {
|
||||
agent_id: string;
|
||||
version_index: number;
|
||||
}): Promise<a.Agent> => request.post(endpoints.revertAgentVersion(agent_id), { version_index });
|
||||
|
||||
/* Tools */
|
||||
|
||||
export const getAvailableAgentTools = (): Promise<s.TPlugin[]> => {
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ export enum MutationKeys {
|
|||
updateAgentAction = 'updateAgentAction',
|
||||
deleteAction = 'deleteAction',
|
||||
deleteAgentAction = 'deleteAgentAction',
|
||||
revertAgentVersion = 'revertAgentVersion',
|
||||
deleteUser = 'deleteUser',
|
||||
updateRole = 'updateRole',
|
||||
enableTwoFactor = 'enableTwoFactor',
|
||||
|
|
|
|||
|
|
@ -222,6 +222,7 @@ export type Agent = {
|
|||
hide_sequential_outputs?: boolean;
|
||||
artifacts?: ArtifactModes;
|
||||
recursion_limit?: number;
|
||||
version?: number;
|
||||
};
|
||||
|
||||
export type TAgentsMap = Record<string, Agent | undefined>;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,20 @@ export type UpdateAgentVariables = {
|
|||
data: AgentUpdateParams;
|
||||
};
|
||||
|
||||
export type UpdateAgentMutationOptions = MutationOptions<Agent, UpdateAgentVariables>;
|
||||
export type DuplicateVersionError = Error & {
|
||||
statusCode?: number;
|
||||
details?: {
|
||||
duplicateVersion?: any;
|
||||
versionIndex?: number
|
||||
}
|
||||
};
|
||||
|
||||
export type UpdateAgentMutationOptions = MutationOptions<
|
||||
Agent,
|
||||
UpdateAgentVariables,
|
||||
unknown,
|
||||
DuplicateVersionError
|
||||
>;
|
||||
|
||||
export type DuplicateAgentBody = {
|
||||
agent_id: string;
|
||||
|
|
@ -159,6 +172,13 @@ export type DeleteAgentActionVariables = {
|
|||
|
||||
export type DeleteAgentActionOptions = MutationOptions<void, DeleteAgentActionVariables>;
|
||||
|
||||
export type RevertAgentVersionVariables = {
|
||||
agent_id: string;
|
||||
version_index: number;
|
||||
};
|
||||
|
||||
export type RevertAgentVersionOptions = MutationOptions<Agent, RevertAgentVersionVariables>;
|
||||
|
||||
export type DeleteConversationOptions = MutationOptions<
|
||||
types.TDeleteConversationResponse,
|
||||
types.TDeleteConversationRequest
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ export interface IAgent extends Omit<Document, 'model'> {
|
|||
conversation_starters?: string[];
|
||||
tool_resources?: unknown;
|
||||
projectIds?: Types.ObjectId[];
|
||||
versions?: Omit<IAgent, 'versions'>[];
|
||||
}
|
||||
|
||||
const agentSchema = new Schema<IAgent>(
|
||||
|
|
@ -115,6 +116,10 @@ const agentSchema = new Schema<IAgent>(
|
|||
ref: 'Project',
|
||||
index: true,
|
||||
},
|
||||
versions: {
|
||||
type: [Schema.Types.Mixed],
|
||||
default: [],
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue