langchain 0.0.191 → 0.0.193
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.
- package/cache/file_system.cjs +1 -0
- package/cache/file_system.d.ts +1 -0
- package/cache/file_system.js +1 -0
- package/dist/agents/agent.cjs +24 -0
- package/dist/agents/agent.d.ts +24 -0
- package/dist/agents/agent.js +24 -0
- package/dist/agents/chat/outputParser.cjs +32 -0
- package/dist/agents/chat/outputParser.d.ts +32 -0
- package/dist/agents/chat/outputParser.js +32 -0
- package/dist/agents/executor.cjs +14 -0
- package/dist/agents/executor.d.ts +14 -0
- package/dist/agents/executor.js +14 -0
- package/dist/agents/mrkl/index.cjs +21 -0
- package/dist/agents/mrkl/index.d.ts +21 -0
- package/dist/agents/mrkl/index.js +21 -0
- package/dist/agents/openai/output_parser.cjs +65 -0
- package/dist/agents/openai/output_parser.d.ts +65 -0
- package/dist/agents/openai/output_parser.js +65 -0
- package/dist/agents/react/output_parser.cjs +16 -0
- package/dist/agents/react/output_parser.d.ts +16 -0
- package/dist/agents/react/output_parser.js +16 -0
- package/dist/agents/structured_chat/outputParser.cjs +12 -0
- package/dist/agents/structured_chat/outputParser.d.ts +12 -0
- package/dist/agents/structured_chat/outputParser.js +12 -0
- package/dist/agents/toolkits/aws_sfn.cjs +20 -0
- package/dist/agents/toolkits/aws_sfn.d.ts +20 -0
- package/dist/agents/toolkits/aws_sfn.js +20 -0
- package/dist/agents/toolkits/json/json.cjs +8 -0
- package/dist/agents/toolkits/json/json.d.ts +8 -0
- package/dist/agents/toolkits/json/json.js +8 -0
- package/dist/agents/toolkits/openapi/openapi.cjs +18 -0
- package/dist/agents/toolkits/openapi/openapi.d.ts +18 -0
- package/dist/agents/toolkits/openapi/openapi.js +18 -0
- package/dist/agents/toolkits/sql/sql.cjs +8 -0
- package/dist/agents/toolkits/sql/sql.d.ts +8 -0
- package/dist/agents/toolkits/sql/sql.js +8 -0
- package/dist/agents/toolkits/vectorstore/vectorstore.cjs +16 -0
- package/dist/agents/toolkits/vectorstore/vectorstore.d.ts +16 -0
- package/dist/agents/toolkits/vectorstore/vectorstore.js +16 -0
- package/dist/agents/toolkits/zapier/zapier.cjs +10 -0
- package/dist/agents/toolkits/zapier/zapier.d.ts +10 -0
- package/dist/agents/toolkits/zapier/zapier.js +10 -0
- package/dist/agents/xml/output_parser.cjs +21 -0
- package/dist/agents/xml/output_parser.d.ts +21 -0
- package/dist/agents/xml/output_parser.js +21 -0
- package/dist/cache/cloudflare_kv.cjs +13 -0
- package/dist/cache/cloudflare_kv.d.ts +13 -0
- package/dist/cache/cloudflare_kv.js +13 -0
- package/dist/cache/file_system.cjs +73 -0
- package/dist/cache/file_system.d.ts +33 -0
- package/dist/cache/file_system.js +66 -0
- package/dist/cache/ioredis.cjs +13 -0
- package/dist/cache/ioredis.d.ts +13 -0
- package/dist/cache/ioredis.js +13 -0
- package/dist/cache/momento.cjs +19 -0
- package/dist/cache/momento.d.ts +19 -0
- package/dist/cache/momento.js +19 -0
- package/dist/cache/redis.cjs +10 -0
- package/dist/cache/redis.d.ts +10 -0
- package/dist/cache/redis.js +10 -0
- package/dist/cache/upstash_redis.cjs +15 -0
- package/dist/cache/upstash_redis.d.ts +15 -0
- package/dist/cache/upstash_redis.js +15 -0
- package/dist/callbacks/handlers/console.cjs +10 -0
- package/dist/callbacks/handlers/console.d.ts +10 -0
- package/dist/callbacks/handlers/console.js +10 -0
- package/dist/callbacks/manager.cjs +49 -0
- package/dist/callbacks/manager.d.ts +49 -0
- package/dist/callbacks/manager.js +49 -0
- package/dist/chains/analyze_documents_chain.cjs +18 -0
- package/dist/chains/analyze_documents_chain.d.ts +18 -0
- package/dist/chains/analyze_documents_chain.js +18 -0
- package/dist/chains/constitutional_ai/constitutional_chain.cjs +21 -0
- package/dist/chains/constitutional_ai/constitutional_chain.d.ts +21 -0
- package/dist/chains/constitutional_ai/constitutional_chain.js +21 -0
- package/dist/chains/constitutional_ai/constitutional_principle.cjs +21 -0
- package/dist/chains/constitutional_ai/constitutional_principle.d.ts +21 -0
- package/dist/chains/constitutional_ai/constitutional_principle.js +21 -0
- package/dist/chains/conversation.cjs +13 -0
- package/dist/chains/conversation.d.ts +13 -0
- package/dist/chains/conversation.js +13 -0
- package/dist/chains/conversational_retrieval_chain.cjs +29 -0
- package/dist/chains/conversational_retrieval_chain.d.ts +29 -0
- package/dist/chains/conversational_retrieval_chain.js +29 -0
- package/dist/chains/graph_qa/cypher.cjs +10 -0
- package/dist/chains/graph_qa/cypher.d.ts +10 -0
- package/dist/chains/graph_qa/cypher.js +10 -0
- package/dist/chains/openai_moderation.cjs +28 -0
- package/dist/chains/openai_moderation.d.ts +28 -0
- package/dist/chains/openai_moderation.js +28 -0
- package/dist/chains/retrieval_qa.cjs +21 -0
- package/dist/chains/retrieval_qa.d.ts +21 -0
- package/dist/chains/retrieval_qa.js +21 -0
- package/dist/chains/router/multi_prompt.cjs +19 -0
- package/dist/chains/router/multi_prompt.d.ts +19 -0
- package/dist/chains/router/multi_prompt.js +19 -0
- package/dist/chains/router/multi_retrieval_qa.cjs +29 -0
- package/dist/chains/router/multi_retrieval_qa.d.ts +29 -0
- package/dist/chains/router/multi_retrieval_qa.js +29 -0
- package/dist/chains/sequential_chain.cjs +43 -0
- package/dist/chains/sequential_chain.d.ts +43 -0
- package/dist/chains/sequential_chain.js +43 -0
- package/dist/chains/sql_db/sql_db_chain.cjs +9 -0
- package/dist/chains/sql_db/sql_db_chain.d.ts +9 -0
- package/dist/chains/sql_db/sql_db_chain.js +9 -0
- package/dist/chat_models/anthropic.cjs +9 -1
- package/dist/chat_models/anthropic.d.ts +9 -1
- package/dist/chat_models/anthropic.js +9 -1
- package/dist/chat_models/baiduwenxin.cjs +20 -0
- package/dist/chat_models/baiduwenxin.d.ts +20 -0
- package/dist/chat_models/baiduwenxin.js +20 -0
- package/dist/chat_models/base.cjs +2 -0
- package/dist/chat_models/base.d.ts +1 -1
- package/dist/chat_models/base.js +2 -0
- package/dist/chat_models/bedrock/index.cjs +11 -0
- package/dist/chat_models/bedrock/index.d.ts +11 -0
- package/dist/chat_models/bedrock/index.js +11 -0
- package/dist/chat_models/bedrock/web.cjs +10 -1
- package/dist/chat_models/bedrock/web.d.ts +9 -0
- package/dist/chat_models/bedrock/web.js +10 -1
- package/dist/chat_models/cloudflare_workersai.cjs +15 -0
- package/dist/chat_models/cloudflare_workersai.d.ts +15 -0
- package/dist/chat_models/cloudflare_workersai.js +15 -0
- package/dist/chat_models/fake.cjs +16 -0
- package/dist/chat_models/fake.d.ts +16 -0
- package/dist/chat_models/fake.js +16 -0
- package/dist/chat_models/fireworks.cjs +10 -0
- package/dist/chat_models/fireworks.d.ts +10 -0
- package/dist/chat_models/fireworks.js +10 -0
- package/dist/chat_models/googlepalm.cjs +24 -0
- package/dist/chat_models/googlepalm.d.ts +24 -0
- package/dist/chat_models/googlepalm.js +24 -0
- package/dist/chat_models/googlevertexai/index.cjs +7 -0
- package/dist/chat_models/googlevertexai/index.d.ts +7 -0
- package/dist/chat_models/googlevertexai/index.js +7 -0
- package/dist/chat_models/googlevertexai/web.cjs +9 -0
- package/dist/chat_models/googlevertexai/web.d.ts +9 -0
- package/dist/chat_models/googlevertexai/web.js +9 -0
- package/dist/chat_models/iflytek_xinghuo/index.cjs +8 -0
- package/dist/chat_models/iflytek_xinghuo/index.d.ts +8 -0
- package/dist/chat_models/iflytek_xinghuo/index.js +8 -0
- package/dist/chat_models/iflytek_xinghuo/web.cjs +8 -0
- package/dist/chat_models/iflytek_xinghuo/web.d.ts +8 -0
- package/dist/chat_models/iflytek_xinghuo/web.js +8 -0
- package/dist/chat_models/llama_cpp.cjs +17 -0
- package/dist/chat_models/llama_cpp.d.ts +17 -0
- package/dist/chat_models/llama_cpp.js +17 -0
- package/dist/chat_models/minimax.cjs +27 -0
- package/dist/chat_models/minimax.d.ts +27 -0
- package/dist/chat_models/minimax.js +27 -0
- package/dist/chat_models/ollama.cjs +24 -0
- package/dist/chat_models/ollama.d.ts +24 -0
- package/dist/chat_models/ollama.js +24 -0
- package/dist/chat_models/openai.cjs +15 -0
- package/dist/chat_models/openai.d.ts +15 -0
- package/dist/chat_models/openai.js +15 -0
- package/dist/chat_models/yandex.cjs +14 -0
- package/dist/chat_models/yandex.d.ts +14 -0
- package/dist/chat_models/yandex.js +14 -0
- package/dist/document_loaders/fs/directory.cjs +14 -0
- package/dist/document_loaders/fs/directory.d.ts +14 -0
- package/dist/document_loaders/fs/directory.js +14 -0
- package/dist/document_loaders/fs/openai_whisper_audio.cjs +10 -0
- package/dist/document_loaders/fs/openai_whisper_audio.d.ts +10 -0
- package/dist/document_loaders/fs/openai_whisper_audio.js +10 -0
- package/dist/document_loaders/fs/pdf.cjs +15 -2
- package/dist/document_loaders/fs/pdf.d.ts +9 -1
- package/dist/document_loaders/fs/pdf.js +15 -2
- package/dist/document_loaders/fs/srt.cjs +6 -0
- package/dist/document_loaders/fs/srt.d.ts +6 -0
- package/dist/document_loaders/fs/srt.js +6 -0
- package/dist/document_loaders/fs/text.cjs +5 -0
- package/dist/document_loaders/fs/text.d.ts +5 -0
- package/dist/document_loaders/fs/text.js +5 -0
- package/dist/document_loaders/fs/unstructured.cjs +7 -0
- package/dist/document_loaders/fs/unstructured.d.ts +7 -0
- package/dist/document_loaders/fs/unstructured.js +7 -0
- package/dist/document_loaders/web/apify_dataset.cjs +26 -2
- package/dist/document_loaders/web/apify_dataset.d.ts +25 -1
- package/dist/document_loaders/web/apify_dataset.js +26 -2
- package/dist/document_loaders/web/assemblyai.cjs +24 -0
- package/dist/document_loaders/web/assemblyai.d.ts +24 -0
- package/dist/document_loaders/web/assemblyai.js +24 -0
- package/dist/document_loaders/web/azure_blob_storage_file.cjs +11 -0
- package/dist/document_loaders/web/azure_blob_storage_file.d.ts +11 -0
- package/dist/document_loaders/web/azure_blob_storage_file.js +11 -0
- package/dist/document_loaders/web/cheerio.cjs +6 -0
- package/dist/document_loaders/web/cheerio.d.ts +6 -0
- package/dist/document_loaders/web/cheerio.js +6 -0
- package/dist/document_loaders/web/college_confidential.cjs +6 -0
- package/dist/document_loaders/web/college_confidential.d.ts +6 -0
- package/dist/document_loaders/web/college_confidential.js +6 -0
- package/dist/document_loaders/web/confluence.cjs +11 -0
- package/dist/document_loaders/web/confluence.d.ts +11 -0
- package/dist/document_loaders/web/confluence.js +11 -0
- package/dist/document_loaders/web/figma.cjs +9 -0
- package/dist/document_loaders/web/figma.d.ts +9 -0
- package/dist/document_loaders/web/figma.js +9 -0
- package/dist/document_loaders/web/notionapi.cjs +16 -0
- package/dist/document_loaders/web/notionapi.d.ts +16 -0
- package/dist/document_loaders/web/notionapi.js +16 -0
- package/dist/document_loaders/web/notiondb.cjs +11 -1
- package/dist/document_loaders/web/notiondb.d.ts +11 -1
- package/dist/document_loaders/web/notiondb.js +11 -1
- package/dist/document_loaders/web/pdf.cjs +15 -2
- package/dist/document_loaders/web/pdf.d.ts +9 -1
- package/dist/document_loaders/web/pdf.js +15 -2
- package/dist/document_loaders/web/puppeteer.cjs +12 -0
- package/dist/document_loaders/web/puppeteer.d.ts +12 -0
- package/dist/document_loaders/web/puppeteer.js +12 -0
- package/dist/document_loaders/web/s3.cjs +17 -0
- package/dist/document_loaders/web/s3.d.ts +17 -0
- package/dist/document_loaders/web/s3.js +17 -0
- package/dist/document_loaders/web/searchapi.cjs +9 -0
- package/dist/document_loaders/web/searchapi.d.ts +9 -0
- package/dist/document_loaders/web/searchapi.js +9 -0
- package/dist/document_loaders/web/serpapi.cjs +5 -0
- package/dist/document_loaders/web/serpapi.d.ts +5 -0
- package/dist/document_loaders/web/serpapi.js +5 -0
- package/dist/document_loaders/web/sonix_audio.cjs +12 -0
- package/dist/document_loaders/web/sonix_audio.d.ts +12 -0
- package/dist/document_loaders/web/sonix_audio.js +12 -0
- package/dist/document_loaders/web/sort_xyz_blockchain.cjs +22 -0
- package/dist/document_loaders/web/sort_xyz_blockchain.d.ts +22 -0
- package/dist/document_loaders/web/sort_xyz_blockchain.js +22 -0
- package/dist/document_loaders/web/youtube.cjs +9 -0
- package/dist/document_loaders/web/youtube.d.ts +9 -0
- package/dist/document_loaders/web/youtube.js +9 -0
- package/dist/document_transformers/html_to_text.cjs +18 -0
- package/dist/document_transformers/html_to_text.d.ts +18 -0
- package/dist/document_transformers/html_to_text.js +18 -0
- package/dist/document_transformers/mozilla_readability.cjs +18 -0
- package/dist/document_transformers/mozilla_readability.d.ts +18 -0
- package/dist/document_transformers/mozilla_readability.js +18 -0
- package/dist/embeddings/bedrock.cjs +17 -0
- package/dist/embeddings/bedrock.d.ts +17 -0
- package/dist/embeddings/bedrock.js +17 -0
- package/dist/embeddings/cache_backed.cjs +37 -0
- package/dist/embeddings/cache_backed.d.ts +37 -0
- package/dist/embeddings/cache_backed.js +37 -0
- package/dist/embeddings/cohere.cjs +10 -0
- package/dist/embeddings/cohere.d.ts +10 -0
- package/dist/embeddings/cohere.js +10 -0
- package/dist/embeddings/googlepalm.cjs +17 -0
- package/dist/embeddings/googlepalm.d.ts +17 -0
- package/dist/embeddings/googlepalm.js +17 -0
- package/dist/embeddings/googlevertexai.cjs +8 -0
- package/dist/embeddings/googlevertexai.d.ts +8 -0
- package/dist/embeddings/googlevertexai.js +8 -0
- package/dist/embeddings/hf_transformers.cjs +18 -0
- package/dist/embeddings/hf_transformers.d.ts +18 -0
- package/dist/embeddings/hf_transformers.js +18 -0
- package/dist/embeddings/llama_cpp.cjs +16 -0
- package/dist/embeddings/llama_cpp.d.ts +16 -0
- package/dist/embeddings/llama_cpp.js +16 -0
- package/dist/embeddings/minimax.cjs +15 -0
- package/dist/embeddings/minimax.d.ts +15 -0
- package/dist/embeddings/minimax.js +15 -0
- package/dist/embeddings/openai.cjs +10 -0
- package/dist/embeddings/openai.d.ts +10 -0
- package/dist/embeddings/openai.js +10 -0
- package/dist/embeddings/tensorflow.cjs +16 -0
- package/dist/embeddings/tensorflow.d.ts +16 -0
- package/dist/embeddings/tensorflow.js +16 -0
- package/dist/experimental/autogpt/agent.cjs +21 -0
- package/dist/experimental/autogpt/agent.d.ts +21 -0
- package/dist/experimental/autogpt/agent.js +21 -0
- package/dist/experimental/babyagi/agent.cjs +12 -0
- package/dist/experimental/babyagi/agent.d.ts +12 -0
- package/dist/experimental/babyagi/agent.js +12 -0
- package/dist/experimental/chat_models/ollama_functions.cjs +12 -15
- package/dist/experimental/chat_models/ollama_functions.d.ts +3 -4
- package/dist/experimental/chat_models/ollama_functions.js +13 -16
- package/dist/experimental/generative_agents/generative_agent.cjs +30 -0
- package/dist/experimental/generative_agents/generative_agent.d.ts +30 -0
- package/dist/experimental/generative_agents/generative_agent.js +30 -0
- package/dist/experimental/generative_agents/generative_agent_memory.cjs +18 -0
- package/dist/experimental/generative_agents/generative_agent_memory.d.ts +18 -0
- package/dist/experimental/generative_agents/generative_agent_memory.js +18 -0
- package/dist/llms/base.cjs +3 -1
- package/dist/llms/base.d.ts +1 -1
- package/dist/llms/base.js +3 -1
- package/dist/llms/bedrock/web.cjs +1 -1
- package/dist/llms/bedrock/web.js +1 -1
- package/dist/llms/cohere.cjs +13 -0
- package/dist/llms/cohere.d.ts +13 -0
- package/dist/llms/cohere.js +13 -0
- package/dist/llms/googlevertexai/index.cjs +12 -0
- package/dist/llms/googlevertexai/index.d.ts +12 -0
- package/dist/llms/googlevertexai/index.js +12 -0
- package/dist/llms/googlevertexai/web.cjs +12 -0
- package/dist/llms/googlevertexai/web.d.ts +12 -0
- package/dist/llms/googlevertexai/web.js +12 -0
- package/dist/llms/hf.cjs +13 -0
- package/dist/llms/hf.d.ts +13 -0
- package/dist/llms/hf.js +13 -0
- package/dist/llms/ollama.cjs +19 -0
- package/dist/llms/ollama.d.ts +19 -0
- package/dist/llms/ollama.js +19 -0
- package/dist/llms/openai-chat.cjs +17 -0
- package/dist/llms/openai-chat.d.ts +17 -0
- package/dist/llms/openai-chat.js +17 -0
- package/dist/llms/openai.cjs +14 -0
- package/dist/llms/openai.d.ts +14 -0
- package/dist/llms/openai.js +14 -0
- package/dist/llms/portkey.cjs +24 -0
- package/dist/llms/portkey.d.ts +24 -0
- package/dist/llms/portkey.js +24 -0
- package/dist/llms/replicate.cjs +11 -0
- package/dist/llms/replicate.d.ts +11 -0
- package/dist/llms/replicate.js +11 -0
- package/dist/load/import_constants.cjs +2 -0
- package/dist/load/import_constants.js +2 -0
- package/dist/memory/buffer_memory.cjs +24 -0
- package/dist/memory/buffer_memory.d.ts +24 -0
- package/dist/memory/buffer_memory.js +24 -0
- package/dist/memory/buffer_token_memory.cjs +15 -0
- package/dist/memory/buffer_token_memory.d.ts +15 -0
- package/dist/memory/buffer_token_memory.js +15 -0
- package/dist/memory/buffer_window_memory.cjs +23 -0
- package/dist/memory/buffer_window_memory.d.ts +23 -0
- package/dist/memory/buffer_window_memory.js +23 -0
- package/dist/memory/entity_memory.cjs +29 -0
- package/dist/memory/entity_memory.d.ts +29 -0
- package/dist/memory/entity_memory.js +29 -0
- package/dist/memory/summary.cjs +24 -0
- package/dist/memory/summary.d.ts +24 -0
- package/dist/memory/summary.js +24 -0
- package/dist/memory/summary_buffer.cjs +32 -0
- package/dist/memory/summary_buffer.d.ts +32 -0
- package/dist/memory/summary_buffer.js +32 -0
- package/dist/memory/vector_store.cjs +24 -0
- package/dist/memory/vector_store.d.ts +24 -0
- package/dist/memory/vector_store.js +24 -0
- package/dist/memory/zep.cjs +34 -0
- package/dist/memory/zep.d.ts +34 -0
- package/dist/memory/zep.js +34 -0
- package/dist/prompts/chat.cjs +31 -0
- package/dist/prompts/chat.d.ts +31 -0
- package/dist/prompts/chat.js +31 -0
- package/dist/prompts/few_shot.cjs +31 -0
- package/dist/prompts/few_shot.d.ts +31 -0
- package/dist/prompts/few_shot.js +31 -0
- package/dist/prompts/pipeline.cjs +39 -0
- package/dist/prompts/pipeline.d.ts +39 -0
- package/dist/prompts/pipeline.js +39 -0
- package/dist/prompts/selectors/LengthBasedExampleSelector.cjs +36 -0
- package/dist/prompts/selectors/LengthBasedExampleSelector.d.ts +36 -0
- package/dist/prompts/selectors/LengthBasedExampleSelector.js +36 -0
- package/dist/prompts/selectors/SemanticSimilarityExampleSelector.cjs +25 -0
- package/dist/prompts/selectors/SemanticSimilarityExampleSelector.d.ts +25 -0
- package/dist/prompts/selectors/SemanticSimilarityExampleSelector.js +25 -0
- package/dist/retrievers/amazon_kendra.cjs +16 -0
- package/dist/retrievers/amazon_kendra.d.ts +16 -0
- package/dist/retrievers/amazon_kendra.js +16 -0
- package/dist/retrievers/chaindesk.cjs +11 -0
- package/dist/retrievers/chaindesk.d.ts +11 -0
- package/dist/retrievers/chaindesk.js +11 -0
- package/dist/retrievers/contextual_compression.cjs +10 -0
- package/dist/retrievers/contextual_compression.d.ts +10 -0
- package/dist/retrievers/contextual_compression.js +10 -0
- package/dist/retrievers/document_compressors/embeddings_filter.cjs +13 -0
- package/dist/retrievers/document_compressors/embeddings_filter.d.ts +13 -0
- package/dist/retrievers/document_compressors/embeddings_filter.js +13 -0
- package/dist/retrievers/document_compressors/index.cjs +26 -0
- package/dist/retrievers/document_compressors/index.d.ts +26 -0
- package/dist/retrievers/document_compressors/index.js +26 -0
- package/dist/retrievers/hyde.cjs +19 -0
- package/dist/retrievers/hyde.d.ts +19 -0
- package/dist/retrievers/hyde.js +19 -0
- package/dist/retrievers/metal.cjs +11 -0
- package/dist/retrievers/metal.d.ts +11 -0
- package/dist/retrievers/metal.js +11 -0
- package/dist/retrievers/multi_query.cjs +13 -1
- package/dist/retrievers/multi_query.d.ts +13 -0
- package/dist/retrievers/multi_query.js +13 -1
- package/dist/retrievers/multi_vector.cjs +13 -0
- package/dist/retrievers/multi_vector.d.ts +13 -0
- package/dist/retrievers/multi_vector.js +13 -0
- package/dist/retrievers/parent_document.cjs +21 -0
- package/dist/retrievers/parent_document.d.ts +21 -0
- package/dist/retrievers/parent_document.js +21 -0
- package/dist/retrievers/remote/chatgpt-plugin.cjs +10 -0
- package/dist/retrievers/remote/chatgpt-plugin.d.ts +10 -0
- package/dist/retrievers/remote/chatgpt-plugin.js +10 -0
- package/dist/retrievers/self_query/chroma.cjs +15 -0
- package/dist/retrievers/self_query/chroma.d.ts +15 -0
- package/dist/retrievers/self_query/chroma.js +15 -0
- package/dist/retrievers/self_query/functional.cjs +7 -0
- package/dist/retrievers/self_query/functional.d.ts +7 -0
- package/dist/retrievers/self_query/functional.js +7 -0
- package/dist/retrievers/self_query/index.cjs +13 -0
- package/dist/retrievers/self_query/index.d.ts +13 -0
- package/dist/retrievers/self_query/index.js +13 -0
- package/dist/retrievers/self_query/pinecone.cjs +14 -0
- package/dist/retrievers/self_query/pinecone.d.ts +14 -0
- package/dist/retrievers/self_query/pinecone.js +14 -0
- package/dist/retrievers/self_query/supabase.cjs +14 -0
- package/dist/retrievers/self_query/supabase.d.ts +14 -0
- package/dist/retrievers/self_query/supabase.js +14 -0
- package/dist/retrievers/self_query/weaviate.cjs +14 -0
- package/dist/retrievers/self_query/weaviate.d.ts +14 -0
- package/dist/retrievers/self_query/weaviate.js +14 -0
- package/dist/retrievers/time_weighted.cjs +16 -0
- package/dist/retrievers/time_weighted.d.ts +16 -0
- package/dist/retrievers/time_weighted.js +16 -0
- package/dist/retrievers/vespa.cjs +15 -0
- package/dist/retrievers/vespa.d.ts +15 -0
- package/dist/retrievers/vespa.js +15 -0
- package/dist/retrievers/zep.cjs +10 -0
- package/dist/retrievers/zep.d.ts +10 -0
- package/dist/retrievers/zep.js +10 -0
- package/dist/schema/index.d.ts +8 -6
- package/dist/schema/output_parser.cjs +15 -0
- package/dist/schema/output_parser.d.ts +15 -0
- package/dist/schema/output_parser.js +15 -0
- package/dist/schema/runnable/base.cjs +20 -0
- package/dist/schema/runnable/base.d.ts +20 -0
- package/dist/schema/runnable/base.js +20 -0
- package/dist/schema/runnable/branch.cjs +28 -0
- package/dist/schema/runnable/branch.d.ts +28 -0
- package/dist/schema/runnable/branch.js +28 -0
- package/dist/storage/file_system.cjs +21 -0
- package/dist/storage/file_system.d.ts +21 -0
- package/dist/storage/file_system.js +21 -0
- package/dist/storage/in_memory.cjs +15 -0
- package/dist/storage/in_memory.d.ts +15 -0
- package/dist/storage/in_memory.js +15 -0
- package/dist/storage/ioredis.cjs +24 -0
- package/dist/storage/ioredis.d.ts +24 -0
- package/dist/storage/ioredis.js +24 -0
- package/dist/storage/upstash_redis.cjs +19 -0
- package/dist/storage/upstash_redis.d.ts +19 -0
- package/dist/storage/upstash_redis.js +19 -0
- package/dist/storage/vercel_kv.cjs +16 -0
- package/dist/storage/vercel_kv.d.ts +16 -0
- package/dist/storage/vercel_kv.js +16 -0
- package/dist/stores/message/cassandra.cjs +25 -0
- package/dist/stores/message/cassandra.d.ts +25 -0
- package/dist/stores/message/cassandra.js +25 -0
- package/dist/stores/message/cloudflare_d1.cjs +18 -0
- package/dist/stores/message/cloudflare_d1.d.ts +18 -0
- package/dist/stores/message/cloudflare_d1.js +18 -0
- package/dist/stores/message/firestore.cjs +19 -0
- package/dist/stores/message/firestore.d.ts +19 -0
- package/dist/stores/message/firestore.js +19 -0
- package/dist/stores/message/ioredis.cjs +18 -0
- package/dist/stores/message/ioredis.d.ts +18 -0
- package/dist/stores/message/ioredis.js +18 -0
- package/dist/stores/message/momento.cjs +18 -0
- package/dist/stores/message/momento.d.ts +18 -0
- package/dist/stores/message/momento.js +18 -0
- package/dist/stores/message/mongodb.cjs +11 -0
- package/dist/stores/message/mongodb.d.ts +11 -0
- package/dist/stores/message/mongodb.js +11 -0
- package/dist/stores/message/planetscale.cjs +18 -0
- package/dist/stores/message/planetscale.d.ts +18 -0
- package/dist/stores/message/planetscale.js +18 -0
- package/dist/stores/message/redis.cjs +18 -0
- package/dist/stores/message/redis.d.ts +18 -0
- package/dist/stores/message/redis.js +18 -0
- package/dist/stores/message/xata.cjs +23 -0
- package/dist/stores/message/xata.d.ts +23 -0
- package/dist/stores/message/xata.js +23 -0
- package/dist/tools/calculator.cjs +6 -0
- package/dist/tools/calculator.d.ts +6 -0
- package/dist/tools/calculator.js +6 -0
- package/dist/tools/google_calendar/create.cjs +22 -0
- package/dist/tools/google_calendar/create.d.ts +22 -0
- package/dist/tools/google_calendar/create.js +22 -0
- package/dist/tools/google_calendar/view.cjs +20 -0
- package/dist/tools/google_calendar/view.d.ts +20 -0
- package/dist/tools/google_calendar/view.js +20 -0
- package/dist/tools/searchapi.cjs +27 -0
- package/dist/tools/searchapi.d.ts +27 -0
- package/dist/tools/searchapi.js +27 -0
- package/dist/tools/searxng_search.cjs +20 -1
- package/dist/tools/searxng_search.d.ts +20 -1
- package/dist/tools/searxng_search.js +20 -1
- package/dist/tools/webbrowser.cjs +8 -0
- package/dist/tools/webbrowser.d.ts +8 -0
- package/dist/tools/webbrowser.js +8 -0
- package/dist/tools/wikipedia_query_run.cjs +8 -0
- package/dist/tools/wikipedia_query_run.d.ts +8 -0
- package/dist/tools/wikipedia_query_run.js +8 -0
- package/dist/tools/wolframalpha.cjs +9 -0
- package/dist/tools/wolframalpha.d.ts +9 -0
- package/dist/tools/wolframalpha.js +9 -0
- package/dist/util/googlevertexai-connection.cjs +3 -9
- package/dist/util/googlevertexai-connection.js +3 -9
- package/dist/vectorstores/opensearch.cjs +2 -1
- package/dist/vectorstores/opensearch.js +2 -1
- package/dist/vectorstores/prisma.cjs +20 -2
- package/dist/vectorstores/prisma.d.ts +4 -0
- package/dist/vectorstores/prisma.js +20 -2
- package/dist/vectorstores/rockset.cjs +353 -0
- package/dist/vectorstores/rockset.d.ts +202 -0
- package/dist/vectorstores/rockset.js +347 -0
- package/package.json +24 -5
- package/vectorstores/rockset.cjs +1 -0
- package/vectorstores/rockset.d.ts +1 -0
- package/vectorstores/rockset.js +1 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { Collection } from "@rockset/client/dist/codegen/api.js";
|
|
2
|
+
import { VectorStore } from "./base.js";
|
|
3
|
+
import { Document } from "../document.js";
|
|
4
|
+
/**
|
|
5
|
+
* Generic Rockset vector storage error
|
|
6
|
+
*/
|
|
7
|
+
export class RocksetStoreError extends Error {
|
|
8
|
+
/**
|
|
9
|
+
* Constructs a RocksetStoreError
|
|
10
|
+
* @param message The error message
|
|
11
|
+
*/
|
|
12
|
+
constructor(message) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.name = this.constructor.name;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Error that is thrown when a RocksetStore function is called
|
|
19
|
+
* after `destroy()` is called (meaning the collection would be
|
|
20
|
+
* deleted).
|
|
21
|
+
*/
|
|
22
|
+
export class RocksetStoreDestroyedError extends RocksetStoreError {
|
|
23
|
+
constructor() {
|
|
24
|
+
super("The Rockset store has been destroyed");
|
|
25
|
+
this.name = this.constructor.name;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Functions to measure vector distance/similarity by.
|
|
30
|
+
* See https://rockset.com/docs/vector-functions/#vector-distance-functions
|
|
31
|
+
* @enum SimilarityMetric
|
|
32
|
+
*/
|
|
33
|
+
export const SimilarityMetric = {
|
|
34
|
+
CosineSimilarity: "COSINE_SIM",
|
|
35
|
+
EuclideanDistance: "EUCLIDEAN_DIST",
|
|
36
|
+
DotProduct: "DOT_PRODUCT",
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Exposes Rockset's vector store/search functionality
|
|
40
|
+
*/
|
|
41
|
+
export class RocksetStore extends VectorStore {
|
|
42
|
+
/**
|
|
43
|
+
* Gets a string representation of the type of this VectorStore
|
|
44
|
+
* @returns {"rockset"}
|
|
45
|
+
*/
|
|
46
|
+
_vectorstoreType() {
|
|
47
|
+
return "rockset";
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Constructs a new RocksetStore
|
|
51
|
+
* @param {Embeddings} embeddings Object used to embed queries and
|
|
52
|
+
* page content
|
|
53
|
+
* @param {RocksetLibArgs} args
|
|
54
|
+
*/
|
|
55
|
+
constructor(embeddings, args) {
|
|
56
|
+
super(embeddings, args);
|
|
57
|
+
Object.defineProperty(this, "client", {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
configurable: true,
|
|
60
|
+
writable: true,
|
|
61
|
+
value: void 0
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(this, "collectionName", {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
configurable: true,
|
|
66
|
+
writable: true,
|
|
67
|
+
value: void 0
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(this, "workspaceName", {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
configurable: true,
|
|
72
|
+
writable: true,
|
|
73
|
+
value: void 0
|
|
74
|
+
});
|
|
75
|
+
Object.defineProperty(this, "textKey", {
|
|
76
|
+
enumerable: true,
|
|
77
|
+
configurable: true,
|
|
78
|
+
writable: true,
|
|
79
|
+
value: void 0
|
|
80
|
+
});
|
|
81
|
+
Object.defineProperty(this, "embeddingKey", {
|
|
82
|
+
enumerable: true,
|
|
83
|
+
configurable: true,
|
|
84
|
+
writable: true,
|
|
85
|
+
value: void 0
|
|
86
|
+
});
|
|
87
|
+
Object.defineProperty(this, "filter", {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
configurable: true,
|
|
90
|
+
writable: true,
|
|
91
|
+
value: void 0
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(this, "_similarityMetric", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
configurable: true,
|
|
96
|
+
writable: true,
|
|
97
|
+
value: void 0
|
|
98
|
+
});
|
|
99
|
+
Object.defineProperty(this, "similarityOrder", {
|
|
100
|
+
enumerable: true,
|
|
101
|
+
configurable: true,
|
|
102
|
+
writable: true,
|
|
103
|
+
value: void 0
|
|
104
|
+
});
|
|
105
|
+
Object.defineProperty(this, "destroyed", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
configurable: true,
|
|
108
|
+
writable: true,
|
|
109
|
+
value: void 0
|
|
110
|
+
});
|
|
111
|
+
this.embeddings = embeddings;
|
|
112
|
+
this.client = args.client;
|
|
113
|
+
this.collectionName = args.collectionName;
|
|
114
|
+
this.workspaceName = args.workspaceName ?? "commons";
|
|
115
|
+
this.textKey = args.textKey ?? "text";
|
|
116
|
+
this.embeddingKey = args.embeddingKey ?? "embedding";
|
|
117
|
+
this.filter = args.filter;
|
|
118
|
+
this.similarityMetric =
|
|
119
|
+
args.similarityMetric ?? SimilarityMetric.CosineSimilarity;
|
|
120
|
+
this.setSimilarityOrder();
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Sets the object's similarity order based on what
|
|
124
|
+
* SimilarityMetric is being used
|
|
125
|
+
*/
|
|
126
|
+
setSimilarityOrder() {
|
|
127
|
+
this.checkIfDestroyed();
|
|
128
|
+
this.similarityOrder =
|
|
129
|
+
this.similarityMetric === SimilarityMetric.EuclideanDistance
|
|
130
|
+
? "ASC"
|
|
131
|
+
: "DESC";
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Embeds and adds Documents to the store.
|
|
135
|
+
* @param {Documents[]} documents The documents to store
|
|
136
|
+
* @returns {Promise<string[]?>} The _id's of the documents added
|
|
137
|
+
*/
|
|
138
|
+
async addDocuments(documents) {
|
|
139
|
+
const texts = documents.map(({ pageContent }) => pageContent);
|
|
140
|
+
return await this.addVectors(await this.embeddings.embedDocuments(texts), documents);
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Adds vectors to the store given their corresponding Documents
|
|
144
|
+
* @param {number[][]} vectors The vectors to store
|
|
145
|
+
* @param {Document[]} documents The Documents they represent
|
|
146
|
+
* @return {Promise<string[]?>} The _id's of the added documents
|
|
147
|
+
*/
|
|
148
|
+
async addVectors(vectors, documents) {
|
|
149
|
+
this.checkIfDestroyed();
|
|
150
|
+
const rocksetDocs = [];
|
|
151
|
+
for (let i = 0; i < documents.length; i += 1) {
|
|
152
|
+
const currDoc = documents[i];
|
|
153
|
+
const currVector = vectors[i];
|
|
154
|
+
rocksetDocs.push({
|
|
155
|
+
[this.textKey]: currDoc.pageContent,
|
|
156
|
+
[this.embeddingKey]: currVector,
|
|
157
|
+
...currDoc.metadata,
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
return (await this.client.documents.addDocuments(this.workspaceName, this.collectionName, {
|
|
161
|
+
data: rocksetDocs,
|
|
162
|
+
})).data?.map((docStatus) => docStatus._id || "");
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Deletes Rockset documements given their _id's
|
|
166
|
+
* @param {string[]} ids The IDS to remove documents with
|
|
167
|
+
*/
|
|
168
|
+
async delete(ids) {
|
|
169
|
+
this.checkIfDestroyed();
|
|
170
|
+
await this.client.documents.deleteDocuments(this.workspaceName, this.collectionName, {
|
|
171
|
+
data: ids.map((id) => ({ _id: id })),
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Gets the most relevant documents to a query along
|
|
176
|
+
* with their similarity score. The returned documents
|
|
177
|
+
* are ordered by similarity (most similar at the first
|
|
178
|
+
* index)
|
|
179
|
+
* @param {number[]} query The embedded query to search
|
|
180
|
+
* the store by
|
|
181
|
+
* @param {number} k The number of documents to retreive
|
|
182
|
+
* @param {string?} filter The SQL `WHERE` clause to filter by
|
|
183
|
+
*/
|
|
184
|
+
async similaritySearchVectorWithScore(query, k, filter) {
|
|
185
|
+
this.checkIfDestroyed();
|
|
186
|
+
if (filter && this.filter) {
|
|
187
|
+
throw new RocksetStoreError("cannot provide both `filter` and `this.filter`");
|
|
188
|
+
}
|
|
189
|
+
const similarityKey = "similarity";
|
|
190
|
+
const _filter = filter ?? this.filter;
|
|
191
|
+
return ((await this.client.queries.query({
|
|
192
|
+
sql: {
|
|
193
|
+
query: `
|
|
194
|
+
SELECT
|
|
195
|
+
* EXCEPT("${this.embeddingKey}"),
|
|
196
|
+
"${this.textKey}",
|
|
197
|
+
${this.similarityMetric}(:query, "${this.embeddingKey}") AS "${similarityKey}"
|
|
198
|
+
FROM
|
|
199
|
+
"${this.workspaceName}"."${this.collectionName}"
|
|
200
|
+
${_filter ? `WHERE ${_filter}` : ""}
|
|
201
|
+
ORDER BY
|
|
202
|
+
"${similarityKey}" ${this.similarityOrder}
|
|
203
|
+
LIMIT
|
|
204
|
+
${k}
|
|
205
|
+
`,
|
|
206
|
+
parameters: [
|
|
207
|
+
{
|
|
208
|
+
name: "query",
|
|
209
|
+
type: "",
|
|
210
|
+
value: `[${query.toString()}]`,
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
},
|
|
214
|
+
})).results?.map((rocksetDoc) => [
|
|
215
|
+
new Document({
|
|
216
|
+
pageContent: rocksetDoc[this.textKey],
|
|
217
|
+
metadata: (({ [this.textKey]: t, [similarityKey]: s, ...rocksetDoc }) => rocksetDoc)(rocksetDoc),
|
|
218
|
+
}),
|
|
219
|
+
rocksetDoc[similarityKey],
|
|
220
|
+
]) ?? []);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Constructs and returns a RocksetStore object given texts to store.
|
|
224
|
+
* @param {string[]} texts The texts to store
|
|
225
|
+
* @param {object[] | object} metadatas The metadatas that correspond
|
|
226
|
+
* to @param texts
|
|
227
|
+
* @param {Embeddings} embeddings The object used to embed queries
|
|
228
|
+
* and page content
|
|
229
|
+
* @param {RocksetLibArgs} dbConfig The options to be passed into the
|
|
230
|
+
* RocksetStore constructor
|
|
231
|
+
* @returns {RocksetStore}
|
|
232
|
+
*/
|
|
233
|
+
static async fromTexts(texts, metadatas, embeddings, dbConfig) {
|
|
234
|
+
const docs = [];
|
|
235
|
+
for (let i = 0; i < texts.length; i += 1) {
|
|
236
|
+
const metadata = Array.isArray(metadatas) ? metadatas[i] : metadatas;
|
|
237
|
+
const newDoc = new Document({
|
|
238
|
+
pageContent: texts[i],
|
|
239
|
+
metadata,
|
|
240
|
+
});
|
|
241
|
+
docs.push(newDoc);
|
|
242
|
+
}
|
|
243
|
+
return RocksetStore.fromDocuments(docs, embeddings, dbConfig);
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Constructs, adds docs to, and returns a RocksetStore object
|
|
247
|
+
* @param {Document[]} docs The Documents to store
|
|
248
|
+
* @param {Embeddings} embeddings The object used to embed queries
|
|
249
|
+
* and page content
|
|
250
|
+
* @param {RocksetLibArgs} dbConfig The options to be passed into the
|
|
251
|
+
* RocksetStore constructor
|
|
252
|
+
* @returns {RocksetStore}
|
|
253
|
+
*/
|
|
254
|
+
static async fromDocuments(docs, embeddings, dbConfig) {
|
|
255
|
+
const args = { ...dbConfig, textKey: dbConfig.textKey ?? "text" };
|
|
256
|
+
const instance = new this(embeddings, args);
|
|
257
|
+
await instance.addDocuments(docs);
|
|
258
|
+
return instance;
|
|
259
|
+
}
|
|
260
|
+
/**
|
|
261
|
+
* Checks if a Rockset collection exists.
|
|
262
|
+
* @param {RocksetLibArgs} dbConfig The object containing the collection
|
|
263
|
+
* and workspace names
|
|
264
|
+
* @return {boolean} whether the collection exists
|
|
265
|
+
*/
|
|
266
|
+
static async collectionExists(dbConfig) {
|
|
267
|
+
try {
|
|
268
|
+
await dbConfig.client.collections.getCollection(dbConfig.workspaceName ?? "commons", dbConfig.collectionName);
|
|
269
|
+
}
|
|
270
|
+
catch (err) {
|
|
271
|
+
if (err.message_key ===
|
|
272
|
+
"COLLECTION_DOES_NOT_EXIST") {
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
throw err;
|
|
276
|
+
}
|
|
277
|
+
return true;
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Checks whether a Rockset collection is ready to be queried.
|
|
281
|
+
* @param {RocksetLibArgs} dbConfig The object containing the collection
|
|
282
|
+
* name and workspace
|
|
283
|
+
* @return {boolean} whether the collection is ready
|
|
284
|
+
*/
|
|
285
|
+
static async collectionReady(dbConfig) {
|
|
286
|
+
return ((await dbConfig.client.collections.getCollection(dbConfig.workspaceName ?? "commons", dbConfig.collectionName)).data?.status === Collection.StatusEnum.READY);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Deletes the collection this RocksetStore uses
|
|
290
|
+
* @param {boolean?} waitUntilDeletion Whether to sleep until the
|
|
291
|
+
* collection is ready to be
|
|
292
|
+
* queried
|
|
293
|
+
*/
|
|
294
|
+
async destroy(waitUntilDeletion) {
|
|
295
|
+
await this.client.collections.deleteCollection(this.workspaceName, this.collectionName);
|
|
296
|
+
this.destroyed = true;
|
|
297
|
+
if (waitUntilDeletion) {
|
|
298
|
+
while (await RocksetStore.collectionExists({
|
|
299
|
+
collectionName: this.collectionName,
|
|
300
|
+
client: this.client,
|
|
301
|
+
}))
|
|
302
|
+
;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Checks if this RocksetStore has been destroyed.
|
|
307
|
+
* @throws {RocksetStoreDestroyederror} if it has.
|
|
308
|
+
*/
|
|
309
|
+
checkIfDestroyed() {
|
|
310
|
+
if (this.destroyed) {
|
|
311
|
+
throw new RocksetStoreDestroyedError();
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Creates a new Rockset collection and returns a RocksetStore that
|
|
316
|
+
* uses it
|
|
317
|
+
* @param {Embeddings} embeddings Object used to embed queries and
|
|
318
|
+
* page content
|
|
319
|
+
* @param {RocksetLibArgs} dbConfig The options to be passed into the
|
|
320
|
+
* RocksetStore constructor
|
|
321
|
+
* @param {CreateCollectionRequest?} collectionOptions The arguments to sent with the
|
|
322
|
+
* HTTP request when creating the
|
|
323
|
+
* collection. Setting a field mapping
|
|
324
|
+
* that `VECTOR_ENFORCE`s is recommended
|
|
325
|
+
* when using this function. See
|
|
326
|
+
* https://rockset.com/docs/vector-functions/#vector_enforce
|
|
327
|
+
* @returns {RocsketStore}
|
|
328
|
+
*/
|
|
329
|
+
static async withNewCollection(embeddings, dbConfig, collectionOptions) {
|
|
330
|
+
if (collectionOptions?.name &&
|
|
331
|
+
dbConfig.collectionName !== collectionOptions?.name) {
|
|
332
|
+
throw new RocksetStoreError("`dbConfig.name` and `collectionOptions.name` do not match");
|
|
333
|
+
}
|
|
334
|
+
await dbConfig.client.collections.createCollection(dbConfig.workspaceName ?? "commons", collectionOptions || { name: dbConfig.collectionName });
|
|
335
|
+
while (!(await this.collectionExists(dbConfig)) ||
|
|
336
|
+
!(await this.collectionReady(dbConfig)))
|
|
337
|
+
;
|
|
338
|
+
return new this(embeddings, dbConfig);
|
|
339
|
+
}
|
|
340
|
+
get similarityMetric() {
|
|
341
|
+
return this._similarityMetric;
|
|
342
|
+
}
|
|
343
|
+
set similarityMetric(metric) {
|
|
344
|
+
this._similarityMetric = metric;
|
|
345
|
+
this.setSimilarityOrder();
|
|
346
|
+
}
|
|
347
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langchain",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.193",
|
|
4
4
|
"description": "Typescript bindings for langchain",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -316,6 +316,9 @@
|
|
|
316
316
|
"vectorstores/redis.cjs",
|
|
317
317
|
"vectorstores/redis.js",
|
|
318
318
|
"vectorstores/redis.d.ts",
|
|
319
|
+
"vectorstores/rockset.cjs",
|
|
320
|
+
"vectorstores/rockset.js",
|
|
321
|
+
"vectorstores/rockset.d.ts",
|
|
319
322
|
"vectorstores/typesense.cjs",
|
|
320
323
|
"vectorstores/typesense.js",
|
|
321
324
|
"vectorstores/typesense.d.ts",
|
|
@@ -661,6 +664,9 @@
|
|
|
661
664
|
"cache/ioredis.cjs",
|
|
662
665
|
"cache/ioredis.js",
|
|
663
666
|
"cache/ioredis.d.ts",
|
|
667
|
+
"cache/file_system.cjs",
|
|
668
|
+
"cache/file_system.js",
|
|
669
|
+
"cache/file_system.d.ts",
|
|
664
670
|
"cache/upstash_redis.cjs",
|
|
665
671
|
"cache/upstash_redis.js",
|
|
666
672
|
"cache/upstash_redis.d.ts",
|
|
@@ -810,7 +816,6 @@
|
|
|
810
816
|
"build:cjs": "NODE_OPTIONS=--max-old-space-size=4096 tsc --outDir dist-cjs/ -p tsconfig.cjs.json && node scripts/move-cjs-to-dist.js && rimraf dist-cjs",
|
|
811
817
|
"build:watch": "node scripts/create-entrypoints.js && tsc --outDir dist/ --watch",
|
|
812
818
|
"build:scripts": "node scripts/create-entrypoints.js && node scripts/check-tree-shaking.js",
|
|
813
|
-
"conditional:api_refs": "bash scripts/build-api-refs.sh",
|
|
814
819
|
"lint": "NODE_OPTIONS=--max-old-space-size=4096 eslint src && dpdm --exit-code circular:1 --no-warning --no-tree src/*.ts src/**/*.ts",
|
|
815
820
|
"lint:fix": "yarn lint --fix",
|
|
816
821
|
"precommit": "lint-staged",
|
|
@@ -858,6 +863,7 @@
|
|
|
858
863
|
"@planetscale/database": "^1.8.0",
|
|
859
864
|
"@qdrant/js-client-rest": "^1.2.0",
|
|
860
865
|
"@raycast/api": "^1.55.2",
|
|
866
|
+
"@rockset/client": "^0.9.1",
|
|
861
867
|
"@smithy/eventstream-codec": "^2.0.5",
|
|
862
868
|
"@smithy/protocol-http": "^3.0.6",
|
|
863
869
|
"@smithy/signature-v4": "^2.0.10",
|
|
@@ -954,7 +960,6 @@
|
|
|
954
960
|
"sqlite3": "^5.1.4",
|
|
955
961
|
"srt-parser-2": "^1.2.2",
|
|
956
962
|
"ts-jest": "^29.1.0",
|
|
957
|
-
"ts-morph": "^20.0.0",
|
|
958
963
|
"typeorm": "^0.3.12",
|
|
959
964
|
"typescript": "^5.0.0",
|
|
960
965
|
"typesense": "^1.5.3",
|
|
@@ -995,6 +1000,7 @@
|
|
|
995
1000
|
"@planetscale/database": "^1.8.0",
|
|
996
1001
|
"@qdrant/js-client-rest": "^1.2.0",
|
|
997
1002
|
"@raycast/api": "^1.55.2",
|
|
1003
|
+
"@rockset/client": "^0.9.1",
|
|
998
1004
|
"@smithy/eventstream-codec": "^2.0.5",
|
|
999
1005
|
"@smithy/protocol-http": "^3.0.6",
|
|
1000
1006
|
"@smithy/signature-v4": "^2.0.10",
|
|
@@ -1150,6 +1156,9 @@
|
|
|
1150
1156
|
"@raycast/api": {
|
|
1151
1157
|
"optional": true
|
|
1152
1158
|
},
|
|
1159
|
+
"@rockset/client": {
|
|
1160
|
+
"optional": true
|
|
1161
|
+
},
|
|
1153
1162
|
"@smithy/eventstream-codec": {
|
|
1154
1163
|
"optional": true
|
|
1155
1164
|
},
|
|
@@ -1359,7 +1368,7 @@
|
|
|
1359
1368
|
}
|
|
1360
1369
|
},
|
|
1361
1370
|
"dependencies": {
|
|
1362
|
-
"@anthropic-ai/sdk": "^0.
|
|
1371
|
+
"@anthropic-ai/sdk": "^0.9.1",
|
|
1363
1372
|
"ansi-styles": "^5.0.0",
|
|
1364
1373
|
"binary-extensions": "^2.2.0",
|
|
1365
1374
|
"camelcase": "6",
|
|
@@ -1372,7 +1381,7 @@
|
|
|
1372
1381
|
"langchainhub": "~0.0.6",
|
|
1373
1382
|
"langsmith": "~0.0.48",
|
|
1374
1383
|
"ml-distance": "^4.0.0",
|
|
1375
|
-
"openai": "^4.
|
|
1384
|
+
"openai": "^4.19.0",
|
|
1376
1385
|
"openapi-types": "^12.1.3",
|
|
1377
1386
|
"p-queue": "^6.6.2",
|
|
1378
1387
|
"p-retry": "4",
|
|
@@ -1909,6 +1918,11 @@
|
|
|
1909
1918
|
"import": "./vectorstores/redis.js",
|
|
1910
1919
|
"require": "./vectorstores/redis.cjs"
|
|
1911
1920
|
},
|
|
1921
|
+
"./vectorstores/rockset": {
|
|
1922
|
+
"types": "./vectorstores/rockset.d.ts",
|
|
1923
|
+
"import": "./vectorstores/rockset.js",
|
|
1924
|
+
"require": "./vectorstores/rockset.cjs"
|
|
1925
|
+
},
|
|
1912
1926
|
"./vectorstores/typesense": {
|
|
1913
1927
|
"types": "./vectorstores/typesense.d.ts",
|
|
1914
1928
|
"import": "./vectorstores/typesense.js",
|
|
@@ -2484,6 +2498,11 @@
|
|
|
2484
2498
|
"import": "./cache/ioredis.js",
|
|
2485
2499
|
"require": "./cache/ioredis.cjs"
|
|
2486
2500
|
},
|
|
2501
|
+
"./cache/file_system": {
|
|
2502
|
+
"types": "./cache/file_system.d.ts",
|
|
2503
|
+
"import": "./cache/file_system.js",
|
|
2504
|
+
"require": "./cache/file_system.cjs"
|
|
2505
|
+
},
|
|
2487
2506
|
"./cache/upstash_redis": {
|
|
2488
2507
|
"types": "./cache/upstash_redis.d.ts",
|
|
2489
2508
|
"import": "./cache/upstash_redis.js",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('../dist/vectorstores/rockset.cjs');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/vectorstores/rockset.js'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../dist/vectorstores/rockset.js'
|