"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RagOverDocsTool = void 0;
const zod_1 = require("zod");
const ai_1 = require("ai");
const retrieve_1 = require("../../Embedding/retrieve");
const ragOverDocsToolInputSchema = zod_1.z.object({
    query: zod_1.z.string().describe("The question to be answered based on the documents"),
});
class RagOverDocsTool {
    constructor() {
        this.tool = (0, ai_1.tool)({
            description: "Use this to answer questions based on the provided documents. Input should be a question related to the documents.",
            inputSchema: ragOverDocsToolInputSchema,
            execute: async (parameters) => {
                const { query } = parameters;
                return await (0, retrieve_1.retrieve)({ question: query });
            }
        });
    }
}
exports.RagOverDocsTool = RagOverDocsTool;
