langchain 0.2.18 → 0.3.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (338) hide show
  1. package/dist/agents/openai_functions/index.cjs +2 -2
  2. package/dist/agents/openai_functions/index.js +2 -2
  3. package/dist/chains/combine_documents/stuff.cjs +2 -2
  4. package/dist/chains/combine_documents/stuff.js +2 -2
  5. package/dist/chains/openai_functions/openapi.cjs +3 -1
  6. package/dist/chains/openai_functions/openapi.js +3 -1
  7. package/dist/load/import_constants.cjs +2 -39
  8. package/dist/load/import_constants.js +2 -39
  9. package/dist/load/import_map.cjs +2 -3
  10. package/dist/load/import_map.d.ts +0 -1
  11. package/dist/load/import_map.js +0 -1
  12. package/dist/smith/config.d.ts +1 -5
  13. package/package.json +31 -854
  14. package/dist/document_loaders/fs/chatgpt.cjs +0 -90
  15. package/dist/document_loaders/fs/chatgpt.d.ts +0 -8
  16. package/dist/document_loaders/fs/chatgpt.js +0 -86
  17. package/dist/document_loaders/fs/csv.cjs +0 -73
  18. package/dist/document_loaders/fs/csv.d.ts +0 -65
  19. package/dist/document_loaders/fs/csv.js +0 -69
  20. package/dist/document_loaders/fs/docx.cjs +0 -58
  21. package/dist/document_loaders/fs/docx.d.ts +0 -25
  22. package/dist/document_loaders/fs/docx.js +0 -54
  23. package/dist/document_loaders/fs/epub.cjs +0 -103
  24. package/dist/document_loaders/fs/epub.d.ts +0 -33
  25. package/dist/document_loaders/fs/epub.js +0 -99
  26. package/dist/document_loaders/fs/notion.cjs +0 -26
  27. package/dist/document_loaders/fs/notion.d.ts +0 -12
  28. package/dist/document_loaders/fs/notion.js +0 -22
  29. package/dist/document_loaders/fs/obsidian.cjs +0 -247
  30. package/dist/document_loaders/fs/obsidian.d.ts +0 -28
  31. package/dist/document_loaders/fs/obsidian.js +0 -240
  32. package/dist/document_loaders/fs/openai_whisper_audio.cjs +0 -49
  33. package/dist/document_loaders/fs/openai_whisper_audio.d.ts +0 -23
  34. package/dist/document_loaders/fs/openai_whisper_audio.js +0 -45
  35. package/dist/document_loaders/fs/pdf.cjs +0 -148
  36. package/dist/document_loaders/fs/pdf.d.ts +0 -49
  37. package/dist/document_loaders/fs/pdf.js +0 -144
  38. package/dist/document_loaders/fs/pptx.cjs +0 -46
  39. package/dist/document_loaders/fs/pptx.d.ts +0 -25
  40. package/dist/document_loaders/fs/pptx.js +0 -42
  41. package/dist/document_loaders/fs/srt.cjs +0 -57
  42. package/dist/document_loaders/fs/srt.d.ts +0 -32
  43. package/dist/document_loaders/fs/srt.js +0 -50
  44. package/dist/document_loaders/fs/unstructured.cjs +0 -338
  45. package/dist/document_loaders/fs/unstructured.d.ts +0 -125
  46. package/dist/document_loaders/fs/unstructured.js +0 -333
  47. package/dist/document_loaders/web/apify_dataset.cjs +0 -130
  48. package/dist/document_loaders/web/apify_dataset.d.ts +0 -85
  49. package/dist/document_loaders/web/apify_dataset.js +0 -126
  50. package/dist/document_loaders/web/assemblyai.cjs +0 -200
  51. package/dist/document_loaders/web/assemblyai.d.ts +0 -95
  52. package/dist/document_loaders/web/assemblyai.js +0 -193
  53. package/dist/document_loaders/web/azure_blob_storage_container.cjs +0 -73
  54. package/dist/document_loaders/web/azure_blob_storage_container.d.ts +0 -46
  55. package/dist/document_loaders/web/azure_blob_storage_container.js +0 -69
  56. package/dist/document_loaders/web/azure_blob_storage_file.cjs +0 -124
  57. package/dist/document_loaders/web/azure_blob_storage_file.d.ts +0 -53
  58. package/dist/document_loaders/web/azure_blob_storage_file.js +0 -97
  59. package/dist/document_loaders/web/browserbase.cjs +0 -93
  60. package/dist/document_loaders/web/browserbase.d.ts +0 -48
  61. package/dist/document_loaders/web/browserbase.js +0 -86
  62. package/dist/document_loaders/web/cheerio.cjs +0 -118
  63. package/dist/document_loaders/web/cheerio.d.ts +0 -77
  64. package/dist/document_loaders/web/cheerio.js +0 -114
  65. package/dist/document_loaders/web/college_confidential.cjs +0 -41
  66. package/dist/document_loaders/web/college_confidential.d.ts +0 -25
  67. package/dist/document_loaders/web/college_confidential.js +0 -37
  68. package/dist/document_loaders/web/confluence.cjs +0 -190
  69. package/dist/document_loaders/web/confluence.d.ts +0 -114
  70. package/dist/document_loaders/web/confluence.js +0 -186
  71. package/dist/document_loaders/web/couchbase.cjs +0 -95
  72. package/dist/document_loaders/web/couchbase.d.ts +0 -32
  73. package/dist/document_loaders/web/couchbase.js +0 -91
  74. package/dist/document_loaders/web/figma.cjs +0 -102
  75. package/dist/document_loaders/web/figma.d.ts +0 -82
  76. package/dist/document_loaders/web/figma.js +0 -98
  77. package/dist/document_loaders/web/firecrawl.cjs +0 -95
  78. package/dist/document_loaders/web/firecrawl.d.ts +0 -50
  79. package/dist/document_loaders/web/firecrawl.js +0 -88
  80. package/dist/document_loaders/web/gitbook.cjs +0 -110
  81. package/dist/document_loaders/web/gitbook.d.ts +0 -55
  82. package/dist/document_loaders/web/gitbook.js +0 -106
  83. package/dist/document_loaders/web/github.cjs +0 -615
  84. package/dist/document_loaders/web/github.d.ts +0 -203
  85. package/dist/document_loaders/web/github.js +0 -608
  86. package/dist/document_loaders/web/hn.cjs +0 -90
  87. package/dist/document_loaders/web/hn.d.ts +0 -42
  88. package/dist/document_loaders/web/hn.js +0 -86
  89. package/dist/document_loaders/web/imsdb.cjs +0 -44
  90. package/dist/document_loaders/web/imsdb.d.ts +0 -23
  91. package/dist/document_loaders/web/imsdb.js +0 -40
  92. package/dist/document_loaders/web/notionapi.cjs +0 -404
  93. package/dist/document_loaders/web/notionapi.d.ts +0 -133
  94. package/dist/document_loaders/web/notionapi.js +0 -392
  95. package/dist/document_loaders/web/notiondb.cjs +0 -199
  96. package/dist/document_loaders/web/notiondb.d.ts +0 -56
  97. package/dist/document_loaders/web/notiondb.js +0 -195
  98. package/dist/document_loaders/web/pdf.cjs +0 -140
  99. package/dist/document_loaders/web/pdf.d.ts +0 -35
  100. package/dist/document_loaders/web/pdf.js +0 -136
  101. package/dist/document_loaders/web/playwright.cjs +0 -89
  102. package/dist/document_loaders/web/playwright.d.ts +0 -58
  103. package/dist/document_loaders/web/playwright.js +0 -85
  104. package/dist/document_loaders/web/puppeteer.cjs +0 -139
  105. package/dist/document_loaders/web/puppeteer.d.ts +0 -82
  106. package/dist/document_loaders/web/puppeteer.js +0 -135
  107. package/dist/document_loaders/web/recursive_url.cjs +0 -198
  108. package/dist/document_loaders/web/recursive_url.d.ts +0 -33
  109. package/dist/document_loaders/web/recursive_url.js +0 -194
  110. package/dist/document_loaders/web/s3.cjs +0 -164
  111. package/dist/document_loaders/web/s3.d.ts +0 -78
  112. package/dist/document_loaders/web/s3.js +0 -137
  113. package/dist/document_loaders/web/searchapi.cjs +0 -150
  114. package/dist/document_loaders/web/searchapi.d.ts +0 -76
  115. package/dist/document_loaders/web/searchapi.js +0 -146
  116. package/dist/document_loaders/web/serpapi.cjs +0 -127
  117. package/dist/document_loaders/web/serpapi.d.ts +0 -62
  118. package/dist/document_loaders/web/serpapi.js +0 -123
  119. package/dist/document_loaders/web/sitemap.cjs +0 -118
  120. package/dist/document_loaders/web/sitemap.d.ts +0 -41
  121. package/dist/document_loaders/web/sitemap.js +0 -114
  122. package/dist/document_loaders/web/sonix_audio.cjs +0 -68
  123. package/dist/document_loaders/web/sonix_audio.d.ts +0 -36
  124. package/dist/document_loaders/web/sonix_audio.js +0 -64
  125. package/dist/document_loaders/web/sort_xyz_blockchain.cjs +0 -157
  126. package/dist/document_loaders/web/sort_xyz_blockchain.d.ts +0 -78
  127. package/dist/document_loaders/web/sort_xyz_blockchain.js +0 -153
  128. package/dist/document_loaders/web/youtube.cjs +0 -116
  129. package/dist/document_loaders/web/youtube.d.ts +0 -55
  130. package/dist/document_loaders/web/youtube.js +0 -112
  131. package/dist/experimental/tools/pyinterpreter.cjs +0 -248
  132. package/dist/experimental/tools/pyinterpreter.d.ts +0 -18
  133. package/dist/experimental/tools/pyinterpreter.js +0 -244
  134. package/dist/retrievers/self_query/chroma.cjs +0 -48
  135. package/dist/retrievers/self_query/chroma.d.ts +0 -26
  136. package/dist/retrievers/self_query/chroma.js +0 -44
  137. package/dist/retrievers/self_query/pinecone.cjs +0 -47
  138. package/dist/retrievers/self_query/pinecone.d.ts +0 -26
  139. package/dist/retrievers/self_query/pinecone.js +0 -43
  140. package/dist/retrievers/self_query/supabase.cjs +0 -278
  141. package/dist/retrievers/self_query/supabase.d.ts +0 -109
  142. package/dist/retrievers/self_query/supabase.js +0 -274
  143. package/dist/retrievers/self_query/supabase_utils.cjs +0 -264
  144. package/dist/retrievers/self_query/supabase_utils.d.ts +0 -101
  145. package/dist/retrievers/self_query/supabase_utils.js +0 -259
  146. package/dist/retrievers/self_query/vectara.cjs +0 -143
  147. package/dist/retrievers/self_query/vectara.d.ts +0 -42
  148. package/dist/retrievers/self_query/vectara.js +0 -139
  149. package/dist/retrievers/self_query/weaviate.cjs +0 -201
  150. package/dist/retrievers/self_query/weaviate.d.ts +0 -99
  151. package/dist/retrievers/self_query/weaviate.js +0 -197
  152. package/dist/types/assemblyai-types.cjs +0 -2
  153. package/dist/types/assemblyai-types.d.ts +0 -4
  154. package/dist/types/assemblyai-types.js +0 -1
  155. package/document_loaders/fs/chatgpt.cjs +0 -1
  156. package/document_loaders/fs/chatgpt.d.cts +0 -1
  157. package/document_loaders/fs/chatgpt.d.ts +0 -1
  158. package/document_loaders/fs/chatgpt.js +0 -1
  159. package/document_loaders/fs/csv.cjs +0 -1
  160. package/document_loaders/fs/csv.d.cts +0 -1
  161. package/document_loaders/fs/csv.d.ts +0 -1
  162. package/document_loaders/fs/csv.js +0 -1
  163. package/document_loaders/fs/docx.cjs +0 -1
  164. package/document_loaders/fs/docx.d.cts +0 -1
  165. package/document_loaders/fs/docx.d.ts +0 -1
  166. package/document_loaders/fs/docx.js +0 -1
  167. package/document_loaders/fs/epub.cjs +0 -1
  168. package/document_loaders/fs/epub.d.cts +0 -1
  169. package/document_loaders/fs/epub.d.ts +0 -1
  170. package/document_loaders/fs/epub.js +0 -1
  171. package/document_loaders/fs/notion.cjs +0 -1
  172. package/document_loaders/fs/notion.d.cts +0 -1
  173. package/document_loaders/fs/notion.d.ts +0 -1
  174. package/document_loaders/fs/notion.js +0 -1
  175. package/document_loaders/fs/obsidian.cjs +0 -1
  176. package/document_loaders/fs/obsidian.d.cts +0 -1
  177. package/document_loaders/fs/obsidian.d.ts +0 -1
  178. package/document_loaders/fs/obsidian.js +0 -1
  179. package/document_loaders/fs/openai_whisper_audio.cjs +0 -1
  180. package/document_loaders/fs/openai_whisper_audio.d.cts +0 -1
  181. package/document_loaders/fs/openai_whisper_audio.d.ts +0 -1
  182. package/document_loaders/fs/openai_whisper_audio.js +0 -1
  183. package/document_loaders/fs/pdf.cjs +0 -1
  184. package/document_loaders/fs/pdf.d.cts +0 -1
  185. package/document_loaders/fs/pdf.d.ts +0 -1
  186. package/document_loaders/fs/pdf.js +0 -1
  187. package/document_loaders/fs/pptx.cjs +0 -1
  188. package/document_loaders/fs/pptx.d.cts +0 -1
  189. package/document_loaders/fs/pptx.d.ts +0 -1
  190. package/document_loaders/fs/pptx.js +0 -1
  191. package/document_loaders/fs/srt.cjs +0 -1
  192. package/document_loaders/fs/srt.d.cts +0 -1
  193. package/document_loaders/fs/srt.d.ts +0 -1
  194. package/document_loaders/fs/srt.js +0 -1
  195. package/document_loaders/fs/unstructured.cjs +0 -1
  196. package/document_loaders/fs/unstructured.d.cts +0 -1
  197. package/document_loaders/fs/unstructured.d.ts +0 -1
  198. package/document_loaders/fs/unstructured.js +0 -1
  199. package/document_loaders/web/apify_dataset.cjs +0 -1
  200. package/document_loaders/web/apify_dataset.d.cts +0 -1
  201. package/document_loaders/web/apify_dataset.d.ts +0 -1
  202. package/document_loaders/web/apify_dataset.js +0 -1
  203. package/document_loaders/web/assemblyai.cjs +0 -1
  204. package/document_loaders/web/assemblyai.d.cts +0 -1
  205. package/document_loaders/web/assemblyai.d.ts +0 -1
  206. package/document_loaders/web/assemblyai.js +0 -1
  207. package/document_loaders/web/azure_blob_storage_container.cjs +0 -1
  208. package/document_loaders/web/azure_blob_storage_container.d.cts +0 -1
  209. package/document_loaders/web/azure_blob_storage_container.d.ts +0 -1
  210. package/document_loaders/web/azure_blob_storage_container.js +0 -1
  211. package/document_loaders/web/azure_blob_storage_file.cjs +0 -1
  212. package/document_loaders/web/azure_blob_storage_file.d.cts +0 -1
  213. package/document_loaders/web/azure_blob_storage_file.d.ts +0 -1
  214. package/document_loaders/web/azure_blob_storage_file.js +0 -1
  215. package/document_loaders/web/browserbase.cjs +0 -1
  216. package/document_loaders/web/browserbase.d.cts +0 -1
  217. package/document_loaders/web/browserbase.d.ts +0 -1
  218. package/document_loaders/web/browserbase.js +0 -1
  219. package/document_loaders/web/cheerio.cjs +0 -1
  220. package/document_loaders/web/cheerio.d.cts +0 -1
  221. package/document_loaders/web/cheerio.d.ts +0 -1
  222. package/document_loaders/web/cheerio.js +0 -1
  223. package/document_loaders/web/college_confidential.cjs +0 -1
  224. package/document_loaders/web/college_confidential.d.cts +0 -1
  225. package/document_loaders/web/college_confidential.d.ts +0 -1
  226. package/document_loaders/web/college_confidential.js +0 -1
  227. package/document_loaders/web/confluence.cjs +0 -1
  228. package/document_loaders/web/confluence.d.cts +0 -1
  229. package/document_loaders/web/confluence.d.ts +0 -1
  230. package/document_loaders/web/confluence.js +0 -1
  231. package/document_loaders/web/couchbase.cjs +0 -1
  232. package/document_loaders/web/couchbase.d.cts +0 -1
  233. package/document_loaders/web/couchbase.d.ts +0 -1
  234. package/document_loaders/web/couchbase.js +0 -1
  235. package/document_loaders/web/figma.cjs +0 -1
  236. package/document_loaders/web/figma.d.cts +0 -1
  237. package/document_loaders/web/figma.d.ts +0 -1
  238. package/document_loaders/web/figma.js +0 -1
  239. package/document_loaders/web/firecrawl.cjs +0 -1
  240. package/document_loaders/web/firecrawl.d.cts +0 -1
  241. package/document_loaders/web/firecrawl.d.ts +0 -1
  242. package/document_loaders/web/firecrawl.js +0 -1
  243. package/document_loaders/web/gitbook.cjs +0 -1
  244. package/document_loaders/web/gitbook.d.cts +0 -1
  245. package/document_loaders/web/gitbook.d.ts +0 -1
  246. package/document_loaders/web/gitbook.js +0 -1
  247. package/document_loaders/web/github.cjs +0 -1
  248. package/document_loaders/web/github.d.cts +0 -1
  249. package/document_loaders/web/github.d.ts +0 -1
  250. package/document_loaders/web/github.js +0 -1
  251. package/document_loaders/web/hn.cjs +0 -1
  252. package/document_loaders/web/hn.d.cts +0 -1
  253. package/document_loaders/web/hn.d.ts +0 -1
  254. package/document_loaders/web/hn.js +0 -1
  255. package/document_loaders/web/imsdb.cjs +0 -1
  256. package/document_loaders/web/imsdb.d.cts +0 -1
  257. package/document_loaders/web/imsdb.d.ts +0 -1
  258. package/document_loaders/web/imsdb.js +0 -1
  259. package/document_loaders/web/notionapi.cjs +0 -1
  260. package/document_loaders/web/notionapi.d.cts +0 -1
  261. package/document_loaders/web/notionapi.d.ts +0 -1
  262. package/document_loaders/web/notionapi.js +0 -1
  263. package/document_loaders/web/notiondb.cjs +0 -1
  264. package/document_loaders/web/notiondb.d.cts +0 -1
  265. package/document_loaders/web/notiondb.d.ts +0 -1
  266. package/document_loaders/web/notiondb.js +0 -1
  267. package/document_loaders/web/pdf.cjs +0 -1
  268. package/document_loaders/web/pdf.d.cts +0 -1
  269. package/document_loaders/web/pdf.d.ts +0 -1
  270. package/document_loaders/web/pdf.js +0 -1
  271. package/document_loaders/web/playwright.cjs +0 -1
  272. package/document_loaders/web/playwright.d.cts +0 -1
  273. package/document_loaders/web/playwright.d.ts +0 -1
  274. package/document_loaders/web/playwright.js +0 -1
  275. package/document_loaders/web/puppeteer.cjs +0 -1
  276. package/document_loaders/web/puppeteer.d.cts +0 -1
  277. package/document_loaders/web/puppeteer.d.ts +0 -1
  278. package/document_loaders/web/puppeteer.js +0 -1
  279. package/document_loaders/web/recursive_url.cjs +0 -1
  280. package/document_loaders/web/recursive_url.d.cts +0 -1
  281. package/document_loaders/web/recursive_url.d.ts +0 -1
  282. package/document_loaders/web/recursive_url.js +0 -1
  283. package/document_loaders/web/s3.cjs +0 -1
  284. package/document_loaders/web/s3.d.cts +0 -1
  285. package/document_loaders/web/s3.d.ts +0 -1
  286. package/document_loaders/web/s3.js +0 -1
  287. package/document_loaders/web/searchapi.cjs +0 -1
  288. package/document_loaders/web/searchapi.d.cts +0 -1
  289. package/document_loaders/web/searchapi.d.ts +0 -1
  290. package/document_loaders/web/searchapi.js +0 -1
  291. package/document_loaders/web/serpapi.cjs +0 -1
  292. package/document_loaders/web/serpapi.d.cts +0 -1
  293. package/document_loaders/web/serpapi.d.ts +0 -1
  294. package/document_loaders/web/serpapi.js +0 -1
  295. package/document_loaders/web/sitemap.cjs +0 -1
  296. package/document_loaders/web/sitemap.d.cts +0 -1
  297. package/document_loaders/web/sitemap.d.ts +0 -1
  298. package/document_loaders/web/sitemap.js +0 -1
  299. package/document_loaders/web/sonix_audio.cjs +0 -1
  300. package/document_loaders/web/sonix_audio.d.cts +0 -1
  301. package/document_loaders/web/sonix_audio.d.ts +0 -1
  302. package/document_loaders/web/sonix_audio.js +0 -1
  303. package/document_loaders/web/sort_xyz_blockchain.cjs +0 -1
  304. package/document_loaders/web/sort_xyz_blockchain.d.cts +0 -1
  305. package/document_loaders/web/sort_xyz_blockchain.d.ts +0 -1
  306. package/document_loaders/web/sort_xyz_blockchain.js +0 -1
  307. package/document_loaders/web/youtube.cjs +0 -1
  308. package/document_loaders/web/youtube.d.cts +0 -1
  309. package/document_loaders/web/youtube.d.ts +0 -1
  310. package/document_loaders/web/youtube.js +0 -1
  311. package/experimental/tools/pyinterpreter.cjs +0 -1
  312. package/experimental/tools/pyinterpreter.d.cts +0 -1
  313. package/experimental/tools/pyinterpreter.d.ts +0 -1
  314. package/experimental/tools/pyinterpreter.js +0 -1
  315. package/memory/index.cjs +0 -1
  316. package/memory/index.d.cts +0 -1
  317. package/memory/index.d.ts +0 -1
  318. package/memory/index.js +0 -1
  319. package/retrievers/self_query/chroma.cjs +0 -1
  320. package/retrievers/self_query/chroma.d.cts +0 -1
  321. package/retrievers/self_query/chroma.d.ts +0 -1
  322. package/retrievers/self_query/chroma.js +0 -1
  323. package/retrievers/self_query/pinecone.cjs +0 -1
  324. package/retrievers/self_query/pinecone.d.cts +0 -1
  325. package/retrievers/self_query/pinecone.d.ts +0 -1
  326. package/retrievers/self_query/pinecone.js +0 -1
  327. package/retrievers/self_query/supabase.cjs +0 -1
  328. package/retrievers/self_query/supabase.d.cts +0 -1
  329. package/retrievers/self_query/supabase.d.ts +0 -1
  330. package/retrievers/self_query/supabase.js +0 -1
  331. package/retrievers/self_query/vectara.cjs +0 -1
  332. package/retrievers/self_query/vectara.d.cts +0 -1
  333. package/retrievers/self_query/vectara.d.ts +0 -1
  334. package/retrievers/self_query/vectara.js +0 -1
  335. package/retrievers/self_query/weaviate.cjs +0 -1
  336. package/retrievers/self_query/weaviate.d.cts +0 -1
  337. package/retrievers/self_query/weaviate.d.ts +0 -1
  338. package/retrievers/self_query/weaviate.js +0 -1
@@ -1,278 +0,0 @@
1
- "use strict";
2
- /* eslint-disable @typescript-eslint/no-explicit-any */
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.SupabaseTranslator = void 0;
5
- const structured_query_1 = require("@langchain/core/structured_query");
6
- const supabase_utils_js_1 = require("./supabase_utils.cjs");
7
- const entrypoint_deprecation_js_1 = require("../../util/entrypoint_deprecation.cjs");
8
- /* #__PURE__ */ (0, entrypoint_deprecation_js_1.logVersion020MigrationWarning)({
9
- oldEntrypointName: "retrievers/self_query/supabase",
10
- newEntrypointName: "structured_query/supabase",
11
- newPackageName: "@langchain/community",
12
- });
13
- /**
14
- * A specialized translator designed to work with Supabase, extending the
15
- * BaseTranslator class. It translates structured queries into a format
16
- * that can be understood by the Supabase database.
17
- * @example
18
- * ```typescript
19
- * const selfQueryRetriever = new SelfQueryRetriever({
20
- * llm: new ChatOpenAI(),
21
- * vectorStore: new SupabaseVectorStore(),
22
- * documentContents: "Brief summary of a movie",
23
- * attributeInfo: [],
24
- * structuredQueryTranslator: new SupabaseTranslator(),
25
- * });
26
- *
27
- * const queryResult = await selfQueryRetriever.getRelevantDocuments(
28
- * "Which movies are directed by Greta Gerwig?",
29
- * );
30
- * ```
31
- */
32
- class SupabaseTranslator extends structured_query_1.BaseTranslator {
33
- constructor() {
34
- super(...arguments);
35
- Object.defineProperty(this, "allowedOperators", {
36
- enumerable: true,
37
- configurable: true,
38
- writable: true,
39
- value: [structured_query_1.Operators.and, structured_query_1.Operators.or]
40
- });
41
- Object.defineProperty(this, "allowedComparators", {
42
- enumerable: true,
43
- configurable: true,
44
- writable: true,
45
- value: [
46
- structured_query_1.Comparators.eq,
47
- structured_query_1.Comparators.ne,
48
- structured_query_1.Comparators.gt,
49
- structured_query_1.Comparators.gte,
50
- structured_query_1.Comparators.lt,
51
- structured_query_1.Comparators.lte,
52
- ]
53
- });
54
- }
55
- formatFunction() {
56
- throw new Error("Not implemented");
57
- }
58
- /**
59
- * Returns a function that applies the appropriate comparator operation on
60
- * the attribute and value provided. The function returned is used to
61
- * filter data in a Supabase database.
62
- * @param comparator The comparator to be used in the operation.
63
- * @returns A function that applies the comparator operation on the attribute and value provided.
64
- */
65
- getComparatorFunction(comparator) {
66
- switch (comparator) {
67
- case structured_query_1.Comparators.eq: {
68
- return (attr, value) => (rpc) => rpc.eq(this.buildColumnName(attr, value), value);
69
- }
70
- case structured_query_1.Comparators.ne: {
71
- return (attr, value) => (rpc) => rpc.neq(this.buildColumnName(attr, value), value);
72
- }
73
- case structured_query_1.Comparators.gt: {
74
- return (attr, value) => (rpc) => rpc.gt(this.buildColumnName(attr, value), value);
75
- }
76
- case structured_query_1.Comparators.gte: {
77
- return (attr, value) => (rpc) => rpc.gte(this.buildColumnName(attr, value), value);
78
- }
79
- case structured_query_1.Comparators.lt: {
80
- return (attr, value) => (rpc) => rpc.lt(this.buildColumnName(attr, value), value);
81
- }
82
- case structured_query_1.Comparators.lte: {
83
- return (attr, value) => (rpc) => rpc.lte(this.buildColumnName(attr, value), value);
84
- }
85
- default: {
86
- throw new Error("Unknown comparator");
87
- }
88
- }
89
- }
90
- /**
91
- * Builds a column name based on the attribute and value provided. The
92
- * column name is used in filtering data in a Supabase database.
93
- * @param attr The attribute to be used in the column name.
94
- * @param value The value to be used in the column name.
95
- * @param includeType Whether to include the data type in the column name.
96
- * @returns The built column name.
97
- */
98
- buildColumnName(attr, value, includeType = true) {
99
- let column = "";
100
- if ((0, structured_query_1.isString)(value)) {
101
- column = `metadata->>${attr}`;
102
- }
103
- else if ((0, structured_query_1.isInt)(value)) {
104
- column = `metadata->${attr}${includeType ? "::int" : ""}`;
105
- }
106
- else if ((0, structured_query_1.isFloat)(value)) {
107
- column = `metadata->${attr}${includeType ? "::float" : ""}`;
108
- }
109
- else {
110
- throw new Error("Data type not supported");
111
- }
112
- return column;
113
- }
114
- /**
115
- * Visits an operation and returns a string representation of it. This is
116
- * used in translating a structured query into a format that can be
117
- * understood by Supabase.
118
- * @param operation The operation to be visited.
119
- * @returns A string representation of the operation.
120
- */
121
- visitOperationAsString(operation) {
122
- const { args } = operation;
123
- if (!args) {
124
- return "";
125
- }
126
- return args
127
- ?.reduce((acc, arg) => {
128
- if (arg.exprName === "Comparison") {
129
- acc.push(this.visitComparisonAsString(arg));
130
- }
131
- else if (arg.exprName === "Operation") {
132
- const { operator: innerOperator } = arg;
133
- acc.push(`${innerOperator}(${this.visitOperationAsString(arg)})`);
134
- }
135
- return acc;
136
- }, [])
137
- .join(",");
138
- }
139
- /**
140
- * Visits an operation and returns a function that applies the operation
141
- * on a Supabase database. This is used in translating a structured query
142
- * into a format that can be understood by Supabase.
143
- * @param operation The operation to be visited.
144
- * @returns A function that applies the operation on a Supabase database.
145
- */
146
- visitOperation(operation) {
147
- const { operator, args } = operation;
148
- if (this.allowedOperators.includes(operator)) {
149
- if (operator === structured_query_1.Operators.and) {
150
- if (!args) {
151
- return (rpc) => rpc;
152
- }
153
- const filter = (rpc) => args.reduce((acc, arg) => {
154
- const filter = arg.accept(this);
155
- return filter(acc);
156
- }, rpc);
157
- return filter;
158
- }
159
- else if (operator === structured_query_1.Operators.or) {
160
- return (rpc) => rpc.or(this.visitOperationAsString(operation));
161
- }
162
- else {
163
- throw new Error("Unknown operator");
164
- }
165
- }
166
- else {
167
- throw new Error("Operator not allowed");
168
- }
169
- }
170
- /**
171
- * Visits a comparison and returns a string representation of it. This is
172
- * used in translating a structured query into a format that can be
173
- * understood by Supabase.
174
- * @param comparison The comparison to be visited.
175
- * @returns A string representation of the comparison.
176
- */
177
- visitComparisonAsString(comparison) {
178
- let { value } = comparison;
179
- const { comparator: _comparator, attribute } = comparison;
180
- let comparator = _comparator;
181
- if (comparator === structured_query_1.Comparators.ne) {
182
- comparator = "neq";
183
- }
184
- if (Array.isArray(value)) {
185
- value = `(${value
186
- .map((v) => {
187
- if (typeof v === "string" && /[,()]/.test(v))
188
- return `"${v}"`;
189
- return v;
190
- })
191
- .join(",")})`;
192
- }
193
- return `${this.buildColumnName(attribute, value, false)}.${comparator}.${value}}`;
194
- }
195
- /**
196
- * Visits a comparison and returns a function that applies the comparison
197
- * on a Supabase database. This is used in translating a structured query
198
- * into a format that can be understood by Supabase.
199
- * @param comparison The comparison to be visited.
200
- * @returns A function that applies the comparison on a Supabase database.
201
- */
202
- visitComparison(comparison) {
203
- const { comparator, attribute, value } = comparison;
204
- if (this.allowedComparators.includes(comparator)) {
205
- const comparatorFunction = this.getComparatorFunction(comparator);
206
- return comparatorFunction(attribute, value);
207
- }
208
- else {
209
- throw new Error("Comparator not allowed");
210
- }
211
- }
212
- /**
213
- * Visits a structured query and returns a function that applies the query
214
- * on a Supabase database. This is used in translating a structured query
215
- * into a format that can be understood by Supabase.
216
- * @param query The structured query to be visited.
217
- * @returns A function that applies the query on a Supabase database.
218
- */
219
- visitStructuredQuery(query) {
220
- if (!query.filter) {
221
- return {};
222
- }
223
- const filterFunction = query.filter?.accept(this);
224
- return { filter: filterFunction ?? {} };
225
- }
226
- /**
227
- * Merges two filters into one. The merged filter can be used to filter
228
- * data in a Supabase database.
229
- * @param defaultFilter The default filter to be merged.
230
- * @param generatedFilter The generated filter to be merged.
231
- * @param mergeType The type of merge to be performed. It can be 'and', 'or', or 'replace'.
232
- * @returns The merged filter.
233
- */
234
- mergeFilters(defaultFilter, generatedFilter, mergeType = "and") {
235
- if ((0, structured_query_1.isFilterEmpty)(defaultFilter) && (0, structured_query_1.isFilterEmpty)(generatedFilter)) {
236
- return undefined;
237
- }
238
- if ((0, structured_query_1.isFilterEmpty)(defaultFilter) || mergeType === "replace") {
239
- if ((0, structured_query_1.isFilterEmpty)(generatedFilter)) {
240
- return undefined;
241
- }
242
- return generatedFilter;
243
- }
244
- if ((0, structured_query_1.isFilterEmpty)(generatedFilter)) {
245
- if (mergeType === "and") {
246
- return undefined;
247
- }
248
- return defaultFilter;
249
- }
250
- let myDefaultFilter = defaultFilter;
251
- if ((0, structured_query_1.isObject)(defaultFilter)) {
252
- const { filter } = this.visitStructuredQuery((0, supabase_utils_js_1.convertObjectFilterToStructuredQuery)(defaultFilter));
253
- // just in case the built filter is empty somehow
254
- if ((0, structured_query_1.isFilterEmpty)(filter)) {
255
- if ((0, structured_query_1.isFilterEmpty)(generatedFilter)) {
256
- return undefined;
257
- }
258
- return generatedFilter;
259
- }
260
- myDefaultFilter = filter;
261
- }
262
- // After this point, myDefaultFilter will always be SupabaseFilterRPCCall
263
- if (mergeType === "or") {
264
- return (rpc) => {
265
- const defaultFlattenedParams = supabase_utils_js_1.ProxyParamsDuplicator.getFlattenedParams(rpc, myDefaultFilter);
266
- const generatedFlattenedParams = supabase_utils_js_1.ProxyParamsDuplicator.getFlattenedParams(rpc, generatedFilter);
267
- return rpc.or(`${defaultFlattenedParams},${generatedFlattenedParams}`);
268
- };
269
- }
270
- else if (mergeType === "and") {
271
- return (rpc) => generatedFilter(myDefaultFilter(rpc));
272
- }
273
- else {
274
- throw new Error("Unknown merge type");
275
- }
276
- }
277
- }
278
- exports.SupabaseTranslator = SupabaseTranslator;
@@ -1,109 +0,0 @@
1
- import { BaseTranslator, Comparator, Comparison, Operation, Operator, StructuredQuery } from "@langchain/core/structured_query";
2
- import { VectorStore } from "@langchain/core/vectorstores";
3
- /**
4
- * Represents the possible values that can be used in a comparison in a
5
- * structured query. It can be a string or a number.
6
- */
7
- type ValueType = {
8
- eq: string | number;
9
- ne: string | number;
10
- lt: string | number;
11
- lte: string | number;
12
- gt: string | number;
13
- gte: string | number;
14
- };
15
- type SupabaseFilterRPCCall = any;
16
- type SupabaseMetadata = any;
17
- /**
18
- * A specialized translator designed to work with Supabase, extending the
19
- * BaseTranslator class. It translates structured queries into a format
20
- * that can be understood by the Supabase database.
21
- * @example
22
- * ```typescript
23
- * const selfQueryRetriever = new SelfQueryRetriever({
24
- * llm: new ChatOpenAI(),
25
- * vectorStore: new SupabaseVectorStore(),
26
- * documentContents: "Brief summary of a movie",
27
- * attributeInfo: [],
28
- * structuredQueryTranslator: new SupabaseTranslator(),
29
- * });
30
- *
31
- * const queryResult = await selfQueryRetriever.getRelevantDocuments(
32
- * "Which movies are directed by Greta Gerwig?",
33
- * );
34
- * ```
35
- */
36
- export declare class SupabaseTranslator<T extends VectorStore> extends BaseTranslator<T> {
37
- VisitOperationOutput: SupabaseFilterRPCCall;
38
- VisitComparisonOutput: SupabaseFilterRPCCall;
39
- allowedOperators: Operator[];
40
- allowedComparators: Comparator[];
41
- formatFunction(): string;
42
- /**
43
- * Returns a function that applies the appropriate comparator operation on
44
- * the attribute and value provided. The function returned is used to
45
- * filter data in a Supabase database.
46
- * @param comparator The comparator to be used in the operation.
47
- * @returns A function that applies the comparator operation on the attribute and value provided.
48
- */
49
- getComparatorFunction<C extends Comparator>(comparator: Comparator): (attr: string, value: ValueType[C]) => SupabaseFilterRPCCall;
50
- /**
51
- * Builds a column name based on the attribute and value provided. The
52
- * column name is used in filtering data in a Supabase database.
53
- * @param attr The attribute to be used in the column name.
54
- * @param value The value to be used in the column name.
55
- * @param includeType Whether to include the data type in the column name.
56
- * @returns The built column name.
57
- */
58
- buildColumnName(attr: string, value: string | number, includeType?: boolean): string;
59
- /**
60
- * Visits an operation and returns a string representation of it. This is
61
- * used in translating a structured query into a format that can be
62
- * understood by Supabase.
63
- * @param operation The operation to be visited.
64
- * @returns A string representation of the operation.
65
- */
66
- visitOperationAsString(operation: Operation): string;
67
- /**
68
- * Visits an operation and returns a function that applies the operation
69
- * on a Supabase database. This is used in translating a structured query
70
- * into a format that can be understood by Supabase.
71
- * @param operation The operation to be visited.
72
- * @returns A function that applies the operation on a Supabase database.
73
- */
74
- visitOperation(operation: Operation): this["VisitOperationOutput"];
75
- /**
76
- * Visits a comparison and returns a string representation of it. This is
77
- * used in translating a structured query into a format that can be
78
- * understood by Supabase.
79
- * @param comparison The comparison to be visited.
80
- * @returns A string representation of the comparison.
81
- */
82
- visitComparisonAsString(comparison: Comparison): string;
83
- /**
84
- * Visits a comparison and returns a function that applies the comparison
85
- * on a Supabase database. This is used in translating a structured query
86
- * into a format that can be understood by Supabase.
87
- * @param comparison The comparison to be visited.
88
- * @returns A function that applies the comparison on a Supabase database.
89
- */
90
- visitComparison(comparison: Comparison): this["VisitComparisonOutput"];
91
- /**
92
- * Visits a structured query and returns a function that applies the query
93
- * on a Supabase database. This is used in translating a structured query
94
- * into a format that can be understood by Supabase.
95
- * @param query The structured query to be visited.
96
- * @returns A function that applies the query on a Supabase database.
97
- */
98
- visitStructuredQuery(query: StructuredQuery): this["VisitStructuredQueryOutput"];
99
- /**
100
- * Merges two filters into one. The merged filter can be used to filter
101
- * data in a Supabase database.
102
- * @param defaultFilter The default filter to be merged.
103
- * @param generatedFilter The generated filter to be merged.
104
- * @param mergeType The type of merge to be performed. It can be 'and', 'or', or 'replace'.
105
- * @returns The merged filter.
106
- */
107
- mergeFilters(defaultFilter: SupabaseFilterRPCCall | SupabaseMetadata | undefined, generatedFilter: SupabaseFilterRPCCall | undefined, mergeType?: string): SupabaseFilterRPCCall | SupabaseMetadata | undefined;
108
- }
109
- export {};
@@ -1,274 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
- import { isFilterEmpty, isFloat, isInt, isObject, isString, BaseTranslator, Comparators, Operators, } from "@langchain/core/structured_query";
3
- import { ProxyParamsDuplicator, convertObjectFilterToStructuredQuery, } from "./supabase_utils.js";
4
- import { logVersion020MigrationWarning } from "../../util/entrypoint_deprecation.js";
5
- /* #__PURE__ */ logVersion020MigrationWarning({
6
- oldEntrypointName: "retrievers/self_query/supabase",
7
- newEntrypointName: "structured_query/supabase",
8
- newPackageName: "@langchain/community",
9
- });
10
- /**
11
- * A specialized translator designed to work with Supabase, extending the
12
- * BaseTranslator class. It translates structured queries into a format
13
- * that can be understood by the Supabase database.
14
- * @example
15
- * ```typescript
16
- * const selfQueryRetriever = new SelfQueryRetriever({
17
- * llm: new ChatOpenAI(),
18
- * vectorStore: new SupabaseVectorStore(),
19
- * documentContents: "Brief summary of a movie",
20
- * attributeInfo: [],
21
- * structuredQueryTranslator: new SupabaseTranslator(),
22
- * });
23
- *
24
- * const queryResult = await selfQueryRetriever.getRelevantDocuments(
25
- * "Which movies are directed by Greta Gerwig?",
26
- * );
27
- * ```
28
- */
29
- export class SupabaseTranslator extends BaseTranslator {
30
- constructor() {
31
- super(...arguments);
32
- Object.defineProperty(this, "allowedOperators", {
33
- enumerable: true,
34
- configurable: true,
35
- writable: true,
36
- value: [Operators.and, Operators.or]
37
- });
38
- Object.defineProperty(this, "allowedComparators", {
39
- enumerable: true,
40
- configurable: true,
41
- writable: true,
42
- value: [
43
- Comparators.eq,
44
- Comparators.ne,
45
- Comparators.gt,
46
- Comparators.gte,
47
- Comparators.lt,
48
- Comparators.lte,
49
- ]
50
- });
51
- }
52
- formatFunction() {
53
- throw new Error("Not implemented");
54
- }
55
- /**
56
- * Returns a function that applies the appropriate comparator operation on
57
- * the attribute and value provided. The function returned is used to
58
- * filter data in a Supabase database.
59
- * @param comparator The comparator to be used in the operation.
60
- * @returns A function that applies the comparator operation on the attribute and value provided.
61
- */
62
- getComparatorFunction(comparator) {
63
- switch (comparator) {
64
- case Comparators.eq: {
65
- return (attr, value) => (rpc) => rpc.eq(this.buildColumnName(attr, value), value);
66
- }
67
- case Comparators.ne: {
68
- return (attr, value) => (rpc) => rpc.neq(this.buildColumnName(attr, value), value);
69
- }
70
- case Comparators.gt: {
71
- return (attr, value) => (rpc) => rpc.gt(this.buildColumnName(attr, value), value);
72
- }
73
- case Comparators.gte: {
74
- return (attr, value) => (rpc) => rpc.gte(this.buildColumnName(attr, value), value);
75
- }
76
- case Comparators.lt: {
77
- return (attr, value) => (rpc) => rpc.lt(this.buildColumnName(attr, value), value);
78
- }
79
- case Comparators.lte: {
80
- return (attr, value) => (rpc) => rpc.lte(this.buildColumnName(attr, value), value);
81
- }
82
- default: {
83
- throw new Error("Unknown comparator");
84
- }
85
- }
86
- }
87
- /**
88
- * Builds a column name based on the attribute and value provided. The
89
- * column name is used in filtering data in a Supabase database.
90
- * @param attr The attribute to be used in the column name.
91
- * @param value The value to be used in the column name.
92
- * @param includeType Whether to include the data type in the column name.
93
- * @returns The built column name.
94
- */
95
- buildColumnName(attr, value, includeType = true) {
96
- let column = "";
97
- if (isString(value)) {
98
- column = `metadata->>${attr}`;
99
- }
100
- else if (isInt(value)) {
101
- column = `metadata->${attr}${includeType ? "::int" : ""}`;
102
- }
103
- else if (isFloat(value)) {
104
- column = `metadata->${attr}${includeType ? "::float" : ""}`;
105
- }
106
- else {
107
- throw new Error("Data type not supported");
108
- }
109
- return column;
110
- }
111
- /**
112
- * Visits an operation and returns a string representation of it. This is
113
- * used in translating a structured query into a format that can be
114
- * understood by Supabase.
115
- * @param operation The operation to be visited.
116
- * @returns A string representation of the operation.
117
- */
118
- visitOperationAsString(operation) {
119
- const { args } = operation;
120
- if (!args) {
121
- return "";
122
- }
123
- return args
124
- ?.reduce((acc, arg) => {
125
- if (arg.exprName === "Comparison") {
126
- acc.push(this.visitComparisonAsString(arg));
127
- }
128
- else if (arg.exprName === "Operation") {
129
- const { operator: innerOperator } = arg;
130
- acc.push(`${innerOperator}(${this.visitOperationAsString(arg)})`);
131
- }
132
- return acc;
133
- }, [])
134
- .join(",");
135
- }
136
- /**
137
- * Visits an operation and returns a function that applies the operation
138
- * on a Supabase database. This is used in translating a structured query
139
- * into a format that can be understood by Supabase.
140
- * @param operation The operation to be visited.
141
- * @returns A function that applies the operation on a Supabase database.
142
- */
143
- visitOperation(operation) {
144
- const { operator, args } = operation;
145
- if (this.allowedOperators.includes(operator)) {
146
- if (operator === Operators.and) {
147
- if (!args) {
148
- return (rpc) => rpc;
149
- }
150
- const filter = (rpc) => args.reduce((acc, arg) => {
151
- const filter = arg.accept(this);
152
- return filter(acc);
153
- }, rpc);
154
- return filter;
155
- }
156
- else if (operator === Operators.or) {
157
- return (rpc) => rpc.or(this.visitOperationAsString(operation));
158
- }
159
- else {
160
- throw new Error("Unknown operator");
161
- }
162
- }
163
- else {
164
- throw new Error("Operator not allowed");
165
- }
166
- }
167
- /**
168
- * Visits a comparison and returns a string representation of it. This is
169
- * used in translating a structured query into a format that can be
170
- * understood by Supabase.
171
- * @param comparison The comparison to be visited.
172
- * @returns A string representation of the comparison.
173
- */
174
- visitComparisonAsString(comparison) {
175
- let { value } = comparison;
176
- const { comparator: _comparator, attribute } = comparison;
177
- let comparator = _comparator;
178
- if (comparator === Comparators.ne) {
179
- comparator = "neq";
180
- }
181
- if (Array.isArray(value)) {
182
- value = `(${value
183
- .map((v) => {
184
- if (typeof v === "string" && /[,()]/.test(v))
185
- return `"${v}"`;
186
- return v;
187
- })
188
- .join(",")})`;
189
- }
190
- return `${this.buildColumnName(attribute, value, false)}.${comparator}.${value}}`;
191
- }
192
- /**
193
- * Visits a comparison and returns a function that applies the comparison
194
- * on a Supabase database. This is used in translating a structured query
195
- * into a format that can be understood by Supabase.
196
- * @param comparison The comparison to be visited.
197
- * @returns A function that applies the comparison on a Supabase database.
198
- */
199
- visitComparison(comparison) {
200
- const { comparator, attribute, value } = comparison;
201
- if (this.allowedComparators.includes(comparator)) {
202
- const comparatorFunction = this.getComparatorFunction(comparator);
203
- return comparatorFunction(attribute, value);
204
- }
205
- else {
206
- throw new Error("Comparator not allowed");
207
- }
208
- }
209
- /**
210
- * Visits a structured query and returns a function that applies the query
211
- * on a Supabase database. This is used in translating a structured query
212
- * into a format that can be understood by Supabase.
213
- * @param query The structured query to be visited.
214
- * @returns A function that applies the query on a Supabase database.
215
- */
216
- visitStructuredQuery(query) {
217
- if (!query.filter) {
218
- return {};
219
- }
220
- const filterFunction = query.filter?.accept(this);
221
- return { filter: filterFunction ?? {} };
222
- }
223
- /**
224
- * Merges two filters into one. The merged filter can be used to filter
225
- * data in a Supabase database.
226
- * @param defaultFilter The default filter to be merged.
227
- * @param generatedFilter The generated filter to be merged.
228
- * @param mergeType The type of merge to be performed. It can be 'and', 'or', or 'replace'.
229
- * @returns The merged filter.
230
- */
231
- mergeFilters(defaultFilter, generatedFilter, mergeType = "and") {
232
- if (isFilterEmpty(defaultFilter) && isFilterEmpty(generatedFilter)) {
233
- return undefined;
234
- }
235
- if (isFilterEmpty(defaultFilter) || mergeType === "replace") {
236
- if (isFilterEmpty(generatedFilter)) {
237
- return undefined;
238
- }
239
- return generatedFilter;
240
- }
241
- if (isFilterEmpty(generatedFilter)) {
242
- if (mergeType === "and") {
243
- return undefined;
244
- }
245
- return defaultFilter;
246
- }
247
- let myDefaultFilter = defaultFilter;
248
- if (isObject(defaultFilter)) {
249
- const { filter } = this.visitStructuredQuery(convertObjectFilterToStructuredQuery(defaultFilter));
250
- // just in case the built filter is empty somehow
251
- if (isFilterEmpty(filter)) {
252
- if (isFilterEmpty(generatedFilter)) {
253
- return undefined;
254
- }
255
- return generatedFilter;
256
- }
257
- myDefaultFilter = filter;
258
- }
259
- // After this point, myDefaultFilter will always be SupabaseFilterRPCCall
260
- if (mergeType === "or") {
261
- return (rpc) => {
262
- const defaultFlattenedParams = ProxyParamsDuplicator.getFlattenedParams(rpc, myDefaultFilter);
263
- const generatedFlattenedParams = ProxyParamsDuplicator.getFlattenedParams(rpc, generatedFilter);
264
- return rpc.or(`${defaultFlattenedParams},${generatedFlattenedParams}`);
265
- };
266
- }
267
- else if (mergeType === "and") {
268
- return (rpc) => generatedFilter(myDefaultFilter(rpc));
269
- }
270
- else {
271
- throw new Error("Unknown merge type");
272
- }
273
- }
274
- }