langchain 0.0.192 → 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/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/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 +9 -0
- package/dist/chat_models/bedrock/web.d.ts +9 -0
- package/dist/chat_models/bedrock/web.js +9 -0
- 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 +6 -0
- package/dist/document_loaders/fs/pdf.d.ts +6 -0
- package/dist/document_loaders/fs/pdf.js +6 -0
- 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 +21 -0
- package/dist/document_loaders/web/apify_dataset.d.ts +21 -0
- package/dist/document_loaders/web/apify_dataset.js +21 -0
- 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 +6 -0
- package/dist/document_loaders/web/pdf.d.ts +6 -0
- package/dist/document_loaders/web/pdf.js +6 -0
- 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/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/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 +6 -0
- package/dist/vectorstores/prisma.d.ts +3 -0
- package/dist/vectorstores/prisma.js +6 -0
- package/package.json +1 -1
|
@@ -4,6 +4,24 @@ import { mapChatMessagesToStoredMessages, mapStoredMessagesToChatMessages, } fro
|
|
|
4
4
|
/**
|
|
5
5
|
* Class for storing and retrieving chat message history from a
|
|
6
6
|
* PlanetScale database. Extends the BaseListChatMessageHistory class.
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* const chatHistory = new PlanetScaleChatMessageHistory({
|
|
10
|
+
* tableName: "stored_message",
|
|
11
|
+
* sessionId: "lc-example",
|
|
12
|
+
* config: {
|
|
13
|
+
* url: "ADD_YOURS_HERE",
|
|
14
|
+
* },
|
|
15
|
+
* });
|
|
16
|
+
* const chain = new ConversationChain({
|
|
17
|
+
* llm: new ChatOpenAI(),
|
|
18
|
+
* memory: chatHistory,
|
|
19
|
+
* });
|
|
20
|
+
* const response = await chain.invoke({
|
|
21
|
+
* input: "What did I just say my name was?",
|
|
22
|
+
* });
|
|
23
|
+
* console.log({ response });
|
|
24
|
+
* ```
|
|
7
25
|
*/
|
|
8
26
|
export class PlanetScaleChatMessageHistory extends BaseListChatMessageHistory {
|
|
9
27
|
get lc_secrets() {
|
|
@@ -8,6 +8,24 @@ const utils_js_1 = require("./utils.cjs");
|
|
|
8
8
|
/**
|
|
9
9
|
* Class for storing chat message history using Redis. Extends the
|
|
10
10
|
* `BaseListChatMessageHistory` class.
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const chatHistory = new RedisChatMessageHistory({
|
|
14
|
+
* sessionId: new Date().toISOString(),
|
|
15
|
+
* sessionTTL: 300,
|
|
16
|
+
* url: "redis:
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* const chain = new ConversationChain({
|
|
20
|
+
* llm: new ChatOpenAI({ modelName: "gpt-3.5-turbo", temperature: 0 }),
|
|
21
|
+
* memory: { chatHistory },
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* const response = await chain.invoke({
|
|
25
|
+
* input: "What did I just say my name was?",
|
|
26
|
+
* });
|
|
27
|
+
* console.log({ response });
|
|
28
|
+
* ```
|
|
11
29
|
*/
|
|
12
30
|
class RedisChatMessageHistory extends index_js_1.BaseListChatMessageHistory {
|
|
13
31
|
get lc_secrets() {
|
|
@@ -12,6 +12,24 @@ export type RedisChatMessageHistoryInput = {
|
|
|
12
12
|
/**
|
|
13
13
|
* Class for storing chat message history using Redis. Extends the
|
|
14
14
|
* `BaseListChatMessageHistory` class.
|
|
15
|
+
* @example
|
|
16
|
+
* ```typescript
|
|
17
|
+
* const chatHistory = new RedisChatMessageHistory({
|
|
18
|
+
* sessionId: new Date().toISOString(),
|
|
19
|
+
* sessionTTL: 300,
|
|
20
|
+
* url: "redis:
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* const chain = new ConversationChain({
|
|
24
|
+
* llm: new ChatOpenAI({ modelName: "gpt-3.5-turbo", temperature: 0 }),
|
|
25
|
+
* memory: { chatHistory },
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* const response = await chain.invoke({
|
|
29
|
+
* input: "What did I just say my name was?",
|
|
30
|
+
* });
|
|
31
|
+
* console.log({ response });
|
|
32
|
+
* ```
|
|
15
33
|
*/
|
|
16
34
|
export declare class RedisChatMessageHistory extends BaseListChatMessageHistory {
|
|
17
35
|
lc_namespace: string[];
|
|
@@ -5,6 +5,24 @@ import { mapChatMessagesToStoredMessages, mapStoredMessagesToChatMessages, } fro
|
|
|
5
5
|
/**
|
|
6
6
|
* Class for storing chat message history using Redis. Extends the
|
|
7
7
|
* `BaseListChatMessageHistory` class.
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const chatHistory = new RedisChatMessageHistory({
|
|
11
|
+
* sessionId: new Date().toISOString(),
|
|
12
|
+
* sessionTTL: 300,
|
|
13
|
+
* url: "redis:
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* const chain = new ConversationChain({
|
|
17
|
+
* llm: new ChatOpenAI({ modelName: "gpt-3.5-turbo", temperature: 0 }),
|
|
18
|
+
* memory: { chatHistory },
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* const response = await chain.invoke({
|
|
22
|
+
* input: "What did I just say my name was?",
|
|
23
|
+
* });
|
|
24
|
+
* console.log({ response });
|
|
25
|
+
* ```
|
|
8
26
|
*/
|
|
9
27
|
export class RedisChatMessageHistory extends BaseListChatMessageHistory {
|
|
10
28
|
get lc_secrets() {
|
|
@@ -17,6 +17,29 @@ const chatMemoryColumns = [
|
|
|
17
17
|
* extends the BaseListChatMessageHistory class and provides methods to
|
|
18
18
|
* get, add, and clear messages. It also ensures the existence of a table
|
|
19
19
|
* where the chat messages are stored.
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const chatHistory = new XataChatMessageHistory({
|
|
23
|
+
* table: "messages",
|
|
24
|
+
* sessionId: new Date().toISOString(),
|
|
25
|
+
* client: new BaseClient({
|
|
26
|
+
* databaseURL: process.env.XATA_DB_URL,
|
|
27
|
+
* apiKey: process.env.XATA_API_KEY,
|
|
28
|
+
* branch: "main",
|
|
29
|
+
* }),
|
|
30
|
+
* apiKey: process.env.XATA_API_KEY,
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* const chain = new ConversationChain({
|
|
34
|
+
* llm: new ChatOpenAI(),
|
|
35
|
+
* memory: new BufferMemory({ chatHistory }),
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* const response = await chain.invoke({
|
|
39
|
+
* input: "What did I just say my name was?",
|
|
40
|
+
* });
|
|
41
|
+
* console.log({ response });
|
|
42
|
+
* ```
|
|
20
43
|
*/
|
|
21
44
|
class XataChatMessageHistory extends index_js_1.BaseListChatMessageHistory {
|
|
22
45
|
constructor(fields) {
|
|
@@ -17,6 +17,29 @@ export type XataChatMessageHistoryInput<XataClient> = {
|
|
|
17
17
|
* extends the BaseListChatMessageHistory class and provides methods to
|
|
18
18
|
* get, add, and clear messages. It also ensures the existence of a table
|
|
19
19
|
* where the chat messages are stored.
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const chatHistory = new XataChatMessageHistory({
|
|
23
|
+
* table: "messages",
|
|
24
|
+
* sessionId: new Date().toISOString(),
|
|
25
|
+
* client: new BaseClient({
|
|
26
|
+
* databaseURL: process.env.XATA_DB_URL,
|
|
27
|
+
* apiKey: process.env.XATA_API_KEY,
|
|
28
|
+
* branch: "main",
|
|
29
|
+
* }),
|
|
30
|
+
* apiKey: process.env.XATA_API_KEY,
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* const chain = new ConversationChain({
|
|
34
|
+
* llm: new ChatOpenAI(),
|
|
35
|
+
* memory: new BufferMemory({ chatHistory }),
|
|
36
|
+
* });
|
|
37
|
+
*
|
|
38
|
+
* const response = await chain.invoke({
|
|
39
|
+
* input: "What did I just say my name was?",
|
|
40
|
+
* });
|
|
41
|
+
* console.log({ response });
|
|
42
|
+
* ```
|
|
20
43
|
*/
|
|
21
44
|
export declare class XataChatMessageHistory<XataClient extends BaseClient> extends BaseListChatMessageHistory {
|
|
22
45
|
lc_namespace: string[];
|
|
@@ -14,6 +14,29 @@ const chatMemoryColumns = [
|
|
|
14
14
|
* extends the BaseListChatMessageHistory class and provides methods to
|
|
15
15
|
* get, add, and clear messages. It also ensures the existence of a table
|
|
16
16
|
* where the chat messages are stored.
|
|
17
|
+
* @example
|
|
18
|
+
* ```typescript
|
|
19
|
+
* const chatHistory = new XataChatMessageHistory({
|
|
20
|
+
* table: "messages",
|
|
21
|
+
* sessionId: new Date().toISOString(),
|
|
22
|
+
* client: new BaseClient({
|
|
23
|
+
* databaseURL: process.env.XATA_DB_URL,
|
|
24
|
+
* apiKey: process.env.XATA_API_KEY,
|
|
25
|
+
* branch: "main",
|
|
26
|
+
* }),
|
|
27
|
+
* apiKey: process.env.XATA_API_KEY,
|
|
28
|
+
* });
|
|
29
|
+
*
|
|
30
|
+
* const chain = new ConversationChain({
|
|
31
|
+
* llm: new ChatOpenAI(),
|
|
32
|
+
* memory: new BufferMemory({ chatHistory }),
|
|
33
|
+
* });
|
|
34
|
+
*
|
|
35
|
+
* const response = await chain.invoke({
|
|
36
|
+
* input: "What did I just say my name was?",
|
|
37
|
+
* });
|
|
38
|
+
* console.log({ response });
|
|
39
|
+
* ```
|
|
17
40
|
*/
|
|
18
41
|
export class XataChatMessageHistory extends BaseListChatMessageHistory {
|
|
19
42
|
constructor(fields) {
|
|
@@ -6,6 +6,12 @@ const base_js_1 = require("./base.cjs");
|
|
|
6
6
|
/**
|
|
7
7
|
* The Calculator class is a tool used to evaluate mathematical
|
|
8
8
|
* expressions. It extends the base Tool class.
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const calculator = new Calculator();
|
|
12
|
+
* const sum = calculator.add(99, 99);
|
|
13
|
+
* console.log("The sum of 99 and 99 is:", sum);
|
|
14
|
+
* ```
|
|
9
15
|
*/
|
|
10
16
|
class Calculator extends base_js_1.Tool {
|
|
11
17
|
constructor() {
|
|
@@ -2,6 +2,12 @@ import { Tool } from "./base.js";
|
|
|
2
2
|
/**
|
|
3
3
|
* The Calculator class is a tool used to evaluate mathematical
|
|
4
4
|
* expressions. It extends the base Tool class.
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const calculator = new Calculator();
|
|
8
|
+
* const sum = calculator.add(99, 99);
|
|
9
|
+
* console.log("The sum of 99 and 99 is:", sum);
|
|
10
|
+
* ```
|
|
5
11
|
*/
|
|
6
12
|
export declare class Calculator extends Tool {
|
|
7
13
|
static lc_name(): string;
|
package/dist/tools/calculator.js
CHANGED
|
@@ -3,6 +3,12 @@ import { Tool } from "./base.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* The Calculator class is a tool used to evaluate mathematical
|
|
5
5
|
* expressions. It extends the base Tool class.
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* const calculator = new Calculator();
|
|
9
|
+
* const sum = calculator.add(99, 99);
|
|
10
|
+
* console.log("The sum of 99 and 99 is:", sum);
|
|
11
|
+
* ```
|
|
6
12
|
*/
|
|
7
13
|
export class Calculator extends Tool {
|
|
8
14
|
constructor() {
|
|
@@ -4,6 +4,28 @@ exports.GoogleCalendarCreateTool = void 0;
|
|
|
4
4
|
const base_js_1 = require("./base.cjs");
|
|
5
5
|
const run_create_events_js_1 = require("./commands/run-create-events.cjs");
|
|
6
6
|
const descriptions_js_1 = require("./descriptions.cjs");
|
|
7
|
+
/**
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const googleCalendarCreateTool = new GoogleCalendarCreateTool({
|
|
11
|
+
* credentials: {
|
|
12
|
+
* clientEmail: process.env.GOOGLE_CALENDAR_CLIENT_EMAIL,
|
|
13
|
+
* privateKey: process.env.GOOGLE_CALENDAR_PRIVATE_KEY,
|
|
14
|
+
* calendarId: process.env.GOOGLE_CALENDAR_CALENDAR_ID,
|
|
15
|
+
* },
|
|
16
|
+
* scopes: [
|
|
17
|
+
* "https:
|
|
18
|
+
* "https:
|
|
19
|
+
* ],
|
|
20
|
+
* model: new ChatOpenAI({}),
|
|
21
|
+
* });
|
|
22
|
+
* const createInput = `Create a meeting with John Doe next Friday at 4pm - adding to the agenda of it the result of 99 + 99`;
|
|
23
|
+
* const createResult = await googleCalendarCreateTool.invoke({
|
|
24
|
+
* input: createInput,
|
|
25
|
+
* });
|
|
26
|
+
* console.log("Create Result", createResult);
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
7
29
|
class GoogleCalendarCreateTool extends base_js_1.GoogleCalendarBase {
|
|
8
30
|
constructor(fields) {
|
|
9
31
|
super(fields);
|
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
import { CallbackManagerForToolRun } from "../../callbacks/manager.js";
|
|
2
2
|
import { GoogleCalendarBase, GoogleCalendarAgentParams } from "./base.js";
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* ```typescript
|
|
6
|
+
* const googleCalendarCreateTool = new GoogleCalendarCreateTool({
|
|
7
|
+
* credentials: {
|
|
8
|
+
* clientEmail: process.env.GOOGLE_CALENDAR_CLIENT_EMAIL,
|
|
9
|
+
* privateKey: process.env.GOOGLE_CALENDAR_PRIVATE_KEY,
|
|
10
|
+
* calendarId: process.env.GOOGLE_CALENDAR_CALENDAR_ID,
|
|
11
|
+
* },
|
|
12
|
+
* scopes: [
|
|
13
|
+
* "https:
|
|
14
|
+
* "https:
|
|
15
|
+
* ],
|
|
16
|
+
* model: new ChatOpenAI({}),
|
|
17
|
+
* });
|
|
18
|
+
* const createInput = `Create a meeting with John Doe next Friday at 4pm - adding to the agenda of it the result of 99 + 99`;
|
|
19
|
+
* const createResult = await googleCalendarCreateTool.invoke({
|
|
20
|
+
* input: createInput,
|
|
21
|
+
* });
|
|
22
|
+
* console.log("Create Result", createResult);
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
3
25
|
export declare class GoogleCalendarCreateTool extends GoogleCalendarBase {
|
|
4
26
|
name: string;
|
|
5
27
|
description: string;
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
import { GoogleCalendarBase } from "./base.js";
|
|
2
2
|
import { runCreateEvent } from "./commands/run-create-events.js";
|
|
3
3
|
import { CREATE_TOOL_DESCRIPTION } from "./descriptions.js";
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const googleCalendarCreateTool = new GoogleCalendarCreateTool({
|
|
8
|
+
* credentials: {
|
|
9
|
+
* clientEmail: process.env.GOOGLE_CALENDAR_CLIENT_EMAIL,
|
|
10
|
+
* privateKey: process.env.GOOGLE_CALENDAR_PRIVATE_KEY,
|
|
11
|
+
* calendarId: process.env.GOOGLE_CALENDAR_CALENDAR_ID,
|
|
12
|
+
* },
|
|
13
|
+
* scopes: [
|
|
14
|
+
* "https:
|
|
15
|
+
* "https:
|
|
16
|
+
* ],
|
|
17
|
+
* model: new ChatOpenAI({}),
|
|
18
|
+
* });
|
|
19
|
+
* const createInput = `Create a meeting with John Doe next Friday at 4pm - adding to the agenda of it the result of 99 + 99`;
|
|
20
|
+
* const createResult = await googleCalendarCreateTool.invoke({
|
|
21
|
+
* input: createInput,
|
|
22
|
+
* });
|
|
23
|
+
* console.log("Create Result", createResult);
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
4
26
|
export class GoogleCalendarCreateTool extends GoogleCalendarBase {
|
|
5
27
|
constructor(fields) {
|
|
6
28
|
super(fields);
|
|
@@ -4,6 +4,26 @@ exports.GoogleCalendarViewTool = void 0;
|
|
|
4
4
|
const base_js_1 = require("./base.cjs");
|
|
5
5
|
const descriptions_js_1 = require("./descriptions.cjs");
|
|
6
6
|
const run_view_events_js_1 = require("./commands/run-view-events.cjs");
|
|
7
|
+
/**
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const googleCalendarViewTool = new GoogleCalendarViewTool({
|
|
11
|
+
* credentials: {
|
|
12
|
+
* clientEmail: process.env.GOOGLE_CALENDAR_CLIENT_EMAIL,
|
|
13
|
+
* privateKey: process.env.GOOGLE_CALENDAR_PRIVATE_KEY,
|
|
14
|
+
* calendarId: process.env.GOOGLE_CALENDAR_CALENDAR_ID,
|
|
15
|
+
* },
|
|
16
|
+
* scopes: [
|
|
17
|
+
* "https:
|
|
18
|
+
* "https:
|
|
19
|
+
* ],
|
|
20
|
+
* model: new ChatOpenAI({}),
|
|
21
|
+
* });
|
|
22
|
+
* const viewInput = `What meetings do I have this week?`;
|
|
23
|
+
* const viewResult = await googleCalendarViewTool.invoke({ input: viewInput });
|
|
24
|
+
* console.log("View Result", viewResult);
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
7
27
|
class GoogleCalendarViewTool extends base_js_1.GoogleCalendarBase {
|
|
8
28
|
constructor(fields) {
|
|
9
29
|
super(fields);
|
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
import { GoogleCalendarBase, GoogleCalendarAgentParams } from "./base.js";
|
|
2
2
|
import { CallbackManagerForToolRun } from "../../callbacks/manager.js";
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* ```typescript
|
|
6
|
+
* const googleCalendarViewTool = new GoogleCalendarViewTool({
|
|
7
|
+
* credentials: {
|
|
8
|
+
* clientEmail: process.env.GOOGLE_CALENDAR_CLIENT_EMAIL,
|
|
9
|
+
* privateKey: process.env.GOOGLE_CALENDAR_PRIVATE_KEY,
|
|
10
|
+
* calendarId: process.env.GOOGLE_CALENDAR_CALENDAR_ID,
|
|
11
|
+
* },
|
|
12
|
+
* scopes: [
|
|
13
|
+
* "https:
|
|
14
|
+
* "https:
|
|
15
|
+
* ],
|
|
16
|
+
* model: new ChatOpenAI({}),
|
|
17
|
+
* });
|
|
18
|
+
* const viewInput = `What meetings do I have this week?`;
|
|
19
|
+
* const viewResult = await googleCalendarViewTool.invoke({ input: viewInput });
|
|
20
|
+
* console.log("View Result", viewResult);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
3
23
|
export declare class GoogleCalendarViewTool extends GoogleCalendarBase {
|
|
4
24
|
name: string;
|
|
5
25
|
description: string;
|
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
import { GoogleCalendarBase } from "./base.js";
|
|
2
2
|
import { VIEW_TOOL_DESCRIPTION } from "./descriptions.js";
|
|
3
3
|
import { runViewEvents } from "./commands/run-view-events.js";
|
|
4
|
+
/**
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* const googleCalendarViewTool = new GoogleCalendarViewTool({
|
|
8
|
+
* credentials: {
|
|
9
|
+
* clientEmail: process.env.GOOGLE_CALENDAR_CLIENT_EMAIL,
|
|
10
|
+
* privateKey: process.env.GOOGLE_CALENDAR_PRIVATE_KEY,
|
|
11
|
+
* calendarId: process.env.GOOGLE_CALENDAR_CALENDAR_ID,
|
|
12
|
+
* },
|
|
13
|
+
* scopes: [
|
|
14
|
+
* "https:
|
|
15
|
+
* "https:
|
|
16
|
+
* ],
|
|
17
|
+
* model: new ChatOpenAI({}),
|
|
18
|
+
* });
|
|
19
|
+
* const viewInput = `What meetings do I have this week?`;
|
|
20
|
+
* const viewResult = await googleCalendarViewTool.invoke({ input: viewInput });
|
|
21
|
+
* console.log("View Result", viewResult);
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
4
24
|
export class GoogleCalendarViewTool extends GoogleCalendarBase {
|
|
5
25
|
constructor(fields) {
|
|
6
26
|
super(fields);
|
package/dist/tools/searchapi.cjs
CHANGED
|
@@ -13,6 +13,33 @@ function isJSONObject(value) {
|
|
|
13
13
|
*
|
|
14
14
|
* Ensure you've set the SEARCHAPI_API_KEY environment variable for authentication.
|
|
15
15
|
* You can obtain a free API key from https://www.searchapi.io/.
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* const searchApi = new SearchApi("your-api-key", {
|
|
19
|
+
* engine: "google_news",
|
|
20
|
+
* });
|
|
21
|
+
* const agent = RunnableSequence.from([
|
|
22
|
+
* ChatPromptTemplate.fromMessages([
|
|
23
|
+
* ["ai", "Answer the following questions using a bulleted list markdown format.""],
|
|
24
|
+
* ["human", "{input}"],
|
|
25
|
+
* ]),
|
|
26
|
+
* new ChatOpenAI({ temperature: 0 }),
|
|
27
|
+
* (input: BaseMessageChunk) => ({
|
|
28
|
+
* log: "test",
|
|
29
|
+
* returnValues: {
|
|
30
|
+
* output: input,
|
|
31
|
+
* },
|
|
32
|
+
* }),
|
|
33
|
+
* ]);
|
|
34
|
+
* const executor = AgentExecutor.fromAgentAndTools({
|
|
35
|
+
* agent,
|
|
36
|
+
* tools: [searchApi],
|
|
37
|
+
* });
|
|
38
|
+
* const res = await executor.invoke({
|
|
39
|
+
* input: "What's happening in Ukraine today?"",
|
|
40
|
+
* });
|
|
41
|
+
* console.log(res);
|
|
42
|
+
* ```
|
|
16
43
|
*/
|
|
17
44
|
class SearchApi extends base_js_1.Tool {
|
|
18
45
|
static lc_name() {
|
|
@@ -27,6 +27,33 @@ export type SearchApiParameters = {
|
|
|
27
27
|
*
|
|
28
28
|
* Ensure you've set the SEARCHAPI_API_KEY environment variable for authentication.
|
|
29
29
|
* You can obtain a free API key from https://www.searchapi.io/.
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const searchApi = new SearchApi("your-api-key", {
|
|
33
|
+
* engine: "google_news",
|
|
34
|
+
* });
|
|
35
|
+
* const agent = RunnableSequence.from([
|
|
36
|
+
* ChatPromptTemplate.fromMessages([
|
|
37
|
+
* ["ai", "Answer the following questions using a bulleted list markdown format.""],
|
|
38
|
+
* ["human", "{input}"],
|
|
39
|
+
* ]),
|
|
40
|
+
* new ChatOpenAI({ temperature: 0 }),
|
|
41
|
+
* (input: BaseMessageChunk) => ({
|
|
42
|
+
* log: "test",
|
|
43
|
+
* returnValues: {
|
|
44
|
+
* output: input,
|
|
45
|
+
* },
|
|
46
|
+
* }),
|
|
47
|
+
* ]);
|
|
48
|
+
* const executor = AgentExecutor.fromAgentAndTools({
|
|
49
|
+
* agent,
|
|
50
|
+
* tools: [searchApi],
|
|
51
|
+
* });
|
|
52
|
+
* const res = await executor.invoke({
|
|
53
|
+
* input: "What's happening in Ukraine today?"",
|
|
54
|
+
* });
|
|
55
|
+
* console.log(res);
|
|
56
|
+
* ```
|
|
30
57
|
*/
|
|
31
58
|
export declare class SearchApi extends Tool {
|
|
32
59
|
static lc_name(): string;
|
package/dist/tools/searchapi.js
CHANGED
|
@@ -10,6 +10,33 @@ function isJSONObject(value) {
|
|
|
10
10
|
*
|
|
11
11
|
* Ensure you've set the SEARCHAPI_API_KEY environment variable for authentication.
|
|
12
12
|
* You can obtain a free API key from https://www.searchapi.io/.
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const searchApi = new SearchApi("your-api-key", {
|
|
16
|
+
* engine: "google_news",
|
|
17
|
+
* });
|
|
18
|
+
* const agent = RunnableSequence.from([
|
|
19
|
+
* ChatPromptTemplate.fromMessages([
|
|
20
|
+
* ["ai", "Answer the following questions using a bulleted list markdown format.""],
|
|
21
|
+
* ["human", "{input}"],
|
|
22
|
+
* ]),
|
|
23
|
+
* new ChatOpenAI({ temperature: 0 }),
|
|
24
|
+
* (input: BaseMessageChunk) => ({
|
|
25
|
+
* log: "test",
|
|
26
|
+
* returnValues: {
|
|
27
|
+
* output: input,
|
|
28
|
+
* },
|
|
29
|
+
* }),
|
|
30
|
+
* ]);
|
|
31
|
+
* const executor = AgentExecutor.fromAgentAndTools({
|
|
32
|
+
* agent,
|
|
33
|
+
* tools: [searchApi],
|
|
34
|
+
* });
|
|
35
|
+
* const res = await executor.invoke({
|
|
36
|
+
* input: "What's happening in Ukraine today?"",
|
|
37
|
+
* });
|
|
38
|
+
* console.log(res);
|
|
39
|
+
* ```
|
|
13
40
|
*/
|
|
14
41
|
export class SearchApi extends Tool {
|
|
15
42
|
static lc_name() {
|
|
@@ -9,7 +9,26 @@ const base_js_1 = require("./base.cjs");
|
|
|
9
9
|
* The input should be a search query, and the output is a JSON array of the query results.
|
|
10
10
|
*
|
|
11
11
|
* note: works best with *agentType*: `structured-chat-zero-shot-react-description`
|
|
12
|
-
* https://github.com/searxng/searxng
|
|
12
|
+
* https://github.com/searxng/searxng
|
|
13
|
+
* @example
|
|
14
|
+
* ```typescript
|
|
15
|
+
* const executor = AgentExecutor.fromAgentAndTools({
|
|
16
|
+
* agent,
|
|
17
|
+
* tools: [
|
|
18
|
+
* new SearxngSearch({
|
|
19
|
+
* params: {
|
|
20
|
+
* format: "json",
|
|
21
|
+
* engines: "google",
|
|
22
|
+
* },
|
|
23
|
+
* headers: {},
|
|
24
|
+
* }),
|
|
25
|
+
* ],
|
|
26
|
+
* });
|
|
27
|
+
* const result = await executor.invoke({
|
|
28
|
+
* input: `What is Langchain? Describe in 50 words`,
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
13
32
|
class SearxngSearch extends base_js_1.Tool {
|
|
14
33
|
static lc_name() {
|
|
15
34
|
return "SearxngSearch";
|
|
@@ -50,7 +50,26 @@ interface SearxngSearchParams {
|
|
|
50
50
|
* The input should be a search query, and the output is a JSON array of the query results.
|
|
51
51
|
*
|
|
52
52
|
* note: works best with *agentType*: `structured-chat-zero-shot-react-description`
|
|
53
|
-
* https://github.com/searxng/searxng
|
|
53
|
+
* https://github.com/searxng/searxng
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const executor = AgentExecutor.fromAgentAndTools({
|
|
57
|
+
* agent,
|
|
58
|
+
* tools: [
|
|
59
|
+
* new SearxngSearch({
|
|
60
|
+
* params: {
|
|
61
|
+
* format: "json",
|
|
62
|
+
* engines: "google",
|
|
63
|
+
* },
|
|
64
|
+
* headers: {},
|
|
65
|
+
* }),
|
|
66
|
+
* ],
|
|
67
|
+
* });
|
|
68
|
+
* const result = await executor.invoke({
|
|
69
|
+
* input: `What is Langchain? Describe in 50 words`,
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
54
73
|
export declare class SearxngSearch extends Tool {
|
|
55
74
|
static lc_name(): string;
|
|
56
75
|
name: string;
|
|
@@ -6,7 +6,26 @@ import { Tool } from "./base.js";
|
|
|
6
6
|
* The input should be a search query, and the output is a JSON array of the query results.
|
|
7
7
|
*
|
|
8
8
|
* note: works best with *agentType*: `structured-chat-zero-shot-react-description`
|
|
9
|
-
* https://github.com/searxng/searxng
|
|
9
|
+
* https://github.com/searxng/searxng
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* const executor = AgentExecutor.fromAgentAndTools({
|
|
13
|
+
* agent,
|
|
14
|
+
* tools: [
|
|
15
|
+
* new SearxngSearch({
|
|
16
|
+
* params: {
|
|
17
|
+
* format: "json",
|
|
18
|
+
* engines: "google",
|
|
19
|
+
* },
|
|
20
|
+
* headers: {},
|
|
21
|
+
* }),
|
|
22
|
+
* ],
|
|
23
|
+
* });
|
|
24
|
+
* const result = await executor.invoke({
|
|
25
|
+
* input: `What is Langchain? Describe in 50 words`,
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
10
29
|
export class SearxngSearch extends Tool {
|
|
11
30
|
static lc_name() {
|
|
12
31
|
return "SearxngSearch";
|
|
@@ -139,6 +139,14 @@ const DEFAULT_HEADERS = {
|
|
|
139
139
|
* information from them or to summarize their content. It uses the axios
|
|
140
140
|
* library to send HTTP requests and the cheerio library to parse the
|
|
141
141
|
* returned HTML.
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* const browser = new WebBrowser({
|
|
145
|
+
* model: new ChatOpenAI({ temperature: 0 }),
|
|
146
|
+
* embeddings: new OpenAIEmbeddings({}),
|
|
147
|
+
* });
|
|
148
|
+
* const result = await browser.invoke("https:exampleurl.com");
|
|
149
|
+
* ```
|
|
142
150
|
*/
|
|
143
151
|
class WebBrowser extends base_js_1.Tool {
|
|
144
152
|
static lc_name() {
|
|
@@ -27,6 +27,14 @@ export interface WebBrowserArgs extends ToolParams {
|
|
|
27
27
|
* information from them or to summarize their content. It uses the axios
|
|
28
28
|
* library to send HTTP requests and the cheerio library to parse the
|
|
29
29
|
* returned HTML.
|
|
30
|
+
* @example
|
|
31
|
+
* ```typescript
|
|
32
|
+
* const browser = new WebBrowser({
|
|
33
|
+
* model: new ChatOpenAI({ temperature: 0 }),
|
|
34
|
+
* embeddings: new OpenAIEmbeddings({}),
|
|
35
|
+
* });
|
|
36
|
+
* const result = await browser.invoke("https:exampleurl.com");
|
|
37
|
+
* ```
|
|
30
38
|
*/
|
|
31
39
|
export declare class WebBrowser extends Tool {
|
|
32
40
|
static lc_name(): string;
|
package/dist/tools/webbrowser.js
CHANGED
|
@@ -108,6 +108,14 @@ const DEFAULT_HEADERS = {
|
|
|
108
108
|
* information from them or to summarize their content. It uses the axios
|
|
109
109
|
* library to send HTTP requests and the cheerio library to parse the
|
|
110
110
|
* returned HTML.
|
|
111
|
+
* @example
|
|
112
|
+
* ```typescript
|
|
113
|
+
* const browser = new WebBrowser({
|
|
114
|
+
* model: new ChatOpenAI({ temperature: 0 }),
|
|
115
|
+
* embeddings: new OpenAIEmbeddings({}),
|
|
116
|
+
* });
|
|
117
|
+
* const result = await browser.invoke("https:exampleurl.com");
|
|
118
|
+
* ```
|
|
111
119
|
*/
|
|
112
120
|
export class WebBrowser extends Tool {
|
|
113
121
|
static lc_name() {
|
|
@@ -5,6 +5,14 @@ const base_js_1 = require("./base.cjs");
|
|
|
5
5
|
/**
|
|
6
6
|
* Class for interacting with and fetching data from the Wikipedia API. It
|
|
7
7
|
* extends the Tool class.
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* const wikipediaQuery = new WikipediaQueryRun({
|
|
11
|
+
* topKResults: 3,
|
|
12
|
+
* maxDocContentLength: 4000,
|
|
13
|
+
* });
|
|
14
|
+
* const result = await wikipediaQuery.call("Langchain");
|
|
15
|
+
* ```
|
|
8
16
|
*/
|
|
9
17
|
class WikipediaQueryRun extends base_js_1.Tool {
|
|
10
18
|
static lc_name() {
|
|
@@ -16,6 +16,14 @@ type UrlParameters = Record<string, string | number | boolean | undefined | null
|
|
|
16
16
|
/**
|
|
17
17
|
* Class for interacting with and fetching data from the Wikipedia API. It
|
|
18
18
|
* extends the Tool class.
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* const wikipediaQuery = new WikipediaQueryRun({
|
|
22
|
+
* topKResults: 3,
|
|
23
|
+
* maxDocContentLength: 4000,
|
|
24
|
+
* });
|
|
25
|
+
* const result = await wikipediaQuery.call("Langchain");
|
|
26
|
+
* ```
|
|
19
27
|
*/
|
|
20
28
|
export declare class WikipediaQueryRun extends Tool {
|
|
21
29
|
static lc_name(): string;
|