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
|
@@ -13,6 +13,21 @@ export interface ChatCloudflareWorkersAICallOptions extends BaseLanguageModelCal
|
|
|
13
13
|
* A class that enables calls to the Cloudflare Workers AI API to access large language
|
|
14
14
|
* models in a chat-like fashion. It extends the SimpleChatModel class and
|
|
15
15
|
* implements the CloudflareWorkersAIInput interface.
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const model = new ChatCloudflareWorkersAI({
|
|
19
|
+
* model: "@cf/meta/llama-2-7b-chat-int8",
|
|
20
|
+
* cloudflareAccountId: process.env.CLOUDFLARE_ACCOUNT_ID,
|
|
21
|
+
* cloudflareApiToken: process.env.CLOUDFLARE_API_TOKEN
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* const response = await model.invoke([
|
|
25
|
+
* ["system", "You are a helpful assistant that translates English to German."],
|
|
26
|
+
* ["human", `Translate "I love programming".`]
|
|
27
|
+
* ]);
|
|
28
|
+
*
|
|
29
|
+
* console.log(response);
|
|
30
|
+
* ```
|
|
16
31
|
*/
|
|
17
32
|
export declare class ChatCloudflareWorkersAI extends SimpleChatModel implements CloudflareWorkersAIInput {
|
|
18
33
|
static lc_name(): string;
|
|
@@ -6,6 +6,21 @@ import { convertEventStreamToIterableReadableDataStream } from "../util/event-so
|
|
|
6
6
|
* A class that enables calls to the Cloudflare Workers AI API to access large language
|
|
7
7
|
* models in a chat-like fashion. It extends the SimpleChatModel class and
|
|
8
8
|
* implements the CloudflareWorkersAIInput interface.
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const model = new ChatCloudflareWorkersAI({
|
|
12
|
+
* model: "@cf/meta/llama-2-7b-chat-int8",
|
|
13
|
+
* cloudflareAccountId: process.env.CLOUDFLARE_ACCOUNT_ID,
|
|
14
|
+
* cloudflareApiToken: process.env.CLOUDFLARE_API_TOKEN
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* const response = await model.invoke([
|
|
18
|
+
* ["system", "You are a helpful assistant that translates English to German."],
|
|
19
|
+
* ["human", `Translate "I love programming".`]
|
|
20
|
+
* ]);
|
|
21
|
+
*
|
|
22
|
+
* console.log(response);
|
|
23
|
+
* ```
|
|
9
24
|
*/
|
|
10
25
|
export class ChatCloudflareWorkersAI extends SimpleChatModel {
|
|
11
26
|
static lc_name() {
|
|
@@ -6,6 +6,22 @@ const index_js_1 = require("../schema/index.cjs");
|
|
|
6
6
|
/**
|
|
7
7
|
* A fake Chat Model that returns a predefined list of responses. It can be used
|
|
8
8
|
* for testing purposes.
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const chat = new FakeListChatModel({
|
|
12
|
+
* responses: ["I'll callback later.", "You 'console' them!"]
|
|
13
|
+
* });
|
|
14
|
+
*
|
|
15
|
+
* const firstMessage = new HumanMessage("You want to hear a JavaScript joke?");
|
|
16
|
+
* const secondMessage = new HumanMessage("How do you cheer up a JavaScript developer?");
|
|
17
|
+
*
|
|
18
|
+
* // Call the chat model with a message and log the response
|
|
19
|
+
* const firstResponse = await chat.call([firstMessage]);
|
|
20
|
+
* console.log({ firstResponse });
|
|
21
|
+
*
|
|
22
|
+
* const secondResponse = await chat.call([secondMessage]);
|
|
23
|
+
* console.log({ secondResponse });
|
|
24
|
+
* ```
|
|
9
25
|
*/
|
|
10
26
|
class FakeListChatModel extends base_js_1.BaseChatModel {
|
|
11
27
|
static lc_name() {
|
|
@@ -13,6 +13,22 @@ export interface FakeChatInput extends BaseChatModelParams {
|
|
|
13
13
|
/**
|
|
14
14
|
* A fake Chat Model that returns a predefined list of responses. It can be used
|
|
15
15
|
* for testing purposes.
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const chat = new FakeListChatModel({
|
|
19
|
+
* responses: ["I'll callback later.", "You 'console' them!"]
|
|
20
|
+
* });
|
|
21
|
+
*
|
|
22
|
+
* const firstMessage = new HumanMessage("You want to hear a JavaScript joke?");
|
|
23
|
+
* const secondMessage = new HumanMessage("How do you cheer up a JavaScript developer?");
|
|
24
|
+
*
|
|
25
|
+
* // Call the chat model with a message and log the response
|
|
26
|
+
* const firstResponse = await chat.call([firstMessage]);
|
|
27
|
+
* console.log({ firstResponse });
|
|
28
|
+
*
|
|
29
|
+
* const secondResponse = await chat.call([secondMessage]);
|
|
30
|
+
* console.log({ secondResponse });
|
|
31
|
+
* ```
|
|
16
32
|
*/
|
|
17
33
|
export declare class FakeListChatModel extends BaseChatModel {
|
|
18
34
|
static lc_name(): string;
|
package/dist/chat_models/fake.js
CHANGED
|
@@ -3,6 +3,22 @@ import { AIMessage, AIMessageChunk, ChatGenerationChunk, } from "../schema/index
|
|
|
3
3
|
/**
|
|
4
4
|
* A fake Chat Model that returns a predefined list of responses. It can be used
|
|
5
5
|
* for testing purposes.
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const chat = new FakeListChatModel({
|
|
9
|
+
* responses: ["I'll callback later.", "You 'console' them!"]
|
|
10
|
+
* });
|
|
11
|
+
*
|
|
12
|
+
* const firstMessage = new HumanMessage("You want to hear a JavaScript joke?");
|
|
13
|
+
* const secondMessage = new HumanMessage("How do you cheer up a JavaScript developer?");
|
|
14
|
+
*
|
|
15
|
+
* // Call the chat model with a message and log the response
|
|
16
|
+
* const firstResponse = await chat.call([firstMessage]);
|
|
17
|
+
* console.log({ firstResponse });
|
|
18
|
+
*
|
|
19
|
+
* const secondResponse = await chat.call([secondMessage]);
|
|
20
|
+
* console.log({ secondResponse });
|
|
21
|
+
* ```
|
|
6
22
|
*/
|
|
7
23
|
export class FakeListChatModel extends BaseChatModel {
|
|
8
24
|
static lc_name() {
|
|
@@ -11,6 +11,16 @@ const env_js_1 = require("../util/env.cjs");
|
|
|
11
11
|
*
|
|
12
12
|
* To use, you should have the `openai` package installed and
|
|
13
13
|
* the `FIREWORKS_API_KEY` environment variable set.
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* const model = new ChatFireworks({
|
|
17
|
+
* temperature: 0.9,
|
|
18
|
+
* fireworksApiKey: "YOUR-API-KEY",
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* const response = await model.invoke("Hello, how are you?");
|
|
22
|
+
* console.log(response);
|
|
23
|
+
* ```
|
|
14
24
|
*/
|
|
15
25
|
class ChatFireworks extends openai_js_1.ChatOpenAI {
|
|
16
26
|
static lc_name() {
|
|
@@ -14,6 +14,16 @@ export type ChatFireworksCallOptions = Partial<Omit<ChatOpenAICallOptions, Firew
|
|
|
14
14
|
*
|
|
15
15
|
* To use, you should have the `openai` package installed and
|
|
16
16
|
* the `FIREWORKS_API_KEY` environment variable set.
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const model = new ChatFireworks({
|
|
20
|
+
* temperature: 0.9,
|
|
21
|
+
* fireworksApiKey: "YOUR-API-KEY",
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* const response = await model.invoke("Hello, how are you?");
|
|
25
|
+
* console.log(response);
|
|
26
|
+
* ```
|
|
17
27
|
*/
|
|
18
28
|
export declare class ChatFireworks extends ChatOpenAI<ChatFireworksCallOptions> {
|
|
19
29
|
static lc_name(): string;
|
|
@@ -8,6 +8,16 @@ import { getEnvironmentVariable } from "../util/env.js";
|
|
|
8
8
|
*
|
|
9
9
|
* To use, you should have the `openai` package installed and
|
|
10
10
|
* the `FIREWORKS_API_KEY` environment variable set.
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const model = new ChatFireworks({
|
|
14
|
+
* temperature: 0.9,
|
|
15
|
+
* fireworksApiKey: "YOUR-API-KEY",
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* const response = await model.invoke("Hello, how are you?");
|
|
19
|
+
* console.log(response);
|
|
20
|
+
* ```
|
|
11
21
|
*/
|
|
12
22
|
export class ChatFireworks extends ChatOpenAI {
|
|
13
23
|
static lc_name() {
|
|
@@ -15,6 +15,30 @@ function getMessageAuthor(message) {
|
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* A class that wraps the Google Palm chat model.
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const model = new ChatGooglePaLM({
|
|
21
|
+
* apiKey: "<YOUR API KEY>",
|
|
22
|
+
* temperature: 0.7,
|
|
23
|
+
* modelName: "models/chat-bison-001",
|
|
24
|
+
* topK: 40,
|
|
25
|
+
* topP: 1,
|
|
26
|
+
* examples: [
|
|
27
|
+
* {
|
|
28
|
+
* input: new HumanMessage("What is your favorite sock color?"),
|
|
29
|
+
* output: new AIMessage("My favorite sock color be arrrr-ange!"),
|
|
30
|
+
* },
|
|
31
|
+
* ],
|
|
32
|
+
* });
|
|
33
|
+
* const questions = [
|
|
34
|
+
* new SystemMessage(
|
|
35
|
+
* "You are a funny assistant that answers in pirate language."
|
|
36
|
+
* ),
|
|
37
|
+
* new HumanMessage("What is your favorite food?"),
|
|
38
|
+
* ];
|
|
39
|
+
* const res = await model.call(questions);
|
|
40
|
+
* console.log({ res });
|
|
41
|
+
* ```
|
|
18
42
|
*/
|
|
19
43
|
class ChatGooglePaLM extends base_js_1.BaseChatModel {
|
|
20
44
|
static lc_name() {
|
|
@@ -59,6 +59,30 @@ export interface GooglePaLMChatInput extends BaseChatModelParams {
|
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* A class that wraps the Google Palm chat model.
|
|
62
|
+
* @example
|
|
63
|
+
* ```typescript
|
|
64
|
+
* const model = new ChatGooglePaLM({
|
|
65
|
+
* apiKey: "<YOUR API KEY>",
|
|
66
|
+
* temperature: 0.7,
|
|
67
|
+
* modelName: "models/chat-bison-001",
|
|
68
|
+
* topK: 40,
|
|
69
|
+
* topP: 1,
|
|
70
|
+
* examples: [
|
|
71
|
+
* {
|
|
72
|
+
* input: new HumanMessage("What is your favorite sock color?"),
|
|
73
|
+
* output: new AIMessage("My favorite sock color be arrrr-ange!"),
|
|
74
|
+
* },
|
|
75
|
+
* ],
|
|
76
|
+
* });
|
|
77
|
+
* const questions = [
|
|
78
|
+
* new SystemMessage(
|
|
79
|
+
* "You are a funny assistant that answers in pirate language."
|
|
80
|
+
* ),
|
|
81
|
+
* new HumanMessage("What is your favorite food?"),
|
|
82
|
+
* ];
|
|
83
|
+
* const res = await model.call(questions);
|
|
84
|
+
* console.log({ res });
|
|
85
|
+
* ```
|
|
62
86
|
*/
|
|
63
87
|
export declare class ChatGooglePaLM extends BaseChatModel implements GooglePaLMChatInput {
|
|
64
88
|
static lc_name(): string;
|
|
@@ -12,6 +12,30 @@ function getMessageAuthor(message) {
|
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* A class that wraps the Google Palm chat model.
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const model = new ChatGooglePaLM({
|
|
18
|
+
* apiKey: "<YOUR API KEY>",
|
|
19
|
+
* temperature: 0.7,
|
|
20
|
+
* modelName: "models/chat-bison-001",
|
|
21
|
+
* topK: 40,
|
|
22
|
+
* topP: 1,
|
|
23
|
+
* examples: [
|
|
24
|
+
* {
|
|
25
|
+
* input: new HumanMessage("What is your favorite sock color?"),
|
|
26
|
+
* output: new AIMessage("My favorite sock color be arrrr-ange!"),
|
|
27
|
+
* },
|
|
28
|
+
* ],
|
|
29
|
+
* });
|
|
30
|
+
* const questions = [
|
|
31
|
+
* new SystemMessage(
|
|
32
|
+
* "You are a funny assistant that answers in pirate language."
|
|
33
|
+
* ),
|
|
34
|
+
* new HumanMessage("What is your favorite food?"),
|
|
35
|
+
* ];
|
|
36
|
+
* const res = await model.call(questions);
|
|
37
|
+
* console.log({ res });
|
|
38
|
+
* ```
|
|
15
39
|
*/
|
|
16
40
|
export class ChatGooglePaLM extends BaseChatModel {
|
|
17
41
|
static lc_name() {
|
|
@@ -17,6 +17,13 @@ const googlevertexai_gauth_js_1 = require("../../util/googlevertexai-gauth.cjs")
|
|
|
17
17
|
* - The `GOOGLE_APPLICATION_CREDENTIALS` environment variable is set to the
|
|
18
18
|
* path of a credentials file for a service account permitted to the
|
|
19
19
|
* Google Cloud project using Vertex AI.
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const model = new ChatGoogleVertexAI({
|
|
23
|
+
* temperature: 0.7,
|
|
24
|
+
* });
|
|
25
|
+
* const result = await model.invoke("What is the capital of France?");
|
|
26
|
+
* ```
|
|
20
27
|
*/
|
|
21
28
|
class ChatGoogleVertexAI extends common_js_1.BaseChatGoogleVertexAI {
|
|
22
29
|
static lc_name() {
|
|
@@ -13,6 +13,13 @@ import { BaseChatGoogleVertexAI, GoogleVertexAIChatInput } from "./common.js";
|
|
|
13
13
|
* - The `GOOGLE_APPLICATION_CREDENTIALS` environment variable is set to the
|
|
14
14
|
* path of a credentials file for a service account permitted to the
|
|
15
15
|
* Google Cloud project using Vertex AI.
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const model = new ChatGoogleVertexAI({
|
|
19
|
+
* temperature: 0.7,
|
|
20
|
+
* });
|
|
21
|
+
* const result = await model.invoke("What is the capital of France?");
|
|
22
|
+
* ```
|
|
16
23
|
*/
|
|
17
24
|
export declare class ChatGoogleVertexAI extends BaseChatGoogleVertexAI<GoogleAuthOptions> {
|
|
18
25
|
static lc_name(): string;
|
|
@@ -14,6 +14,13 @@ import { GAuthClient } from "../../util/googlevertexai-gauth.js";
|
|
|
14
14
|
* - The `GOOGLE_APPLICATION_CREDENTIALS` environment variable is set to the
|
|
15
15
|
* path of a credentials file for a service account permitted to the
|
|
16
16
|
* Google Cloud project using Vertex AI.
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const model = new ChatGoogleVertexAI({
|
|
20
|
+
* temperature: 0.7,
|
|
21
|
+
* });
|
|
22
|
+
* const result = await model.invoke("What is the capital of France?");
|
|
23
|
+
* ```
|
|
17
24
|
*/
|
|
18
25
|
export class ChatGoogleVertexAI extends BaseChatGoogleVertexAI {
|
|
19
26
|
static lc_name() {
|
|
@@ -12,6 +12,15 @@ 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 ChatGoogleVertexAI({
|
|
18
|
+
* temperature: 0.7,
|
|
19
|
+
* });
|
|
20
|
+
* const result = await model.invoke(
|
|
21
|
+
* "How do I implement a binary search algorithm in Python?",
|
|
22
|
+
* );
|
|
23
|
+
* ```
|
|
15
24
|
*/
|
|
16
25
|
class ChatGoogleVertexAI extends common_js_1.BaseChatGoogleVertexAI {
|
|
17
26
|
static lc_name() {
|
|
@@ -8,6 +8,15 @@ import { BaseChatGoogleVertexAI, GoogleVertexAIChatInput } from "./common.js";
|
|
|
8
8
|
* functions where you do not have access to the file system. It supports passing
|
|
9
9
|
* service account credentials directly as a "GOOGLE_VERTEX_AI_WEB_CREDENTIALS"
|
|
10
10
|
* environment variable or directly as "authOptions.credentials".
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const model = new ChatGoogleVertexAI({
|
|
14
|
+
* temperature: 0.7,
|
|
15
|
+
* });
|
|
16
|
+
* const result = await model.invoke(
|
|
17
|
+
* "How do I implement a binary search algorithm in Python?",
|
|
18
|
+
* );
|
|
19
|
+
* ```
|
|
11
20
|
*/
|
|
12
21
|
export declare class ChatGoogleVertexAI extends BaseChatGoogleVertexAI<WebGoogleAuthOptions> {
|
|
13
22
|
static lc_name(): string;
|
|
@@ -9,6 +9,15 @@ import { BaseChatGoogleVertexAI } 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 ChatGoogleVertexAI({
|
|
15
|
+
* temperature: 0.7,
|
|
16
|
+
* });
|
|
17
|
+
* const result = await model.invoke(
|
|
18
|
+
* "How do I implement a binary search algorithm in Python?",
|
|
19
|
+
* );
|
|
20
|
+
* ```
|
|
12
21
|
*/
|
|
13
22
|
export class ChatGoogleVertexAI extends BaseChatGoogleVertexAI {
|
|
14
23
|
static lc_name() {
|
|
@@ -14,6 +14,14 @@ class WebSocketStream extends iflytek_websocket_stream_js_1.BaseWebSocketStream
|
|
|
14
14
|
return new ws_1.default(url, options.protocols ?? []);
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* const model = new ChatIflytekXinghuo();
|
|
21
|
+
* const response = await model.call([new HumanMessage("Nice to meet you!")]);
|
|
22
|
+
* console.log(response);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
17
25
|
class ChatIflytekXinghuo extends common_js_1.BaseChatIflytekXinghuo {
|
|
18
26
|
async openWebSocketStream(options) {
|
|
19
27
|
const host = "spark-api.xf-yun.com";
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { BaseChatIflytekXinghuo } from "./common.js";
|
|
2
2
|
import { WebSocketStreamOptions } from "../../util/iflytek_websocket_stream.js";
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* ```typescript
|
|
6
|
+
* const model = new ChatIflytekXinghuo();
|
|
7
|
+
* const response = await model.call([new HumanMessage("Nice to meet you!")]);
|
|
8
|
+
* console.log(response);
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
3
11
|
export declare class ChatIflytekXinghuo extends BaseChatIflytekXinghuo {
|
|
4
12
|
openWebSocketStream<WebSocketStream>(options: WebSocketStreamOptions): Promise<WebSocketStream>;
|
|
5
13
|
}
|
|
@@ -8,6 +8,14 @@ class WebSocketStream extends BaseWebSocketStream {
|
|
|
8
8
|
return new WebSocket(url, options.protocols ?? []);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const model = new ChatIflytekXinghuo();
|
|
15
|
+
* const response = await model.call([new HumanMessage("Nice to meet you!")]);
|
|
16
|
+
* console.log(response);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
11
19
|
export class ChatIflytekXinghuo extends BaseChatIflytekXinghuo {
|
|
12
20
|
async openWebSocketStream(options) {
|
|
13
21
|
const host = "spark-api.xf-yun.com";
|
|
@@ -8,6 +8,14 @@ class WebSocketStream extends iflytek_websocket_stream_js_1.BaseWebSocketStream
|
|
|
8
8
|
return new WebSocket(url, options.protocols ?? []);
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* const model = new ChatIflytekXinghuo();
|
|
15
|
+
* const response = await model.call([new HumanMessage("Nice to meet you!")]);
|
|
16
|
+
* console.log(response);
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
11
19
|
class ChatIflytekXinghuo extends common_js_1.BaseChatIflytekXinghuo {
|
|
12
20
|
async openWebSocketStream(options) {
|
|
13
21
|
const host = "spark-api.xf-yun.com";
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { BaseChatIflytekXinghuo } from "./common.js";
|
|
2
2
|
import { WebSocketStreamOptions } from "../../util/iflytek_websocket_stream.js";
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* ```typescript
|
|
6
|
+
* const model = new ChatIflytekXinghuo();
|
|
7
|
+
* const response = await model.call([new HumanMessage("Nice to meet you!")]);
|
|
8
|
+
* console.log(response);
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
3
11
|
export declare class ChatIflytekXinghuo extends BaseChatIflytekXinghuo {
|
|
4
12
|
openWebSocketStream<WebSocketStream>(options: WebSocketStreamOptions): Promise<WebSocketStream>;
|
|
5
13
|
}
|
|
@@ -5,6 +5,14 @@ class WebSocketStream extends BaseWebSocketStream {
|
|
|
5
5
|
return new WebSocket(url, options.protocols ?? []);
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const model = new ChatIflytekXinghuo();
|
|
12
|
+
* const response = await model.call([new HumanMessage("Nice to meet you!")]);
|
|
13
|
+
* console.log(response);
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
8
16
|
export class ChatIflytekXinghuo extends BaseChatIflytekXinghuo {
|
|
9
17
|
async openWebSocketStream(options) {
|
|
10
18
|
const host = "spark-api.xf-yun.com";
|
|
@@ -9,6 +9,23 @@ const llama_cpp_js_1 = require("../util/llama_cpp.cjs");
|
|
|
9
9
|
* This can be installed using `npm install -S node-llama-cpp` and the minimum
|
|
10
10
|
* version supported in version 2.0.0.
|
|
11
11
|
* This also requires that have a locally built version of Llama2 installed.
|
|
12
|
+
* @example
|
|
13
|
+
* ```typescript
|
|
14
|
+
* // Initialize the ChatLlamaCpp model with the path to the model binary file.
|
|
15
|
+
* const model = new ChatLlamaCpp({
|
|
16
|
+
* modelPath: "/Replace/with/path/to/your/model/gguf-llama2-q4_0.bin",
|
|
17
|
+
* temperature: 0.5,
|
|
18
|
+
* });
|
|
19
|
+
*
|
|
20
|
+
* // Call the model with a message and await the response.
|
|
21
|
+
* const response = await model.call([
|
|
22
|
+
* new HumanMessage({ content: "My name is John." }),
|
|
23
|
+
* ]);
|
|
24
|
+
*
|
|
25
|
+
* // Log the response to the console.
|
|
26
|
+
* console.log({ response });
|
|
27
|
+
*
|
|
28
|
+
* ```
|
|
12
29
|
*/
|
|
13
30
|
class ChatLlamaCpp extends base_js_1.SimpleChatModel {
|
|
14
31
|
static lc_name() {
|
|
@@ -20,6 +20,23 @@ export interface LlamaCppCallOptions extends BaseLanguageModelCallOptions {
|
|
|
20
20
|
* This can be installed using `npm install -S node-llama-cpp` and the minimum
|
|
21
21
|
* version supported in version 2.0.0.
|
|
22
22
|
* This also requires that have a locally built version of Llama2 installed.
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* // Initialize the ChatLlamaCpp model with the path to the model binary file.
|
|
26
|
+
* const model = new ChatLlamaCpp({
|
|
27
|
+
* modelPath: "/Replace/with/path/to/your/model/gguf-llama2-q4_0.bin",
|
|
28
|
+
* temperature: 0.5,
|
|
29
|
+
* });
|
|
30
|
+
*
|
|
31
|
+
* // Call the model with a message and await the response.
|
|
32
|
+
* const response = await model.call([
|
|
33
|
+
* new HumanMessage({ content: "My name is John." }),
|
|
34
|
+
* ]);
|
|
35
|
+
*
|
|
36
|
+
* // Log the response to the console.
|
|
37
|
+
* console.log({ response });
|
|
38
|
+
*
|
|
39
|
+
* ```
|
|
23
40
|
*/
|
|
24
41
|
export declare class ChatLlamaCpp extends SimpleChatModel<LlamaCppCallOptions> {
|
|
25
42
|
CallOptions: LlamaCppCallOptions;
|
|
@@ -6,6 +6,23 @@ import { createLlamaModel, createLlamaContext, } from "../util/llama_cpp.js";
|
|
|
6
6
|
* This can be installed using `npm install -S node-llama-cpp` and the minimum
|
|
7
7
|
* version supported in version 2.0.0.
|
|
8
8
|
* This also requires that have a locally built version of Llama2 installed.
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* // Initialize the ChatLlamaCpp model with the path to the model binary file.
|
|
12
|
+
* const model = new ChatLlamaCpp({
|
|
13
|
+
* modelPath: "/Replace/with/path/to/your/model/gguf-llama2-q4_0.bin",
|
|
14
|
+
* temperature: 0.5,
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* // Call the model with a message and await the response.
|
|
18
|
+
* const response = await model.call([
|
|
19
|
+
* new HumanMessage({ content: "My name is John." }),
|
|
20
|
+
* ]);
|
|
21
|
+
*
|
|
22
|
+
* // Log the response to the console.
|
|
23
|
+
* console.log({ response });
|
|
24
|
+
*
|
|
25
|
+
* ```
|
|
9
26
|
*/
|
|
10
27
|
export class ChatLlamaCpp extends SimpleChatModel {
|
|
11
28
|
static lc_name() {
|
|
@@ -52,6 +52,33 @@ function messageToMinimaxRole(message) {
|
|
|
52
52
|
*
|
|
53
53
|
* To use you should have the `MINIMAX_GROUP_ID` and `MINIMAX_API_KEY`
|
|
54
54
|
* environment variable set.
|
|
55
|
+
* @example
|
|
56
|
+
* ```typescript
|
|
57
|
+
* // Define a chat prompt with a system message setting the context for translation
|
|
58
|
+
* const chatPrompt = ChatPromptTemplate.fromMessages([
|
|
59
|
+
* SystemMessagePromptTemplate.fromTemplate(
|
|
60
|
+
* "You are a helpful assistant that translates {input_language} to {output_language}.",
|
|
61
|
+
* ),
|
|
62
|
+
* HumanMessagePromptTemplate.fromTemplate("{text}"),
|
|
63
|
+
* ]);
|
|
64
|
+
*
|
|
65
|
+
* // Create a new LLMChain with the chat model and the defined prompt
|
|
66
|
+
* const chainB = new LLMChain({
|
|
67
|
+
* prompt: chatPrompt,
|
|
68
|
+
* llm: new ChatMinimax({ temperature: 0.01 }),
|
|
69
|
+
* });
|
|
70
|
+
*
|
|
71
|
+
* // Call the chain with the input language, output language, and the text to translate
|
|
72
|
+
* const resB = await chainB.call({
|
|
73
|
+
* input_language: "English",
|
|
74
|
+
* output_language: "Chinese",
|
|
75
|
+
* text: "I love programming.",
|
|
76
|
+
* });
|
|
77
|
+
*
|
|
78
|
+
* // Log the result
|
|
79
|
+
* console.log({ resB });
|
|
80
|
+
*
|
|
81
|
+
* ```
|
|
55
82
|
*/
|
|
56
83
|
class ChatMinimax extends base_js_1.BaseChatModel {
|
|
57
84
|
static lc_name() {
|
|
@@ -184,6 +184,33 @@ export interface ChatMinimaxCallOptions extends BaseFunctionCallOptions {
|
|
|
184
184
|
*
|
|
185
185
|
* To use you should have the `MINIMAX_GROUP_ID` and `MINIMAX_API_KEY`
|
|
186
186
|
* environment variable set.
|
|
187
|
+
* @example
|
|
188
|
+
* ```typescript
|
|
189
|
+
* // Define a chat prompt with a system message setting the context for translation
|
|
190
|
+
* const chatPrompt = ChatPromptTemplate.fromMessages([
|
|
191
|
+
* SystemMessagePromptTemplate.fromTemplate(
|
|
192
|
+
* "You are a helpful assistant that translates {input_language} to {output_language}.",
|
|
193
|
+
* ),
|
|
194
|
+
* HumanMessagePromptTemplate.fromTemplate("{text}"),
|
|
195
|
+
* ]);
|
|
196
|
+
*
|
|
197
|
+
* // Create a new LLMChain with the chat model and the defined prompt
|
|
198
|
+
* const chainB = new LLMChain({
|
|
199
|
+
* prompt: chatPrompt,
|
|
200
|
+
* llm: new ChatMinimax({ temperature: 0.01 }),
|
|
201
|
+
* });
|
|
202
|
+
*
|
|
203
|
+
* // Call the chain with the input language, output language, and the text to translate
|
|
204
|
+
* const resB = await chainB.call({
|
|
205
|
+
* input_language: "English",
|
|
206
|
+
* output_language: "Chinese",
|
|
207
|
+
* text: "I love programming.",
|
|
208
|
+
* });
|
|
209
|
+
*
|
|
210
|
+
* // Log the result
|
|
211
|
+
* console.log({ resB });
|
|
212
|
+
*
|
|
213
|
+
* ```
|
|
187
214
|
*/
|
|
188
215
|
export declare class ChatMinimax extends BaseChatModel<ChatMinimaxCallOptions> implements MinimaxChatInput {
|
|
189
216
|
static lc_name(): string;
|
|
@@ -49,6 +49,33 @@ function messageToMinimaxRole(message) {
|
|
|
49
49
|
*
|
|
50
50
|
* To use you should have the `MINIMAX_GROUP_ID` and `MINIMAX_API_KEY`
|
|
51
51
|
* environment variable set.
|
|
52
|
+
* @example
|
|
53
|
+
* ```typescript
|
|
54
|
+
* // Define a chat prompt with a system message setting the context for translation
|
|
55
|
+
* const chatPrompt = ChatPromptTemplate.fromMessages([
|
|
56
|
+
* SystemMessagePromptTemplate.fromTemplate(
|
|
57
|
+
* "You are a helpful assistant that translates {input_language} to {output_language}.",
|
|
58
|
+
* ),
|
|
59
|
+
* HumanMessagePromptTemplate.fromTemplate("{text}"),
|
|
60
|
+
* ]);
|
|
61
|
+
*
|
|
62
|
+
* // Create a new LLMChain with the chat model and the defined prompt
|
|
63
|
+
* const chainB = new LLMChain({
|
|
64
|
+
* prompt: chatPrompt,
|
|
65
|
+
* llm: new ChatMinimax({ temperature: 0.01 }),
|
|
66
|
+
* });
|
|
67
|
+
*
|
|
68
|
+
* // Call the chain with the input language, output language, and the text to translate
|
|
69
|
+
* const resB = await chainB.call({
|
|
70
|
+
* input_language: "English",
|
|
71
|
+
* output_language: "Chinese",
|
|
72
|
+
* text: "I love programming.",
|
|
73
|
+
* });
|
|
74
|
+
*
|
|
75
|
+
* // Log the result
|
|
76
|
+
* console.log({ resB });
|
|
77
|
+
*
|
|
78
|
+
* ```
|
|
52
79
|
*/
|
|
53
80
|
export class ChatMinimax extends BaseChatModel {
|
|
54
81
|
static lc_name() {
|
|
@@ -8,6 +8,30 @@ const index_js_1 = require("../schema/index.cjs");
|
|
|
8
8
|
* A class that enables calls to the Ollama API to access large language
|
|
9
9
|
* models in a chat-like fashion. It extends the SimpleChatModel class and
|
|
10
10
|
* implements the OllamaInput interface.
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const prompt = ChatPromptTemplate.fromMessages([
|
|
14
|
+
* [
|
|
15
|
+
* "system",
|
|
16
|
+
* `You are an expert translator. Format all responses as JSON objects with two keys: "original" and "translated".`,
|
|
17
|
+
* ],
|
|
18
|
+
* ["human", `Translate "{input}" into {language}.`],
|
|
19
|
+
* ]);
|
|
20
|
+
*
|
|
21
|
+
* const model = new ChatOllama({
|
|
22
|
+
* baseUrl: "http://api.example.com",
|
|
23
|
+
* model: "llama2",
|
|
24
|
+
* format: "json",
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* const chain = prompt.pipe(model);
|
|
28
|
+
*
|
|
29
|
+
* const result = await chain.invoke({
|
|
30
|
+
* input: "I love programming",
|
|
31
|
+
* language: "German",
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* ```
|
|
11
35
|
*/
|
|
12
36
|
class ChatOllama extends base_js_1.SimpleChatModel {
|
|
13
37
|
static lc_name() {
|