import { Tool } from "@langchain/core/tools";
/**
 * Tool for the Exa search API.
 */
export class ExaSearchResults extends Tool {
    static lc_name() {
        return "ExaSearchResults";
    }
    constructor(fields) {
        super(fields);
        Object.defineProperty(this, "description", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: "A wrapper around Exa Search. Input should be an Exa-optimized query. Output is a JSON array of the query results"
        });
        Object.defineProperty(this, "name", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: "exa_search_results_json"
        });
        Object.defineProperty(this, "client", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: void 0
        });
        Object.defineProperty(this, "searchArgs", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: void 0
        });
        this.client = fields.client;
        this.searchArgs = fields.searchArgs;
    }
    async _call(input, _runManager) {
        return JSON.stringify(await this.client.searchAndContents(input, this.searchArgs));
    }
}
export class ExaFindSimilarResults extends Tool {
    static lc_name() {
        return "ExaFindSimilarResults";
    }
    constructor(fields) {
        super(fields);
        Object.defineProperty(this, "description", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: "A wrapper around Exa Find Similar. Input should be an Exa-optimized query. Output is a JSON array of the query results"
        });
        Object.defineProperty(this, "name", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: "exa_find_similar_results_json"
        });
        Object.defineProperty(this, "client", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: void 0
        });
        Object.defineProperty(this, "searchArgs", {
            enumerable: true,
            configurable: true,
            writable: true,
            value: void 0
        });
        this.client = fields.client;
        this.searchArgs = fields.searchArgs;
    }
    async _call(url, _runManager) {
        return JSON.stringify(await this.client.findSimilarAndContents(url, this.searchArgs));
    }
}
