SurfSense/surfsense_web/lib/apis/agent-tools-api.service.ts
DESKTOP-RTLN3BA\$punk d8a05ae4d5 feat: refactor agent tools management and add UI integration
- Added endpoint to list agent tools with metadata, excluding hidden tools.
- Updated NewChatRequest and RegenerateRequest schemas to include disabled tools.
- Integrated disabled tools management in the NewChatPage and Composer components.
- Improved tool instructions and visibility in the system prompt.
- Refactored tool registration to support hidden tools and default enabled states.
- Enhanced document chunk creation to handle strict zip behavior.
- Cleaned up imports and formatting across various files for consistency.
2026-03-10 17:36:26 -07:00

20 lines
547 B
TypeScript

import { z } from "zod";
import { baseApiService } from "./base-api.service";
const AgentToolInfoSchema = z.object({
name: z.string(),
description: z.string(),
enabled_by_default: z.boolean(),
});
export type AgentToolInfo = z.infer<typeof AgentToolInfoSchema>;
const AgentToolsListSchema = z.array(AgentToolInfoSchema);
class AgentToolsApiService {
async getTools(): Promise<AgentToolInfo[]> {
return baseApiService.get("/api/v1/agent/tools", AgentToolsListSchema);
}
}
export const agentToolsApiService = new AgentToolsApiService();