import { PromptTemplate } from '@langchain/core/prompts'; import { LangGraphRunnableConfig } from '@langchain/langgraph'; import { IGraphNode } from '../../../graphs'; import { LLMProvider } from '../../../types'; import { DbSchemaHelperService, PermissionHelper, TableSearchService } from '../services'; import { DbQueryState } from '../state'; import { DbQueryConfig } from '../types'; export declare class SemanticValidatorNode implements IGraphNode { private readonly smartllm; private readonly cheapllm; private readonly config; private readonly tableSearchService; private readonly schemaHelper; private readonly permissionHelper?; constructor(smartllm: LLMProvider, cheapllm: LLMProvider, config: DbQueryConfig, tableSearchService: TableSearchService, schemaHelper: DbSchemaHelperService, permissionHelper?: PermissionHelper | undefined); prompt: PromptTemplate\nYou are an AI assistant that validates whether a SQL query satisfies a given checklist.\nThe query has already been validated for syntax and correctness.\nGo through each checklist item and verify it against the SQL query.\nDO NOT make up issues that do not exist in the query.\n\n\n\n{userPrompt}\n\n\n\n{query}\n\n\n\n{schema}\n\n\n\n{tableNames}\n\n\n\n{checklist}\n\n\n{feedbacks}\n\n\nIf the query satisfies ALL checklist items, return ONLY a valid tag with no other text:\n\n\n\n\nIf any checklist item is NOT satisfied, return your response in two sections:\n1. An invalid tag containing each failed item with a detailed explanation of what is wrong and how it should be fixed.\n2. A tables tag listing ALL table names from the available tables that are related to the errors. Be generous - include tables directly involved in the error, tables that need to be joined to fix the issue, and any tables that could be relevant. It is better to include extra tables than to miss any.\n\n\n\n- Salary values are not converted to USD. The query should join the exchange_rates table using currency_id and multiply salary by the rate.\n- Lost and hold deals are not excluded. Add a WHERE condition to filter out deals with status 0 and 2.\n\nexchange_rates, deals, employees\n\n\n">, any>; feedbackPrompt: PromptTemplate\nWe also need to consider the users feedback on the last attempt at query generation.\n\nBut was rejected by validator with the following errors -\n{feedback}\n\nKeep these feedbacks in mind while validating the new query.\n">, any>; execute(state: DbQueryState, config: LangGraphRunnableConfig): Promise; getFeedbacks(state: DbQueryState): Promise; private _filterByPermissions; }