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
|
@@ -12,6 +12,18 @@ const common_js_1 = require("./common.cjs");
|
|
|
12
12
|
* functions where you do not have access to the file system. It supports passing
|
|
13
13
|
* service account credentials directly as a "GOOGLE_VERTEX_AI_WEB_CREDENTIALS"
|
|
14
14
|
* environment variable or directly as "authOptions.credentials".
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const model = new GoogleVertexAI({
|
|
18
|
+
* temperature: 0.7,
|
|
19
|
+
* });
|
|
20
|
+
* const stream = await model.stream(
|
|
21
|
+
* "What would be a good company name for a company that makes colorful socks?",
|
|
22
|
+
* );
|
|
23
|
+
* for await (const chunk of stream) {
|
|
24
|
+
* console.log(chunk);
|
|
25
|
+
* }
|
|
26
|
+
* ```
|
|
15
27
|
*/
|
|
16
28
|
class GoogleVertexAI extends common_js_1.BaseGoogleVertexAI {
|
|
17
29
|
static lc_name() {
|
|
@@ -14,6 +14,18 @@ export interface GoogleVertexAITextInput extends GoogleVertexAIBaseLLMInput<WebG
|
|
|
14
14
|
* functions where you do not have access to the file system. It supports passing
|
|
15
15
|
* service account credentials directly as a "GOOGLE_VERTEX_AI_WEB_CREDENTIALS"
|
|
16
16
|
* environment variable or directly as "authOptions.credentials".
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const model = new GoogleVertexAI({
|
|
20
|
+
* temperature: 0.7,
|
|
21
|
+
* });
|
|
22
|
+
* const stream = await model.stream(
|
|
23
|
+
* "What would be a good company name for a company that makes colorful socks?",
|
|
24
|
+
* );
|
|
25
|
+
* for await (const chunk of stream) {
|
|
26
|
+
* console.log(chunk);
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
17
29
|
*/
|
|
18
30
|
export declare class GoogleVertexAI extends BaseGoogleVertexAI<WebGoogleAuthOptions> {
|
|
19
31
|
static lc_name(): string;
|
|
@@ -9,6 +9,18 @@ import { BaseGoogleVertexAI } from "./common.js";
|
|
|
9
9
|
* functions where you do not have access to the file system. It supports passing
|
|
10
10
|
* service account credentials directly as a "GOOGLE_VERTEX_AI_WEB_CREDENTIALS"
|
|
11
11
|
* environment variable or directly as "authOptions.credentials".
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const model = new GoogleVertexAI({
|
|
15
|
+
* temperature: 0.7,
|
|
16
|
+
* });
|
|
17
|
+
* const stream = await model.stream(
|
|
18
|
+
* "What would be a good company name for a company that makes colorful socks?",
|
|
19
|
+
* );
|
|
20
|
+
* for await (const chunk of stream) {
|
|
21
|
+
* console.log(chunk);
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
12
24
|
*/
|
|
13
25
|
export class GoogleVertexAI extends BaseGoogleVertexAI {
|
|
14
26
|
static lc_name() {
|
package/dist/llms/hf.cjs
CHANGED
|
@@ -6,6 +6,19 @@ const base_js_1 = require("./base.cjs");
|
|
|
6
6
|
/**
|
|
7
7
|
* Class implementing the Large Language Model (LLM) interface using the
|
|
8
8
|
* Hugging Face Inference API for text generation.
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const model = new HuggingFaceInference({
|
|
12
|
+
* model: "gpt2",
|
|
13
|
+
* temperature: 0.7,
|
|
14
|
+
* maxTokens: 50,
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* const res = await model.call(
|
|
18
|
+
* "Question: What would be a good company name for a company that makes colorful socks?\nAnswer:"
|
|
19
|
+
* );
|
|
20
|
+
* console.log({ res });
|
|
21
|
+
* ```
|
|
9
22
|
*/
|
|
10
23
|
class HuggingFaceInference extends base_js_1.LLM {
|
|
11
24
|
get lc_secrets() {
|
package/dist/llms/hf.d.ts
CHANGED
|
@@ -26,6 +26,19 @@ export interface HFInput {
|
|
|
26
26
|
/**
|
|
27
27
|
* Class implementing the Large Language Model (LLM) interface using the
|
|
28
28
|
* Hugging Face Inference API for text generation.
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const model = new HuggingFaceInference({
|
|
32
|
+
* model: "gpt2",
|
|
33
|
+
* temperature: 0.7,
|
|
34
|
+
* maxTokens: 50,
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* const res = await model.call(
|
|
38
|
+
* "Question: What would be a good company name for a company that makes colorful socks?\nAnswer:"
|
|
39
|
+
* );
|
|
40
|
+
* console.log({ res });
|
|
41
|
+
* ```
|
|
29
42
|
*/
|
|
30
43
|
export declare class HuggingFaceInference extends LLM implements HFInput {
|
|
31
44
|
get lc_secrets(): {
|
package/dist/llms/hf.js
CHANGED
|
@@ -3,6 +3,19 @@ import { LLM } from "./base.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* Class implementing the Large Language Model (LLM) interface using the
|
|
5
5
|
* Hugging Face Inference API for text generation.
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const model = new HuggingFaceInference({
|
|
9
|
+
* model: "gpt2",
|
|
10
|
+
* temperature: 0.7,
|
|
11
|
+
* maxTokens: 50,
|
|
12
|
+
* });
|
|
13
|
+
*
|
|
14
|
+
* const res = await model.call(
|
|
15
|
+
* "Question: What would be a good company name for a company that makes colorful socks?\nAnswer:"
|
|
16
|
+
* );
|
|
17
|
+
* console.log({ res });
|
|
18
|
+
* ```
|
|
6
19
|
*/
|
|
7
20
|
export class HuggingFaceInference extends LLM {
|
|
8
21
|
get lc_secrets() {
|
package/dist/llms/ollama.cjs
CHANGED
|
@@ -7,6 +7,25 @@ const index_js_1 = require("../schema/index.cjs");
|
|
|
7
7
|
/**
|
|
8
8
|
* Class that represents the Ollama language model. It extends the base
|
|
9
9
|
* LLM class and implements the OllamaInput interface.
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const ollama = new Ollama({
|
|
13
|
+
* baseUrl: "http://api.example.com",
|
|
14
|
+
* model: "llama2",
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* // Streaming translation from English to German
|
|
18
|
+
* const stream = await ollama.stream(
|
|
19
|
+
* `Translate "I love programming" into German.`
|
|
20
|
+
* );
|
|
21
|
+
*
|
|
22
|
+
* const chunks = [];
|
|
23
|
+
* for await (const chunk of stream) {
|
|
24
|
+
* chunks.push(chunk);
|
|
25
|
+
* }
|
|
26
|
+
*
|
|
27
|
+
* console.log(chunks.join(""));
|
|
28
|
+
* ```
|
|
10
29
|
*/
|
|
11
30
|
class Ollama extends base_js_1.LLM {
|
|
12
31
|
static lc_name() {
|
package/dist/llms/ollama.d.ts
CHANGED
|
@@ -6,6 +6,25 @@ import type { StringWithAutocomplete } from "../util/types.js";
|
|
|
6
6
|
/**
|
|
7
7
|
* Class that represents the Ollama language model. It extends the base
|
|
8
8
|
* LLM class and implements the OllamaInput interface.
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const ollama = new Ollama({
|
|
12
|
+
* baseUrl: "http://api.example.com",
|
|
13
|
+
* model: "llama2",
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* // Streaming translation from English to German
|
|
17
|
+
* const stream = await ollama.stream(
|
|
18
|
+
* `Translate "I love programming" into German.`
|
|
19
|
+
* );
|
|
20
|
+
*
|
|
21
|
+
* const chunks = [];
|
|
22
|
+
* for await (const chunk of stream) {
|
|
23
|
+
* chunks.push(chunk);
|
|
24
|
+
* }
|
|
25
|
+
*
|
|
26
|
+
* console.log(chunks.join(""));
|
|
27
|
+
* ```
|
|
9
28
|
*/
|
|
10
29
|
export declare class Ollama extends LLM<OllamaCallOptions> implements OllamaInput {
|
|
11
30
|
static lc_name(): string;
|
package/dist/llms/ollama.js
CHANGED
|
@@ -4,6 +4,25 @@ import { GenerationChunk } from "../schema/index.js";
|
|
|
4
4
|
/**
|
|
5
5
|
* Class that represents the Ollama language model. It extends the base
|
|
6
6
|
* LLM class and implements the OllamaInput interface.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const ollama = new Ollama({
|
|
10
|
+
* baseUrl: "http://api.example.com",
|
|
11
|
+
* model: "llama2",
|
|
12
|
+
* });
|
|
13
|
+
*
|
|
14
|
+
* // Streaming translation from English to German
|
|
15
|
+
* const stream = await ollama.stream(
|
|
16
|
+
* `Translate "I love programming" into German.`
|
|
17
|
+
* );
|
|
18
|
+
*
|
|
19
|
+
* const chunks = [];
|
|
20
|
+
* for await (const chunk of stream) {
|
|
21
|
+
* chunks.push(chunk);
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* console.log(chunks.join(""));
|
|
25
|
+
* ```
|
|
7
26
|
*/
|
|
8
27
|
export class Ollama extends LLM {
|
|
9
28
|
static lc_name() {
|
|
@@ -29,6 +29,23 @@ const openai_js_1 = require("../util/openai.cjs");
|
|
|
29
29
|
* @augments BaseLLM
|
|
30
30
|
* @augments OpenAIInput
|
|
31
31
|
* @augments AzureOpenAIChatInput
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const model = new OpenAIChat({
|
|
35
|
+
* prefixMessages: [
|
|
36
|
+
* {
|
|
37
|
+
* role: "system",
|
|
38
|
+
* content: "You are a helpful assistant that answers in pirate language",
|
|
39
|
+
* },
|
|
40
|
+
* ],
|
|
41
|
+
* maxTokens: 50,
|
|
42
|
+
* });
|
|
43
|
+
*
|
|
44
|
+
* const res = await model.call(
|
|
45
|
+
* "What would be a good company name for a company that makes colorful socks?"
|
|
46
|
+
* );
|
|
47
|
+
* console.log({ res });
|
|
48
|
+
* ```
|
|
32
49
|
*/
|
|
33
50
|
class OpenAIChat extends base_js_1.LLM {
|
|
34
51
|
static lc_name() {
|
|
@@ -33,6 +33,23 @@ export interface OpenAIChatCallOptions extends OpenAICallOptions {
|
|
|
33
33
|
* @augments BaseLLM
|
|
34
34
|
* @augments OpenAIInput
|
|
35
35
|
* @augments AzureOpenAIChatInput
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const model = new OpenAIChat({
|
|
39
|
+
* prefixMessages: [
|
|
40
|
+
* {
|
|
41
|
+
* role: "system",
|
|
42
|
+
* content: "You are a helpful assistant that answers in pirate language",
|
|
43
|
+
* },
|
|
44
|
+
* ],
|
|
45
|
+
* maxTokens: 50,
|
|
46
|
+
* });
|
|
47
|
+
*
|
|
48
|
+
* const res = await model.call(
|
|
49
|
+
* "What would be a good company name for a company that makes colorful socks?"
|
|
50
|
+
* );
|
|
51
|
+
* console.log({ res });
|
|
52
|
+
* ```
|
|
36
53
|
*/
|
|
37
54
|
export declare class OpenAIChat extends LLM<OpenAIChatCallOptions> implements OpenAIChatInput, AzureOpenAIInput {
|
|
38
55
|
static lc_name(): string;
|
package/dist/llms/openai-chat.js
CHANGED
|
@@ -26,6 +26,23 @@ import { wrapOpenAIClientError } from "../util/openai.js";
|
|
|
26
26
|
* @augments BaseLLM
|
|
27
27
|
* @augments OpenAIInput
|
|
28
28
|
* @augments AzureOpenAIChatInput
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const model = new OpenAIChat({
|
|
32
|
+
* prefixMessages: [
|
|
33
|
+
* {
|
|
34
|
+
* role: "system",
|
|
35
|
+
* content: "You are a helpful assistant that answers in pirate language",
|
|
36
|
+
* },
|
|
37
|
+
* ],
|
|
38
|
+
* maxTokens: 50,
|
|
39
|
+
* });
|
|
40
|
+
*
|
|
41
|
+
* const res = await model.call(
|
|
42
|
+
* "What would be a good company name for a company that makes colorful socks?"
|
|
43
|
+
* );
|
|
44
|
+
* console.log({ res });
|
|
45
|
+
* ```
|
|
29
46
|
*/
|
|
30
47
|
export class OpenAIChat extends LLM {
|
|
31
48
|
static lc_name() {
|
package/dist/llms/openai.cjs
CHANGED
|
@@ -28,6 +28,20 @@ const openai_js_1 = require("../util/openai.cjs");
|
|
|
28
28
|
* https://platform.openai.com/docs/api-reference/completions/create |
|
|
29
29
|
* `openai.createCompletion`} can be passed through {@link modelKwargs}, even
|
|
30
30
|
* if not explicitly available on this class.
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const model = new OpenAI({
|
|
34
|
+
* modelName: "gpt-4",
|
|
35
|
+
* temperature: 0.7,
|
|
36
|
+
* maxTokens: 1000,
|
|
37
|
+
* maxRetries: 5,
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* const res = await model.call(
|
|
41
|
+
* "Question: What would be a good company name for a company that makes colorful socks?\nAnswer:"
|
|
42
|
+
* );
|
|
43
|
+
* console.log({ res });
|
|
44
|
+
* ```
|
|
31
45
|
*/
|
|
32
46
|
class OpenAI extends base_js_1.BaseLLM {
|
|
33
47
|
static lc_name() {
|
package/dist/llms/openai.d.ts
CHANGED
|
@@ -21,6 +21,20 @@ export type { AzureOpenAIInput, OpenAICallOptions, OpenAIInput };
|
|
|
21
21
|
* https://platform.openai.com/docs/api-reference/completions/create |
|
|
22
22
|
* `openai.createCompletion`} can be passed through {@link modelKwargs}, even
|
|
23
23
|
* if not explicitly available on this class.
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const model = new OpenAI({
|
|
27
|
+
* modelName: "gpt-4",
|
|
28
|
+
* temperature: 0.7,
|
|
29
|
+
* maxTokens: 1000,
|
|
30
|
+
* maxRetries: 5,
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* const res = await model.call(
|
|
34
|
+
* "Question: What would be a good company name for a company that makes colorful socks?\nAnswer:"
|
|
35
|
+
* );
|
|
36
|
+
* console.log({ res });
|
|
37
|
+
* ```
|
|
24
38
|
*/
|
|
25
39
|
export declare class OpenAI<CallOptions extends OpenAICallOptions = OpenAICallOptions> extends BaseLLM<CallOptions> implements OpenAIInput, AzureOpenAIInput {
|
|
26
40
|
static lc_name(): string;
|
package/dist/llms/openai.js
CHANGED
|
@@ -25,6 +25,20 @@ import { wrapOpenAIClientError } from "../util/openai.js";
|
|
|
25
25
|
* https://platform.openai.com/docs/api-reference/completions/create |
|
|
26
26
|
* `openai.createCompletion`} can be passed through {@link modelKwargs}, even
|
|
27
27
|
* if not explicitly available on this class.
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const model = new OpenAI({
|
|
31
|
+
* modelName: "gpt-4",
|
|
32
|
+
* temperature: 0.7,
|
|
33
|
+
* maxTokens: 1000,
|
|
34
|
+
* maxRetries: 5,
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* const res = await model.call(
|
|
38
|
+
* "Question: What would be a good company name for a company that makes colorful socks?\nAnswer:"
|
|
39
|
+
* );
|
|
40
|
+
* console.log({ res });
|
|
41
|
+
* ```
|
|
28
42
|
*/
|
|
29
43
|
export class OpenAI extends BaseLLM {
|
|
30
44
|
static lc_name() {
|
package/dist/llms/portkey.cjs
CHANGED
|
@@ -51,6 +51,30 @@ function getPortkeySession(options = {}) {
|
|
|
51
51
|
return session;
|
|
52
52
|
}
|
|
53
53
|
exports.getPortkeySession = getPortkeySession;
|
|
54
|
+
/**
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* const model = new Portkey({
|
|
58
|
+
* mode: "single",
|
|
59
|
+
* llms: [
|
|
60
|
+
* {
|
|
61
|
+
* provider: "openai",
|
|
62
|
+
* virtual_key: "open-ai-key-1234",
|
|
63
|
+
* model: "text-davinci-003",
|
|
64
|
+
* max_tokens: 2000,
|
|
65
|
+
* },
|
|
66
|
+
* ],
|
|
67
|
+
* });
|
|
68
|
+
*
|
|
69
|
+
* // Stream the output of the model and process it
|
|
70
|
+
* const res = await model.stream(
|
|
71
|
+
* "Question: Write a story about a king\nAnswer:"
|
|
72
|
+
* );
|
|
73
|
+
* for await (const i of res) {
|
|
74
|
+
* process.stdout.write(i);
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
54
78
|
class Portkey extends base_js_1.BaseLLM {
|
|
55
79
|
constructor(init) {
|
|
56
80
|
super(init ?? {});
|
package/dist/llms/portkey.d.ts
CHANGED
|
@@ -19,6 +19,30 @@ export declare class PortkeySession {
|
|
|
19
19
|
* @returns
|
|
20
20
|
*/
|
|
21
21
|
export declare function getPortkeySession(options?: PortkeyOptions): PortkeySession;
|
|
22
|
+
/**
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const model = new Portkey({
|
|
26
|
+
* mode: "single",
|
|
27
|
+
* llms: [
|
|
28
|
+
* {
|
|
29
|
+
* provider: "openai",
|
|
30
|
+
* virtual_key: "open-ai-key-1234",
|
|
31
|
+
* model: "text-davinci-003",
|
|
32
|
+
* max_tokens: 2000,
|
|
33
|
+
* },
|
|
34
|
+
* ],
|
|
35
|
+
* });
|
|
36
|
+
*
|
|
37
|
+
* // Stream the output of the model and process it
|
|
38
|
+
* const res = await model.stream(
|
|
39
|
+
* "Question: Write a story about a king\nAnswer:"
|
|
40
|
+
* );
|
|
41
|
+
* for await (const i of res) {
|
|
42
|
+
* process.stdout.write(i);
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
22
46
|
export declare class Portkey extends BaseLLM {
|
|
23
47
|
apiKey?: string;
|
|
24
48
|
baseURL?: string;
|
package/dist/llms/portkey.js
CHANGED
|
@@ -43,6 +43,30 @@ export function getPortkeySession(options = {}) {
|
|
|
43
43
|
}
|
|
44
44
|
return session;
|
|
45
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const model = new Portkey({
|
|
50
|
+
* mode: "single",
|
|
51
|
+
* llms: [
|
|
52
|
+
* {
|
|
53
|
+
* provider: "openai",
|
|
54
|
+
* virtual_key: "open-ai-key-1234",
|
|
55
|
+
* model: "text-davinci-003",
|
|
56
|
+
* max_tokens: 2000,
|
|
57
|
+
* },
|
|
58
|
+
* ],
|
|
59
|
+
* });
|
|
60
|
+
*
|
|
61
|
+
* // Stream the output of the model and process it
|
|
62
|
+
* const res = await model.stream(
|
|
63
|
+
* "Question: Write a story about a king\nAnswer:"
|
|
64
|
+
* );
|
|
65
|
+
* for await (const i of res) {
|
|
66
|
+
* process.stdout.write(i);
|
|
67
|
+
* }
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
46
70
|
export class Portkey extends BaseLLM {
|
|
47
71
|
constructor(init) {
|
|
48
72
|
super(init ?? {});
|
package/dist/llms/replicate.cjs
CHANGED
|
@@ -8,6 +8,17 @@ const base_js_1 = require("./base.cjs");
|
|
|
8
8
|
* It handles the API key and model details, makes the actual API calls,
|
|
9
9
|
* and converts the API response into a format usable by the rest of the
|
|
10
10
|
* LangChain framework.
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const model = new Replicate({
|
|
14
|
+
* model: "replicate/flan-t5-xl:3ae0799123a1fe11f8c89fd99632f843fc5f7a761630160521c4253149754523",
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* const res = await model.call(
|
|
18
|
+
* "Question: What would be a good company name for a company that makes colorful socks?\nAnswer:"
|
|
19
|
+
* );
|
|
20
|
+
* console.log({ res });
|
|
21
|
+
* ```
|
|
11
22
|
*/
|
|
12
23
|
class Replicate extends base_js_1.LLM {
|
|
13
24
|
static lc_name() {
|
package/dist/llms/replicate.d.ts
CHANGED
|
@@ -18,6 +18,17 @@ export interface ReplicateInput {
|
|
|
18
18
|
* It handles the API key and model details, makes the actual API calls,
|
|
19
19
|
* and converts the API response into a format usable by the rest of the
|
|
20
20
|
* LangChain framework.
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const model = new Replicate({
|
|
24
|
+
* model: "replicate/flan-t5-xl:3ae0799123a1fe11f8c89fd99632f843fc5f7a761630160521c4253149754523",
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* const res = await model.call(
|
|
28
|
+
* "Question: What would be a good company name for a company that makes colorful socks?\nAnswer:"
|
|
29
|
+
* );
|
|
30
|
+
* console.log({ res });
|
|
31
|
+
* ```
|
|
21
32
|
*/
|
|
22
33
|
export declare class Replicate extends LLM implements ReplicateInput {
|
|
23
34
|
static lc_name(): string;
|
package/dist/llms/replicate.js
CHANGED
|
@@ -5,6 +5,17 @@ import { LLM } from "./base.js";
|
|
|
5
5
|
* It handles the API key and model details, makes the actual API calls,
|
|
6
6
|
* and converts the API response into a format usable by the rest of the
|
|
7
7
|
* LangChain framework.
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const model = new Replicate({
|
|
11
|
+
* model: "replicate/flan-t5-xl:3ae0799123a1fe11f8c89fd99632f843fc5f7a761630160521c4253149754523",
|
|
12
|
+
* });
|
|
13
|
+
*
|
|
14
|
+
* const res = await model.call(
|
|
15
|
+
* "Question: What would be a good company name for a company that makes colorful socks?\nAnswer:"
|
|
16
|
+
* );
|
|
17
|
+
* console.log({ res });
|
|
18
|
+
* ```
|
|
8
19
|
*/
|
|
9
20
|
export class Replicate extends LLM {
|
|
10
21
|
static lc_name() {
|
|
@@ -67,6 +67,7 @@ exports.optionalImportEntrypoints = [
|
|
|
67
67
|
"langchain/vectorstores/typeorm",
|
|
68
68
|
"langchain/vectorstores/myscale",
|
|
69
69
|
"langchain/vectorstores/redis",
|
|
70
|
+
"langchain/vectorstores/rockset",
|
|
70
71
|
"langchain/vectorstores/typesense",
|
|
71
72
|
"langchain/vectorstores/singlestore",
|
|
72
73
|
"langchain/vectorstores/tigris",
|
|
@@ -136,6 +137,7 @@ exports.optionalImportEntrypoints = [
|
|
|
136
137
|
"langchain/cache/momento",
|
|
137
138
|
"langchain/cache/redis",
|
|
138
139
|
"langchain/cache/ioredis",
|
|
140
|
+
"langchain/cache/file_system",
|
|
139
141
|
"langchain/cache/upstash_redis",
|
|
140
142
|
"langchain/stores/doc/gcs",
|
|
141
143
|
"langchain/stores/file/node",
|
|
@@ -64,6 +64,7 @@ export const optionalImportEntrypoints = [
|
|
|
64
64
|
"langchain/vectorstores/typeorm",
|
|
65
65
|
"langchain/vectorstores/myscale",
|
|
66
66
|
"langchain/vectorstores/redis",
|
|
67
|
+
"langchain/vectorstores/rockset",
|
|
67
68
|
"langchain/vectorstores/typesense",
|
|
68
69
|
"langchain/vectorstores/singlestore",
|
|
69
70
|
"langchain/vectorstores/tigris",
|
|
@@ -133,6 +134,7 @@ export const optionalImportEntrypoints = [
|
|
|
133
134
|
"langchain/cache/momento",
|
|
134
135
|
"langchain/cache/redis",
|
|
135
136
|
"langchain/cache/ioredis",
|
|
137
|
+
"langchain/cache/file_system",
|
|
136
138
|
"langchain/cache/upstash_redis",
|
|
137
139
|
"langchain/stores/doc/gcs",
|
|
138
140
|
"langchain/stores/file/node",
|
|
@@ -14,6 +14,30 @@ const chat_memory_js_1 = require("./chat_memory.cjs");
|
|
|
14
14
|
* two different chains. If you deploy your LangChain app on a serverless
|
|
15
15
|
* environment, do not store memory instances in a variable, as your
|
|
16
16
|
* hosting provider may reset it by the next time the function is called.
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* // Initialize the memory to store chat history and set up the language model with a specific temperature.
|
|
20
|
+
* const memory = new BufferMemory({ memoryKey: "chat_history" });
|
|
21
|
+
* const model = new ChatOpenAI({ temperature: 0.9 });
|
|
22
|
+
*
|
|
23
|
+
* // Create a prompt template for a friendly conversation between a human and an AI.
|
|
24
|
+
* const prompt =
|
|
25
|
+
* PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.
|
|
26
|
+
*
|
|
27
|
+
* Current conversation:
|
|
28
|
+
* {chat_history}
|
|
29
|
+
* Human: {input}
|
|
30
|
+
* AI:`);
|
|
31
|
+
*
|
|
32
|
+
* // Set up the chain with the language model, prompt, and memory.
|
|
33
|
+
* const chain = new LLMChain({ llm: model, prompt, memory });
|
|
34
|
+
*
|
|
35
|
+
* // Example usage of the chain to continue the conversation.
|
|
36
|
+
* // The `call` method sends the input to the model and returns the AI's response.
|
|
37
|
+
* const res = await chain.call({ input: "Hi! I'm Jim." });
|
|
38
|
+
* console.log({ res });
|
|
39
|
+
*
|
|
40
|
+
* ```
|
|
17
41
|
*/
|
|
18
42
|
class BufferMemory extends chat_memory_js_1.BaseChatMemory {
|
|
19
43
|
constructor(fields) {
|
|
@@ -19,6 +19,30 @@ export interface BufferMemoryInput extends BaseChatMemoryInput {
|
|
|
19
19
|
* two different chains. If you deploy your LangChain app on a serverless
|
|
20
20
|
* environment, do not store memory instances in a variable, as your
|
|
21
21
|
* hosting provider may reset it by the next time the function is called.
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // Initialize the memory to store chat history and set up the language model with a specific temperature.
|
|
25
|
+
* const memory = new BufferMemory({ memoryKey: "chat_history" });
|
|
26
|
+
* const model = new ChatOpenAI({ temperature: 0.9 });
|
|
27
|
+
*
|
|
28
|
+
* // Create a prompt template for a friendly conversation between a human and an AI.
|
|
29
|
+
* const prompt =
|
|
30
|
+
* PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.
|
|
31
|
+
*
|
|
32
|
+
* Current conversation:
|
|
33
|
+
* {chat_history}
|
|
34
|
+
* Human: {input}
|
|
35
|
+
* AI:`);
|
|
36
|
+
*
|
|
37
|
+
* // Set up the chain with the language model, prompt, and memory.
|
|
38
|
+
* const chain = new LLMChain({ llm: model, prompt, memory });
|
|
39
|
+
*
|
|
40
|
+
* // Example usage of the chain to continue the conversation.
|
|
41
|
+
* // The `call` method sends the input to the model and returns the AI's response.
|
|
42
|
+
* const res = await chain.call({ input: "Hi! I'm Jim." });
|
|
43
|
+
* console.log({ res });
|
|
44
|
+
*
|
|
45
|
+
* ```
|
|
22
46
|
*/
|
|
23
47
|
export declare class BufferMemory extends BaseChatMemory implements BufferMemoryInput {
|
|
24
48
|
humanPrefix: string;
|
|
@@ -11,6 +11,30 @@ import { BaseChatMemory } from "./chat_memory.js";
|
|
|
11
11
|
* two different chains. If you deploy your LangChain app on a serverless
|
|
12
12
|
* environment, do not store memory instances in a variable, as your
|
|
13
13
|
* hosting provider may reset it by the next time the function is called.
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Initialize the memory to store chat history and set up the language model with a specific temperature.
|
|
17
|
+
* const memory = new BufferMemory({ memoryKey: "chat_history" });
|
|
18
|
+
* const model = new ChatOpenAI({ temperature: 0.9 });
|
|
19
|
+
*
|
|
20
|
+
* // Create a prompt template for a friendly conversation between a human and an AI.
|
|
21
|
+
* const prompt =
|
|
22
|
+
* PromptTemplate.fromTemplate(`The following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.
|
|
23
|
+
*
|
|
24
|
+
* Current conversation:
|
|
25
|
+
* {chat_history}
|
|
26
|
+
* Human: {input}
|
|
27
|
+
* AI:`);
|
|
28
|
+
*
|
|
29
|
+
* // Set up the chain with the language model, prompt, and memory.
|
|
30
|
+
* const chain = new LLMChain({ llm: model, prompt, memory });
|
|
31
|
+
*
|
|
32
|
+
* // Example usage of the chain to continue the conversation.
|
|
33
|
+
* // The `call` method sends the input to the model and returns the AI's response.
|
|
34
|
+
* const res = await chain.call({ input: "Hi! I'm Jim." });
|
|
35
|
+
* console.log({ res });
|
|
36
|
+
*
|
|
37
|
+
* ```
|
|
14
38
|
*/
|
|
15
39
|
export class BufferMemory extends BaseChatMemory {
|
|
16
40
|
constructor(fields) {
|
|
@@ -7,6 +7,21 @@ const chat_memory_js_1 = require("./chat_memory.cjs");
|
|
|
7
7
|
* Class that represents a conversation chat memory with a token buffer.
|
|
8
8
|
* It extends the `BaseChatMemory` class and implements the
|
|
9
9
|
* `ConversationTokenBufferMemoryInput` interface.
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const memory = new ConversationTokenBufferMemory({
|
|
13
|
+
* llm: new ChatOpenAI({}),
|
|
14
|
+
* maxTokenLimit: 10,
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* // Save conversation context
|
|
18
|
+
* await memory.saveContext({ input: "hi" }, { output: "whats up" });
|
|
19
|
+
* await memory.saveContext({ input: "not much you" }, { output: "not much" });
|
|
20
|
+
*
|
|
21
|
+
* // Load memory variables
|
|
22
|
+
* const result = await memory.loadMemoryVariables({});
|
|
23
|
+
* console.log(result);
|
|
24
|
+
* ```
|
|
10
25
|
*/
|
|
11
26
|
class ConversationTokenBufferMemory extends chat_memory_js_1.BaseChatMemory {
|
|
12
27
|
constructor(fields) {
|
|
@@ -15,6 +15,21 @@ export interface ConversationTokenBufferMemoryInput extends BaseChatMemoryInput
|
|
|
15
15
|
* Class that represents a conversation chat memory with a token buffer.
|
|
16
16
|
* It extends the `BaseChatMemory` class and implements the
|
|
17
17
|
* `ConversationTokenBufferMemoryInput` interface.
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const memory = new ConversationTokenBufferMemory({
|
|
21
|
+
* llm: new ChatOpenAI({}),
|
|
22
|
+
* maxTokenLimit: 10,
|
|
23
|
+
* });
|
|
24
|
+
*
|
|
25
|
+
* // Save conversation context
|
|
26
|
+
* await memory.saveContext({ input: "hi" }, { output: "whats up" });
|
|
27
|
+
* await memory.saveContext({ input: "not much you" }, { output: "not much" });
|
|
28
|
+
*
|
|
29
|
+
* // Load memory variables
|
|
30
|
+
* const result = await memory.loadMemoryVariables({});
|
|
31
|
+
* console.log(result);
|
|
32
|
+
* ```
|
|
18
33
|
*/
|
|
19
34
|
export declare class ConversationTokenBufferMemory extends BaseChatMemory implements ConversationTokenBufferMemoryInput {
|
|
20
35
|
humanPrefix: string;
|