diff --git a/package.json b/package.json index 42a598a..bb77229 100644 --- a/package.json +++ b/package.json @@ -36,11 +36,14 @@ }, "type": "module", "dependencies": { + "@langchain/community": "^0.0.21", + "@langchain/core": "^0.1.18", + "@langchain/openai": "^0.0.13", "@qdrant/js-client-rest": "^1.7.0", "@steeze-ui/heroicons": "^2.2.3", "@steeze-ui/icons": "^2.1.0", "@steeze-ui/svelte-icon": "^1.5.0", - "langchain": "^0.0.198", + "langchain": "^0.1.9", "tiktoken": "^1.0.11" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 95597ed..0e82413 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -5,6 +5,15 @@ settings: excludeLinksFromLockfile: false dependencies: + '@langchain/community': + specifier: ^0.0.21 + version: 0.0.21(@qdrant/js-client-rest@1.7.0) + '@langchain/core': + specifier: ^0.1.18 + version: 0.1.18 + '@langchain/openai': + specifier: ^0.0.13 + version: 0.0.13 '@qdrant/js-client-rest': specifier: ^1.7.0 version: 1.7.0(typescript@5.3.3) @@ -18,8 +27,8 @@ dependencies: specifier: ^1.5.0 version: 1.5.0(svelte@4.2.8) langchain: - specifier: ^0.0.198 - version: 0.0.198(@qdrant/js-client-rest@1.7.0) + specifier: ^0.1.9 + version: 0.1.9(@qdrant/js-client-rest@1.7.0) tiktoken: specifier: ^1.0.11 version: 1.0.11 @@ -108,15 +117,15 @@ packages: /@anthropic-ai/sdk@0.9.1: resolution: {integrity: sha512-wa1meQ2WSfoY8Uor3EdrJq0jTiZJoKoSii2ZVWRY1oN4Tlr5s59pADg9T79FTbPe1/se5c3pBeZgJL63wmuoBA==} dependencies: - '@types/node': 18.19.3 - '@types/node-fetch': 2.6.9 + '@types/node': 18.19.10 + '@types/node-fetch': 2.6.11 abort-controller: 3.0.0 agentkeepalive: 4.5.0 digest-fetch: 1.3.0 form-data-encoder: 1.7.2 formdata-node: 4.4.1 node-fetch: 2.7.0 - web-streams-polyfill: 3.2.1 + web-streams-polyfill: 3.3.2 transitivePeerDependencies: - encoding dev: false @@ -611,20 +620,294 @@ packages: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 - /@langchain/core@0.0.11: - resolution: {integrity: sha512-tiESyyHM1KO1gRTduKcznWbEmE7z/ayPLWZ4+AUXF47qOtdV6lymnlMPzz+MGwnpaSaamzyYkBIxqeMPar256Q==} + /@langchain/community@0.0.21(@qdrant/js-client-rest@1.7.0): + resolution: {integrity: sha512-2b3azTwY3i4hKeNpxXhZ34h9CQHvPu1kNTxAT8mSuOwkA0ZZ+DQ1niOT0Ai1K0ZrSyice5aivgvy6v7Jf0yFZw==} + engines: {node: '>=18'} + peerDependencies: + '@aws-crypto/sha256-js': ^5.0.0 + '@aws-sdk/client-bedrock-agent-runtime': ^3.485.0 + '@aws-sdk/client-bedrock-runtime': ^3.422.0 + '@aws-sdk/client-dynamodb': ^3.310.0 + '@aws-sdk/client-kendra': ^3.352.0 + '@aws-sdk/client-lambda': ^3.310.0 + '@aws-sdk/client-sagemaker-runtime': ^3.310.0 + '@aws-sdk/client-sfn': ^3.310.0 + '@aws-sdk/credential-provider-node': ^3.388.0 + '@azure/search-documents': ^12.0.0 + '@clickhouse/client': ^0.2.5 + '@cloudflare/ai': ^1.0.12 + '@datastax/astra-db-ts': ^0.1.4 + '@elastic/elasticsearch': ^8.4.0 + '@getmetal/metal-sdk': '*' + '@getzep/zep-js': ^0.9.0 + '@gomomento/sdk': ^1.51.1 + '@gomomento/sdk-core': ^1.51.1 + '@google-ai/generativelanguage': ^0.2.1 + '@gradientai/nodejs-sdk': ^1.2.0 + '@huggingface/inference': ^2.6.4 + '@mozilla/readability': '*' + '@opensearch-project/opensearch': '*' + '@pinecone-database/pinecone': ^1.1.0 + '@planetscale/database': ^1.8.0 + '@qdrant/js-client-rest': ^1.2.0 + '@raycast/api': ^1.55.2 + '@rockset/client': ^0.9.1 + '@smithy/eventstream-codec': ^2.0.5 + '@smithy/protocol-http': ^3.0.6 + '@smithy/signature-v4': ^2.0.10 + '@smithy/util-utf8': ^2.0.0 + '@supabase/postgrest-js': ^1.1.1 + '@supabase/supabase-js': ^2.10.0 + '@tensorflow-models/universal-sentence-encoder': '*' + '@tensorflow/tfjs-converter': '*' + '@tensorflow/tfjs-core': '*' + '@upstash/redis': ^1.20.6 + '@vercel/kv': ^0.2.3 + '@vercel/postgres': ^0.5.0 + '@writerai/writer-sdk': ^0.40.2 + '@xata.io/client': ^0.28.0 + '@xenova/transformers': ^2.5.4 + '@zilliz/milvus2-sdk-node': '>=2.2.7' + cassandra-driver: ^4.7.2 + chromadb: '*' + closevector-common: 0.1.0-alpha.1 + closevector-node: 0.1.0-alpha.10 + closevector-web: 0.1.0-alpha.16 + cohere-ai: '>=6.0.0' + convex: ^1.3.1 + discord.js: ^14.14.1 + faiss-node: ^0.5.1 + firebase-admin: ^11.9.0 + google-auth-library: ^8.9.0 + googleapis: ^126.0.1 + hnswlib-node: ^1.4.2 + html-to-text: ^9.0.5 + ioredis: ^5.3.2 + jsdom: '*' + llmonitor: ^0.5.9 + lodash: ^4.17.21 + lunary: ^0.6.11 + mongodb: ^5.2.0 + mysql2: ^3.3.3 + neo4j-driver: '*' + node-llama-cpp: '*' + pg: ^8.11.0 + pg-copy-streams: ^6.0.5 + pickleparser: ^0.2.1 + portkey-ai: ^0.1.11 + redis: ^4.6.4 + replicate: ^0.18.0 + typeorm: ^0.3.12 + typesense: ^1.5.3 + usearch: ^1.1.1 + vectordb: ^0.1.4 + voy-search: 0.6.2 + weaviate-ts-client: ^1.4.0 + web-auth-library: ^1.0.3 + ws: ^8.14.2 + peerDependenciesMeta: + '@aws-crypto/sha256-js': + optional: true + '@aws-sdk/client-bedrock-agent-runtime': + optional: true + '@aws-sdk/client-bedrock-runtime': + optional: true + '@aws-sdk/client-dynamodb': + optional: true + '@aws-sdk/client-kendra': + optional: true + '@aws-sdk/client-lambda': + optional: true + '@aws-sdk/client-sagemaker-runtime': + optional: true + '@aws-sdk/client-sfn': + optional: true + '@aws-sdk/credential-provider-node': + optional: true + '@azure/search-documents': + optional: true + '@clickhouse/client': + optional: true + '@cloudflare/ai': + optional: true + '@datastax/astra-db-ts': + optional: true + '@elastic/elasticsearch': + optional: true + '@getmetal/metal-sdk': + optional: true + '@getzep/zep-js': + optional: true + '@gomomento/sdk': + optional: true + '@gomomento/sdk-core': + optional: true + '@google-ai/generativelanguage': + optional: true + '@gradientai/nodejs-sdk': + optional: true + '@huggingface/inference': + optional: true + '@mozilla/readability': + optional: true + '@opensearch-project/opensearch': + optional: true + '@pinecone-database/pinecone': + optional: true + '@planetscale/database': + optional: true + '@qdrant/js-client-rest': + optional: true + '@raycast/api': + optional: true + '@rockset/client': + optional: true + '@smithy/eventstream-codec': + optional: true + '@smithy/protocol-http': + optional: true + '@smithy/signature-v4': + optional: true + '@smithy/util-utf8': + optional: true + '@supabase/postgrest-js': + optional: true + '@supabase/supabase-js': + optional: true + '@tensorflow-models/universal-sentence-encoder': + optional: true + '@tensorflow/tfjs-converter': + optional: true + '@tensorflow/tfjs-core': + optional: true + '@upstash/redis': + optional: true + '@vercel/kv': + optional: true + '@vercel/postgres': + optional: true + '@writerai/writer-sdk': + optional: true + '@xata.io/client': + optional: true + '@xenova/transformers': + optional: true + '@zilliz/milvus2-sdk-node': + optional: true + cassandra-driver: + optional: true + chromadb: + optional: true + closevector-common: + optional: true + closevector-node: + optional: true + closevector-web: + optional: true + cohere-ai: + optional: true + convex: + optional: true + discord.js: + optional: true + faiss-node: + optional: true + firebase-admin: + optional: true + google-auth-library: + optional: true + googleapis: + optional: true + hnswlib-node: + optional: true + html-to-text: + optional: true + ioredis: + optional: true + jsdom: + optional: true + llmonitor: + optional: true + lodash: + optional: true + lunary: + optional: true + mongodb: + optional: true + mysql2: + optional: true + neo4j-driver: + optional: true + node-llama-cpp: + optional: true + pg: + optional: true + pg-copy-streams: + optional: true + pickleparser: + optional: true + portkey-ai: + optional: true + redis: + optional: true + replicate: + optional: true + typeorm: + optional: true + typesense: + optional: true + usearch: + optional: true + vectordb: + optional: true + voy-search: + optional: true + weaviate-ts-client: + optional: true + web-auth-library: + optional: true + ws: + optional: true + dependencies: + '@langchain/core': 0.1.18 + '@langchain/openai': 0.0.13 + '@qdrant/js-client-rest': 1.7.0(typescript@5.3.3) + flat: 5.0.2 + langsmith: 0.0.63 + uuid: 9.0.1 + zod: 3.22.4 + transitivePeerDependencies: + - encoding + dev: false + + /@langchain/core@0.1.18: + resolution: {integrity: sha512-fDjocs899HDq3nf3PE0TveQoVabO0vyedt9i74Yef4Ds2o22TEDSh3MfoMxM8stcHiV3/9i+0wH4Xdm0E2YLdg==} engines: {node: '>=18'} dependencies: ansi-styles: 5.2.0 camelcase: 6.3.0 decamelize: 1.2.0 - js-tiktoken: 1.0.8 - langsmith: 0.0.52 + js-tiktoken: 1.0.10 + langsmith: 0.0.63 ml-distance: 4.0.1 p-queue: 6.6.2 p-retry: 4.6.2 uuid: 9.0.1 zod: 3.22.4 + zod-to-json-schema: 3.22.4(zod@3.22.4) + dev: false + + /@langchain/openai@0.0.13: + resolution: {integrity: sha512-kgPwFiUA5Abmt8Q/cDhC4o1o5QAYuq962CqneVieMIgTUOJhYqB8Na4/7JI0EIfEZuUP2uuTrtqsulbLpGNQ8w==} + engines: {node: '>=18'} + dependencies: + '@langchain/core': 0.1.18 + js-tiktoken: 1.0.10 + openai: 4.26.0 + zod: 3.22.4 + zod-to-json-schema: 3.22.4(zod@3.22.4) + transitivePeerDependencies: + - encoding dev: false /@nodelib/fs.scandir@2.1.5: @@ -964,15 +1247,15 @@ packages: resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} dev: true - /@types/node-fetch@2.6.9: - resolution: {integrity: sha512-bQVlnMLFJ2d35DkPNjEPmd9ueO/rh5EiaZt2bhqiSarPjZIuIV6bPQVqcrEyvNo+AfTrRGVazle1tl597w3gfA==} + /@types/node-fetch@2.6.11: + resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} dependencies: - '@types/node': 18.19.3 + '@types/node': 18.19.10 form-data: 4.0.0 dev: false - /@types/node@18.19.3: - resolution: {integrity: sha512-k5fggr14DwAytoA/t8rPrIz++lXK7/DqckthCmoZOKNsEbJkId4Z//BqgApXBUGrGddrigYa1oqheo/7YmW4rg==} + /@types/node@18.19.10: + resolution: {integrity: sha512-IZD8kAM02AW1HRDTPOlz3npFava678pr8Ie9Vp8uRhBROXAv8MXT2pCnGZZAKYdromsNQLHQcfWQ6EOatVLtqA==} dependencies: undici-types: 5.26.5 dev: false @@ -993,8 +1276,8 @@ packages: resolution: {integrity: sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==} dev: true - /@types/uuid@9.0.7: - resolution: {integrity: sha512-WUtIVRUZ9i5dYXefDEAI7sh9/O7jGvHg7Df/5O/gtH3Yabe5odI3UWopVR1qbPXQtvOxWu3mM4XxlYeZtMWF4g==} + /@types/uuid@9.0.8: + resolution: {integrity: sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==} dev: false /@typescript-eslint/eslint-plugin@6.15.0(@typescript-eslint/parser@6.15.0)(eslint@8.56.0)(typescript@5.3.3): @@ -2063,8 +2346,8 @@ packages: hasBin: true dev: true - /js-tiktoken@1.0.8: - resolution: {integrity: sha512-r7XK3E9/I+SOrbAGqb39pyO/rHAS1diAOSRAvaaLfHgXjkUSK9AiSd+r84Vn2f/GvXJYRAxKj8NHrUvqlaH5qg==} + /js-tiktoken@1.0.10: + resolution: {integrity: sha512-ZoSxbGjvGyMT13x6ACo9ebhDha/0FHdKA+OsQcMOWcm1Zs7r90Rhk5lhERLzji+3rA7EKpXCgwXcM5fF3DMpdA==} dependencies: base64-js: 1.5.1 dev: false @@ -2107,121 +2390,63 @@ packages: resolution: {integrity: sha512-Ne7wqW7/9Cz54PDt4I3tcV+hAyat8ypyOGzYRJQfdxnnjeWsTxt1cy8pjvvKeI5kfXuyvULyeeAvwvvtAX3ayQ==} dev: true - /langchain@0.0.198(@qdrant/js-client-rest@1.7.0): - resolution: {integrity: sha512-YC0O1g8r61InCWyF5NmiQjdghdq6LKcgMrDZtqLbgDxAe4RoSldonm+5oNXS3yjCISG0j3s5Cty+yB7klqvUpg==} + /langchain@0.1.9(@qdrant/js-client-rest@1.7.0): + resolution: {integrity: sha512-4Gm2j8gsT43d4sgpjM7JMSoB83dwxbiLYdcPx23Xi6RfLQ60QB86bogPYqn84ZW9HjrW8IVMXvVyC6DAHNCyIg==} engines: {node: '>=18'} peerDependencies: - '@aws-crypto/sha256-js': ^5.0.0 - '@aws-sdk/client-bedrock-runtime': ^3.422.0 - '@aws-sdk/client-dynamodb': ^3.310.0 - '@aws-sdk/client-kendra': ^3.352.0 - '@aws-sdk/client-lambda': ^3.310.0 '@aws-sdk/client-s3': ^3.310.0 '@aws-sdk/client-sagemaker-runtime': ^3.310.0 '@aws-sdk/client-sfn': ^3.310.0 '@aws-sdk/credential-provider-node': ^3.388.0 '@azure/storage-blob': ^12.15.0 - '@clickhouse/client': ^0.2.5 - '@cloudflare/ai': ^1.0.12 - '@elastic/elasticsearch': ^8.4.0 - '@getmetal/metal-sdk': '*' - '@getzep/zep-js': ^0.9.0 '@gomomento/sdk': ^1.51.1 '@gomomento/sdk-core': ^1.51.1 '@gomomento/sdk-web': ^1.51.1 '@google-ai/generativelanguage': ^0.2.1 '@google-cloud/storage': ^6.10.1 - '@huggingface/inference': ^2.6.4 - '@mozilla/readability': '*' '@notionhq/client': ^2.2.10 - '@opensearch-project/opensearch': '*' - '@pinecone-database/pinecone': ^1.1.0 - '@planetscale/database': ^1.8.0 - '@qdrant/js-client-rest': ^1.2.0 - '@raycast/api': ^1.55.2 - '@rockset/client': ^0.9.1 - '@smithy/eventstream-codec': ^2.0.5 - '@smithy/protocol-http': ^3.0.6 - '@smithy/signature-v4': ^2.0.10 - '@smithy/util-utf8': ^2.0.0 - '@supabase/postgrest-js': ^1.1.1 + '@pinecone-database/pinecone': '*' '@supabase/supabase-js': ^2.10.0 - '@tensorflow-models/universal-sentence-encoder': '*' - '@tensorflow/tfjs-converter': '*' - '@tensorflow/tfjs-core': '*' - '@upstash/redis': ^1.20.6 '@vercel/kv': ^0.2.3 - '@vercel/postgres': ^0.5.0 - '@writerai/writer-sdk': ^0.40.2 - '@xata.io/client': ^0.25.1 - '@xenova/transformers': ^2.5.4 - '@zilliz/milvus2-sdk-node': '>=2.2.7' + '@xata.io/client': ^0.28.0 apify-client: ^2.7.1 - assemblyai: ^2.0.2 + assemblyai: ^4.0.0 axios: '*' - cassandra-driver: ^4.7.2 cheerio: ^1.0.0-rc.12 chromadb: '*' - closevector-common: 0.1.0-alpha.1 - closevector-node: 0.1.0-alpha.10 - closevector-web: 0.1.0-alpha.16 - cohere-ai: '>=6.0.0' convex: ^1.3.1 d3-dsv: ^2.0.0 epub2: ^3.0.1 - faiss-node: ^0.5.1 + faiss-node: '*' fast-xml-parser: ^4.2.7 - firebase-admin: ^11.9.0 google-auth-library: ^8.9.0 googleapis: ^126.0.1 - hnswlib-node: ^1.4.2 + handlebars: ^4.7.8 html-to-text: ^9.0.5 ignore: ^5.2.0 ioredis: ^5.3.2 jsdom: '*' - llmonitor: ^0.5.9 - lodash: ^4.17.21 - mammoth: '*' + mammoth: ^1.6.0 mongodb: ^5.2.0 - mysql2: ^3.3.3 - neo4j-driver: '*' node-llama-cpp: '*' notion-to-md: ^3.1.0 officeparser: ^4.0.4 pdf-parse: 1.1.1 peggy: ^3.0.2 - pg: ^8.11.0 - pg-copy-streams: ^6.0.5 - pickleparser: ^0.2.1 playwright: ^1.32.1 - portkey-ai: ^0.1.11 puppeteer: ^19.7.2 pyodide: ^0.24.1 redis: ^4.6.4 - replicate: ^0.18.0 sonix-speech-recognition: ^2.1.1 - srt-parser-2: ^1.2.2 + srt-parser-2: ^1.2.3 typeorm: ^0.3.12 - typesense: ^1.5.3 - usearch: ^1.1.1 vectordb: ^0.1.4 - voy-search: 0.6.2 weaviate-ts-client: ^1.4.0 web-auth-library: ^1.0.3 ws: ^8.14.2 youtube-transcript: ^1.0.6 youtubei.js: ^5.8.0 peerDependenciesMeta: - '@aws-crypto/sha256-js': - optional: true - '@aws-sdk/client-bedrock-runtime': - optional: true - '@aws-sdk/client-dynamodb': - optional: true - '@aws-sdk/client-kendra': - optional: true - '@aws-sdk/client-lambda': - optional: true '@aws-sdk/client-s3': optional: true '@aws-sdk/client-sagemaker-runtime': @@ -2232,16 +2457,6 @@ packages: optional: true '@azure/storage-blob': optional: true - '@clickhouse/client': - optional: true - '@cloudflare/ai': - optional: true - '@elastic/elasticsearch': - optional: true - '@getmetal/metal-sdk': - optional: true - '@getzep/zep-js': - optional: true '@gomomento/sdk': optional: true '@gomomento/sdk-core': @@ -2252,76 +2467,26 @@ packages: optional: true '@google-cloud/storage': optional: true - '@huggingface/inference': - optional: true - '@mozilla/readability': - optional: true '@notionhq/client': optional: true - '@opensearch-project/opensearch': - optional: true '@pinecone-database/pinecone': optional: true - '@planetscale/database': - optional: true - '@qdrant/js-client-rest': - optional: true - '@raycast/api': - optional: true - '@rockset/client': - optional: true - '@smithy/eventstream-codec': - optional: true - '@smithy/protocol-http': - optional: true - '@smithy/signature-v4': - optional: true - '@smithy/util-utf8': - optional: true - '@supabase/postgrest-js': - optional: true '@supabase/supabase-js': optional: true - '@tensorflow-models/universal-sentence-encoder': - optional: true - '@tensorflow/tfjs-converter': - optional: true - '@tensorflow/tfjs-core': - optional: true - '@upstash/redis': - optional: true '@vercel/kv': optional: true - '@vercel/postgres': - optional: true - '@writerai/writer-sdk': - optional: true '@xata.io/client': optional: true - '@xenova/transformers': - optional: true - '@zilliz/milvus2-sdk-node': - optional: true apify-client: optional: true assemblyai: optional: true axios: optional: true - cassandra-driver: - optional: true cheerio: optional: true chromadb: optional: true - closevector-common: - optional: true - closevector-node: - optional: true - closevector-web: - optional: true - cohere-ai: - optional: true convex: optional: true d3-dsv: @@ -2332,13 +2497,11 @@ packages: optional: true fast-xml-parser: optional: true - firebase-admin: - optional: true google-auth-library: optional: true googleapis: optional: true - hnswlib-node: + handlebars: optional: true html-to-text: optional: true @@ -2348,18 +2511,10 @@ packages: optional: true jsdom: optional: true - llmonitor: - optional: true - lodash: - optional: true mammoth: optional: true mongodb: optional: true - mysql2: - optional: true - neo4j-driver: - optional: true node-llama-cpp: optional: true notion-to-md: @@ -2370,38 +2525,22 @@ packages: optional: true peggy: optional: true - pg: - optional: true - pg-copy-streams: - optional: true - pickleparser: - optional: true playwright: optional: true - portkey-ai: - optional: true puppeteer: optional: true pyodide: optional: true redis: optional: true - replicate: - optional: true sonix-speech-recognition: optional: true srt-parser-2: optional: true typeorm: optional: true - typesense: - optional: true - usearch: - optional: true vectordb: optional: true - voy-search: - optional: true weaviate-ts-client: optional: true web-auth-library: @@ -2414,37 +2553,91 @@ packages: optional: true dependencies: '@anthropic-ai/sdk': 0.9.1 - '@langchain/core': 0.0.11 - '@qdrant/js-client-rest': 1.7.0(typescript@5.3.3) + '@langchain/community': 0.0.21(@qdrant/js-client-rest@1.7.0) + '@langchain/core': 0.1.18 + '@langchain/openai': 0.0.13 binary-extensions: 2.2.0 expr-eval: 2.0.2 - flat: 5.0.2 - js-tiktoken: 1.0.8 + js-tiktoken: 1.0.10 js-yaml: 4.1.0 jsonpointer: 5.0.1 langchainhub: 0.0.6 - langsmith: 0.0.52 + langsmith: 0.0.63 ml-distance: 4.0.1 - openai: 4.23.0 openapi-types: 12.1.3 p-retry: 4.6.2 uuid: 9.0.1 yaml: 2.3.4 zod: 3.22.4 - zod-to-json-schema: 3.20.3(zod@3.22.4) + zod-to-json-schema: 3.22.4(zod@3.22.4) transitivePeerDependencies: + - '@aws-crypto/sha256-js' + - '@aws-sdk/client-bedrock-agent-runtime' + - '@aws-sdk/client-bedrock-runtime' + - '@aws-sdk/client-dynamodb' + - '@aws-sdk/client-kendra' + - '@aws-sdk/client-lambda' + - '@azure/search-documents' + - '@clickhouse/client' + - '@cloudflare/ai' + - '@datastax/astra-db-ts' + - '@elastic/elasticsearch' + - '@getmetal/metal-sdk' + - '@getzep/zep-js' + - '@gradientai/nodejs-sdk' + - '@huggingface/inference' + - '@mozilla/readability' + - '@opensearch-project/opensearch' + - '@planetscale/database' + - '@qdrant/js-client-rest' + - '@raycast/api' + - '@rockset/client' + - '@smithy/eventstream-codec' + - '@smithy/protocol-http' + - '@smithy/signature-v4' + - '@smithy/util-utf8' + - '@supabase/postgrest-js' + - '@tensorflow-models/universal-sentence-encoder' + - '@tensorflow/tfjs-converter' + - '@tensorflow/tfjs-core' + - '@upstash/redis' + - '@vercel/postgres' + - '@writerai/writer-sdk' + - '@xenova/transformers' + - '@zilliz/milvus2-sdk-node' + - cassandra-driver + - closevector-common + - closevector-node + - closevector-web + - cohere-ai + - discord.js - encoding + - firebase-admin + - hnswlib-node + - llmonitor + - lodash + - lunary + - mysql2 + - neo4j-driver + - pg + - pg-copy-streams + - pickleparser + - portkey-ai + - replicate + - typesense + - usearch + - voy-search dev: false /langchainhub@0.0.6: resolution: {integrity: sha512-SW6105T+YP1cTe0yMf//7kyshCgvCTyFBMTgH2H3s9rTAR4e+78DA/BBrUL/Mt4Q5eMWui7iGuAYb3pgGsdQ9w==} dev: false - /langsmith@0.0.52: - resolution: {integrity: sha512-xfEi2gpXvPgCBR4x3MqFHXmAJ5sFpfrcsb2QduXj2gylk6V+8CG5AONgvo0Y1Wx/nue+6EZjmcDjjH+aDi8NIA==} + /langsmith@0.0.63: + resolution: {integrity: sha512-8KtbiltWP8Ta7xErfXRvLudKgIoc/yRb9oSU8Ozh2215rlz9tnYicl37lS/ZdyeSbpSX8Rh8XhLTN5zVQ+5euA==} hasBin: true dependencies: - '@types/uuid': 9.0.7 + '@types/uuid': 9.0.8 commander: 10.0.1 p-queue: 6.6.2 p-retry: 4.6.2 @@ -2684,19 +2877,19 @@ packages: wrappy: 1.0.2 dev: true - /openai@4.23.0: - resolution: {integrity: sha512-ey2CXh1OTcTUa0AWZWuTpgA9t5GuAG3DVU1MofCRUI7fQJij8XJ3Sr0VtgxoAE69C9wbHBMCux8Z/IQZfSwHiA==} + /openai@4.26.0: + resolution: {integrity: sha512-HPC7tgYdeP38F3uHA5WgnoXZyGbAp9jgcIo23p6It+q/07u4C+NZ8xHKlMShsPbDDmFRpPsa3vdbXYpbhJH3eg==} hasBin: true dependencies: - '@types/node': 18.19.3 - '@types/node-fetch': 2.6.9 + '@types/node': 18.19.10 + '@types/node-fetch': 2.6.11 abort-controller: 3.0.0 agentkeepalive: 4.5.0 digest-fetch: 1.3.0 form-data-encoder: 1.7.2 formdata-node: 4.4.1 node-fetch: 2.7.0 - web-streams-polyfill: 3.2.1 + web-streams-polyfill: 3.3.2 transitivePeerDependencies: - encoding dev: false @@ -3512,8 +3705,8 @@ packages: engines: {node: '>=0.10.0'} dev: false - /web-streams-polyfill@3.2.1: - resolution: {integrity: sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==} + /web-streams-polyfill@3.3.2: + resolution: {integrity: sha512-3pRGuxRF5gpuZc0W+EpwQRmCD7gRqcDOMt688KmdlDAgAyaB1XlN0zq2njfDNm44XVdIouE7pZ6GzbdyH47uIQ==} engines: {node: '>= 8'} dev: false @@ -3563,10 +3756,10 @@ packages: engines: {node: '>=10'} dev: true - /zod-to-json-schema@3.20.3(zod@3.22.4): - resolution: {integrity: sha512-/Q3wnyxAfCt94ZcrGiXXoiAfRqasxl9CX64LZ9fj+4dKH68zulUtU0uk1WMxQPfAxQ0ZI70dKzcoW7hHj+DwSQ==} + /zod-to-json-schema@3.22.4(zod@3.22.4): + resolution: {integrity: sha512-2Ed5dJ+n/O3cU383xSY28cuVi0BCQhF8nYqWU5paEpl7fVdqdAmiLdqLyfblbNdfOFwFfi/mqU4O1pwc60iBhQ==} peerDependencies: - zod: ^3.20.0 + zod: ^3.22.4 dependencies: zod: 3.22.4 dev: false diff --git a/scripts/encode_data.py b/scripts/encode_data.py index 94e1c8e..2bd08e8 100644 --- a/scripts/encode_data.py +++ b/scripts/encode_data.py @@ -4,13 +4,12 @@ import os import threading -from langchain.document_loaders.base import BaseLoader import numpy as np from dotenv import load_dotenv -from langchain.document_loaders import DirectoryLoader, TextLoader, UnstructuredPDFLoader, UnstructuredRSTLoader, UnstructuredMarkdownLoader -from langchain.embeddings import OpenAIEmbeddings +from langchain_community.document_loaders import TextLoader, UnstructuredPDFLoader, UnstructuredRSTLoader, UnstructuredMarkdownLoader +from langchain_openai.embeddings import OpenAIEmbeddings from langchain.text_splitter import TokenTextSplitter diff --git a/scripts/requirements.txt b/scripts/requirements.txt index c5ef077..af1ccb2 100644 --- a/scripts/requirements.txt +++ b/scripts/requirements.txt @@ -2,7 +2,11 @@ openai numpy tiktoken pypdf + langchain +langchain-community +langchain-openai + python-dotenv unstructured unstructured[pdf] diff --git a/src/lib/completion/completion.ts b/src/lib/completion/completion.ts index 0bb113e..9d960f4 100644 --- a/src/lib/completion/completion.ts +++ b/src/lib/completion/completion.ts @@ -1,7 +1,7 @@ import { Document } from 'langchain/document'; -import { ChatOpenAI } from 'langchain/chat_models/openai'; -import { OpenAIEmbeddings } from 'langchain/embeddings/openai'; +import { ChatOpenAI } from '@langchain/openai'; +import { OpenAIEmbeddings } from '@langchain/openai'; import { SystemMessage, BaseMessage, AIMessage, HumanMessage } from 'langchain/schema'; import { ChatHistoryType, type ChatHistory } from '$lib/history';