import { PromptTemplate } from '@langchain/core/prompts'; import { IGraphNode, RunnableConfig } from '../../../graphs'; import { LLMProvider } from '../../../types'; import { DbSchemaHelperService, PermissionHelper } from '../services'; import { SchemaStore } from '../services/schema.store'; import { TableSearchService } from '../services/search/table-search.service'; import { DbQueryState } from '../state'; import { DbQueryConfig } from '../types'; export declare class GetTablesNode implements IGraphNode { private readonly llmCheap; private readonly llmSmart; private readonly config; private readonly schemaHelper; private readonly schemaStore; private readonly tableSearchService; private readonly checks?; private readonly permissionHelper?; constructor(llmCheap: LLMProvider, llmSmart: LLMProvider, config: DbQueryConfig, schemaHelper: DbSchemaHelperService, schemaStore: SchemaStore, tableSearchService: TableSearchService, checks?: string[] | undefined, permissionHelper?: PermissionHelper | undefined); prompt: PromptTemplate\nYou are an AI assistant that extracts table names that are relevant to the users query that will be used to generate an SQL query later.\n- Consider not just the user query but also the context and the table descriptions while selecting the tables.\n- Carefully consider each and every table before including or excluding it.\n- If doubtful about a table's relevance, include it anyway to give the SQL generation step more options to choose from.\n- Assume that the table would have appropriate columns for relating them to any other table even if the description does not mention it.\n- If you are not sure about the tables to select from the given schema, just return your doubt asking the user for more details or to rephrase the question in the following format -\nfailed attempt: reason for failure\n\n\n\n{tables}\n\n\n\n{query}\n\n\n{checks}\n\n{feedbacks}\n\n\nThe output should be just a comma separated list of table names with no other text, comments or formatting.\nEnsure that table names are exact and match the names in the input including schema if given.\n\npublic.employees, public.departments\n\nIn case of failure, return the failure message in the format -\nfailed attempt: \n\nfailed attempt: reason for failure\n\n">, any>; feedbackPrompt: PromptTemplate\nWe also need to consider the errors from last attempt at query generation.\n\nIn the last attempt, these were the last tables selected:\n{lastTables}\n\nBut it was rejected with the following errors:\n{feedback}\n\nUse these if they are relevant to the table selection, otherwise ignore them, they would be considered again during the SQL generation step.\n\n">, any>; execute(state: DbQueryState, config: RunnableConfig): Promise>; getFeedbacks(state: DbQueryState): Promise; private _tableListFromSchema; private _getTablesFromSchema; private _filterByPermissions; private _validateTables; }