mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-26 04:06:12 +01:00
working pass to backend
This commit is contained in:
parent
dc03986149
commit
7a73d2daf3
10 changed files with 302 additions and 47 deletions
|
|
@ -832,3 +832,55 @@ export const createMemory = (data: {
|
|||
}): Promise<{ created: boolean; memory: q.TUserMemory }> => {
|
||||
return request.post(endpoints.memories(), data);
|
||||
};
|
||||
|
||||
export const createTool = (toolData: {
|
||||
name: string;
|
||||
description: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
// MCP-specific fields
|
||||
url?: string;
|
||||
icon?: string;
|
||||
tools?: string[];
|
||||
trust?: boolean;
|
||||
customHeaders?: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
value: string;
|
||||
}>;
|
||||
requestTimeout?: number;
|
||||
connectionTimeout?: number;
|
||||
}): Promise<{
|
||||
id?: string;
|
||||
mcp_id?: string;
|
||||
type?: string;
|
||||
function?: {
|
||||
name: string;
|
||||
description: string;
|
||||
};
|
||||
metadata:
|
||||
| Record<string, unknown>
|
||||
| {
|
||||
name: string;
|
||||
description: string;
|
||||
url?: string;
|
||||
icon?: string;
|
||||
tools?: string[];
|
||||
trust?: boolean;
|
||||
customHeaders?: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
value: string;
|
||||
}>;
|
||||
requestTimeout?: number;
|
||||
connectionTimeout?: number;
|
||||
};
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
}> => {
|
||||
return request.post(
|
||||
endpoints.agents({
|
||||
path: 'tools/add',
|
||||
}),
|
||||
toolData,
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ export enum QueryKeys {
|
|||
banner = 'banner',
|
||||
/* Memories */
|
||||
memories = 'memories',
|
||||
mcpTools = 'mcpTools',
|
||||
}
|
||||
|
||||
export enum MutationKeys {
|
||||
|
|
|
|||
|
|
@ -342,13 +342,17 @@ export type MCPMetadata = Omit<ActionMetadata, 'auth'> & {
|
|||
description?: string;
|
||||
url?: string;
|
||||
tools?: string[];
|
||||
auth?: MCPAuth;
|
||||
icon?: string;
|
||||
trust?: boolean;
|
||||
customHeaders?: Array<{
|
||||
id: string;
|
||||
name: string;
|
||||
value: string;
|
||||
}>;
|
||||
requestTimeout?: number;
|
||||
connectionTimeout?: number;
|
||||
};
|
||||
|
||||
export type MCPAuth = ActionAuth;
|
||||
|
||||
export type AgentToolType = {
|
||||
tool_id: string;
|
||||
metadata: ToolMetadata;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue