mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 16:56:22 +02:00
21 lines
547 B
TypeScript
21 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();
|