{"version":3,"file":"translator.cjs","names":["BasicTranslator","Operators","Comparators"],"sources":["../src/translator.ts"],"sourcesContent":["import type { VectorStoreInterface } from \"@langchain/core/vectorstores\";\nimport {\n  BasicTranslator,\n  Comparators,\n  Operators,\n} from \"@langchain/core/structured_query\";\n\n/**\n * Specialized translator class that extends the BasicTranslator. It is\n * designed to work with PineconeStore, a type of vector store in\n * LangChain. The class is initialized with a set of allowed operators and\n * comparators, which are used in the translation process to construct\n * queries and compare results.\n * @example\n * ```typescript\n * const selfQueryRetriever = SelfQueryRetriever.fromLLM({\n *   llm: new ChatOpenAI({ model: \"gpt-4o-mini\" }),\n *   vectorStore: new PineconeStore(),\n *   documentContents: \"Brief summary of a movie\",\n *   attributeInfo: [],\n *   structuredQueryTranslator: new PineconeTranslator(),\n * });\n *\n * const queryResult = await selfQueryRetriever.getRelevantDocuments(\n *   \"Which movies are directed by Greta Gerwig?\",\n * );\n * ```\n */\nexport class PineconeTranslator<\n  T extends VectorStoreInterface,\n> extends BasicTranslator<T> {\n  constructor() {\n    super({\n      allowedOperators: [Operators.and, Operators.or],\n      allowedComparators: [\n        Comparators.eq,\n        Comparators.ne,\n        Comparators.gt,\n        Comparators.gte,\n        Comparators.lt,\n        Comparators.lte,\n      ],\n    });\n  }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAa,qBAAb,cAEUA,iCAAAA,gBAAmB;CAC3B,cAAc;AACZ,QAAM;GACJ,kBAAkB,CAACC,iCAAAA,UAAU,KAAKA,iCAAAA,UAAU,GAAG;GAC/C,oBAAoB;IAClBC,iCAAAA,YAAY;IACZA,iCAAAA,YAAY;IACZA,iCAAAA,YAAY;IACZA,iCAAAA,YAAY;IACZA,iCAAAA,YAAY;IACZA,iCAAAA,YAAY;IACb;GACF,CAAC"}