langchain-core 0.3.75__tar.gz → 0.3.76__tar.gz
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.
- langchain_core-0.3.76/PKG-INFO +77 -0
- langchain_core-0.3.76/README.md +59 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/_api/beta_decorator.py +17 -40
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/_api/deprecation.py +19 -6
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/_api/path.py +19 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/_import_utils.py +7 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/agents.py +10 -6
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/beta/runnables/context.py +1 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/callbacks/base.py +11 -4
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/callbacks/manager.py +81 -69
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/callbacks/usage.py +4 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/chat_history.py +4 -6
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/document_loaders/base.py +34 -9
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/document_loaders/langsmith.py +3 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/documents/base.py +35 -10
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/documents/transformers.py +4 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/embeddings/fake.py +8 -5
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/env.py +2 -3
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/example_selectors/base.py +12 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/exceptions.py +7 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/globals.py +17 -28
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/indexing/api.py +56 -44
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/indexing/base.py +5 -8
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/indexing/in_memory.py +23 -3
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/language_models/__init__.py +3 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/language_models/base.py +31 -20
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/language_models/chat_models.py +94 -25
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/language_models/fake_chat_models.py +5 -7
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/language_models/llms.py +49 -17
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/load/dump.py +2 -3
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/load/load.py +15 -1
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/load/serializable.py +38 -43
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/memory.py +7 -3
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/messages/ai.py +36 -19
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/messages/base.py +13 -6
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/messages/content_blocks.py +23 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/messages/human.py +2 -6
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/messages/system.py +2 -6
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/messages/tool.py +33 -13
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/messages/utils.py +182 -72
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/output_parsers/base.py +5 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/output_parsers/json.py +4 -4
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/output_parsers/list.py +7 -22
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/output_parsers/openai_functions.py +3 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/output_parsers/openai_tools.py +6 -1
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/output_parsers/pydantic.py +4 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/output_parsers/string.py +5 -1
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/output_parsers/xml.py +19 -19
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/outputs/chat_generation.py +18 -7
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/outputs/generation.py +14 -3
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/outputs/llm_result.py +8 -1
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompt_values.py +10 -4
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompts/base.py +4 -9
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompts/chat.py +87 -58
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompts/dict.py +16 -8
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompts/few_shot.py +9 -11
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompts/few_shot_with_templates.py +5 -1
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompts/image.py +12 -5
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompts/message.py +5 -6
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompts/pipeline.py +13 -8
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompts/prompt.py +22 -8
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompts/string.py +18 -10
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompts/structured.py +7 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/rate_limiters.py +2 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/retrievers.py +7 -6
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/base.py +402 -183
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/branch.py +14 -19
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/config.py +9 -15
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/configurable.py +34 -19
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/fallbacks.py +20 -13
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/graph.py +44 -37
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/graph_ascii.py +40 -17
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/graph_mermaid.py +27 -15
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/graph_png.py +27 -31
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/history.py +55 -58
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/passthrough.py +44 -21
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/retry.py +9 -5
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/router.py +9 -8
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/schema.py +2 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/utils.py +51 -89
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/stores.py +13 -25
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/sys_info.py +9 -8
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tools/base.py +30 -23
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tools/convert.py +24 -13
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tools/simple.py +35 -3
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tools/structured.py +25 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/base.py +2 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/context.py +5 -1
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/core.py +109 -39
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/evaluation.py +22 -26
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/event_stream.py +40 -27
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/langchain.py +12 -3
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/langchain_v1.py +10 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/log_stream.py +56 -17
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/root_listeners.py +4 -20
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/run_collector.py +6 -16
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/schemas.py +5 -1
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/aiter.py +14 -6
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/env.py +3 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/function_calling.py +37 -20
- langchain_core-0.3.76/langchain_core/utils/interactive_env.py +12 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/iter.py +11 -3
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/json.py +5 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/json_schema.py +15 -5
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/loading.py +5 -1
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/mustache.py +24 -15
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/pydantic.py +32 -4
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/utils.py +24 -8
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/vectorstores/base.py +7 -20
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/vectorstores/in_memory.py +18 -12
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/vectorstores/utils.py +18 -12
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/version.py +1 -1
- {langchain_core-0.3.75 → langchain_core-0.3.76}/pyproject.toml +10 -8
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/_api/test_beta_decorator.py +19 -8
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/conftest.py +1 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/document_loaders/test_base.py +2 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/example_selectors/test_base.py +3 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/indexing/test_in_memory_indexer.py +3 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/indexing/test_indexing.py +8 -12
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/language_models/chat_models/test_cache.py +1 -4
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/language_models/chat_models/test_rate_limiting.py +1 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/load/test_serializable.py +1 -4
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_openai_tools.py +2 -3
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_pydantic_parser.py +0 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/__snapshots__/test_chat.ambr +24 -46
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_chat.py +14 -10
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_loading.py +2 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_prompt.py +54 -6
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_structured.py +2 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/__snapshots__/test_graph.ambr +12 -23
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr +96 -184
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_concurrency.py +1 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_context.py +1 -1
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_fallbacks.py +8 -8
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_history.py +6 -9
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_imports.py +1 -1
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_runnable.py +9 -25
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_runnable_events_v2.py +1 -5
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_tracing_interops.py +8 -3
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/stores/test_in_memory.py +5 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/test_globals.py +4 -5
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/test_messages.py +35 -48
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/test_tools.py +80 -24
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/utils/test_env.py +1 -1
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/utils/test_html.py +11 -11
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/utils/test_pydantic.py +7 -23
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/utils/test_strings.py +1 -1
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/utils/test_usage.py +2 -2
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/utils/test_utils.py +6 -11
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/vectorstores/test_in_memory.py +34 -0
- langchain_core-0.3.75/PKG-INFO +0 -106
- langchain_core-0.3.75/README.md +0 -88
- langchain_core-0.3.75/langchain_core/utils/interactive_env.py +0 -8
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/_api/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/_api/internal.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/beta/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/beta/runnables/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/caches.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/callbacks/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/callbacks/file.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/callbacks/stdout.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/callbacks/streaming_stdout.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/chat_loaders.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/chat_sessions.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/document_loaders/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/document_loaders/blob_loaders.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/documents/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/documents/compressor.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/embeddings/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/embeddings/embeddings.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/example_selectors/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/example_selectors/length_based.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/example_selectors/semantic_similarity.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/indexing/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/language_models/_utils.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/language_models/fake.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/load/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/load/mapping.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/messages/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/messages/chat.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/messages/function.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/messages/modifier.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/output_parsers/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/output_parsers/format_instructions.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/output_parsers/transform.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/outputs/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/outputs/chat_result.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/outputs/run_info.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompts/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/prompts/loading.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/py.typed +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/pydantic_v1/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/pydantic_v1/dataclasses.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/pydantic_v1/main.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/runnables/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/structured_query.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tools/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tools/render.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tools/retriever.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/_streaming.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/memory_stream.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/tracers/stdout.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/_merge.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/formatting.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/html.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/image.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/input.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/strings.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/utils/usage.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/langchain_core/vectorstores/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/benchmarks/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/benchmarks/test_async_callbacks.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/benchmarks/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/integration_tests/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/integration_tests/test_compile.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/_api/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/_api/test_deprecation.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/_api/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/_api/test_path.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/caches/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/caches/test_in_memory_cache.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/callbacks/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/callbacks/test_async_callback_manager.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/callbacks/test_dispatch_custom_event.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/callbacks/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/callbacks/test_sync_callback_manager.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/callbacks/test_usage_callback.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/chat_history/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/chat_history/test_chat_history.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/data/prompt_file.txt +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/data/prompts/prompt_extra_args.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/data/prompts/prompt_missing_args.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/data/prompts/simple_prompt.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/dependencies/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/dependencies/test_dependencies.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/document_loaders/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/document_loaders/test_langsmith.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/documents/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/documents/test_document.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/documents/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/documents/test_str.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/embeddings/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/embeddings/test_deterministic_embedding.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/example_selectors/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/example_selectors/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/example_selectors/test_length_based_example_selector.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/example_selectors/test_similarity.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/example-non-utf8.csv +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/example-non-utf8.txt +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/example-utf8.csv +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/example-utf8.txt +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/example_prompt.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/examples.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/examples.yaml +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/few_shot_prompt.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/few_shot_prompt.yaml +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/few_shot_prompt_example_prompt.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/few_shot_prompt_examples_in.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/few_shot_prompt_yaml_examples.yaml +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/jinja_injection_prompt.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/jinja_injection_prompt.yaml +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/prompt_with_output_parser.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/simple_prompt.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/simple_prompt.yaml +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/simple_prompt_with_template_file.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/examples/simple_template.txt +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/fake/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/fake/callbacks.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/fake/test_fake_chat_model.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/indexing/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/indexing/test_hashed_document.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/indexing/test_in_memory_record_manager.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/indexing/test_public_api.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/language_models/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/language_models/chat_models/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/language_models/chat_models/test_base.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/language_models/chat_models/test_benchmark.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/language_models/llms/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/language_models/llms/test_base.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/language_models/llms/test_cache.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/language_models/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/load/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/load/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/messages/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/messages/test_ai.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/messages/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/messages/test_utils.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_base_parsers.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_json.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_list_parser.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_openai_functions.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_xml_parser.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/outputs/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/outputs/test_chat_generation.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/outputs/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompt_file.txt +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/__snapshots__/test_prompt.ambr +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/prompt_extra_args.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/prompt_missing_args.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/simple_prompt.json +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_dict.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_few_shot.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_few_shot_with_templates.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_image.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_pipeline_prompt.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_utils.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/pydantic_utils.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/rate_limiters/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/rate_limiters/test_in_memory_rate_limiter.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_config.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_configurable.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_graph.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_runnable_events_v1.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_utils.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/stores/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/stubs.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/test_outputs.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/test_prompt_values.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/test_pydantic_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/test_pydantic_serde.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/test_retrievers.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/test_setup.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/test_sys_info.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/tracers/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_async_base_tracer.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_base_tracer.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_langchain.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_memory_stream.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_run_collector.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_schemas.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/utils/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/utils/test_aiter.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/utils/test_function_calling.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/utils/test_imports.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/utils/test_iter.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/utils/test_json_schema.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/utils/test_rm_titles.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/vectorstores/__init__.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/vectorstores/test_utils.py +0 -0
- {langchain_core-0.3.75 → langchain_core-0.3.76}/tests/unit_tests/vectorstores/test_vectorstore.py +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: langchain-core
|
|
3
|
+
Version: 0.3.76
|
|
4
|
+
Summary: Building applications with LLMs through composability
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Source Code, https://github.com/langchain-ai/langchain/tree/master/libs/core
|
|
7
|
+
Project-URL: Release Notes, https://github.com/langchain-ai/langchain/releases?q=tag%3A%22langchain-core%3D%3D0%22&expanded=true
|
|
8
|
+
Project-URL: repository, https://github.com/langchain-ai/langchain
|
|
9
|
+
Requires-Python: >=3.9
|
|
10
|
+
Requires-Dist: langsmith>=0.3.45
|
|
11
|
+
Requires-Dist: tenacity!=8.4.0,<10.0.0,>=8.1.0
|
|
12
|
+
Requires-Dist: jsonpatch<2.0,>=1.33
|
|
13
|
+
Requires-Dist: PyYAML>=5.3
|
|
14
|
+
Requires-Dist: typing-extensions>=4.7
|
|
15
|
+
Requires-Dist: packaging>=23.2
|
|
16
|
+
Requires-Dist: pydantic>=2.7.4
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# 🦜🍎️ LangChain Core
|
|
20
|
+
|
|
21
|
+
[](https://opensource.org/licenses/MIT)
|
|
22
|
+
[](https://pypistats.org/packages/langchain-core)
|
|
23
|
+
|
|
24
|
+
## Quick Install
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install langchain-core
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## What is it?
|
|
31
|
+
|
|
32
|
+
LangChain Core contains the base abstractions that power the the LangChain ecosystem.
|
|
33
|
+
|
|
34
|
+
These abstractions are designed to be as modular and simple as possible.
|
|
35
|
+
|
|
36
|
+
The benefit of having these abstractions is that any provider can implement the required interface and then easily be used in the rest of the LangChain ecosystem.
|
|
37
|
+
|
|
38
|
+
For full documentation see the [API reference](https://python.langchain.com/api_reference/core/index.html).
|
|
39
|
+
|
|
40
|
+
## ⛰️ Why build on top of LangChain Core?
|
|
41
|
+
|
|
42
|
+
The LangChain ecosystem is built on top of `langchain-core`. Some of the benefits:
|
|
43
|
+
|
|
44
|
+
- **Modularity**: We've designed Core around abstractions that are independent of each other, and not tied to any specific model provider.
|
|
45
|
+
- **Stability**: We are committed to a stable versioning scheme, and will communicate any breaking changes with advance notice and version bumps.
|
|
46
|
+
- **Battle-tested**: Core components have the largest install base in the LLM ecosystem, and are used in production by many companies.
|
|
47
|
+
|
|
48
|
+
## 1️⃣ Core Interface: Runnables
|
|
49
|
+
|
|
50
|
+
The concept of a `Runnable` is central to LangChain Core – it is the interface that most LangChain Core components implement, giving them
|
|
51
|
+
|
|
52
|
+
- A common invocation interface (`invoke()`, `batch()`, `stream()`, etc.)
|
|
53
|
+
- Built-in utilities for retries, fallbacks, schemas and runtime configurability
|
|
54
|
+
- Easy deployment with [LangGraph](https://github.com/langchain-ai/langgraph)
|
|
55
|
+
|
|
56
|
+
For more check out the [`Runnable` docs](https://python.langchain.com/docs/concepts/runnables/). Examples of components that implement the interface include: Chat Models, Tools, Retrievers, and Output Parsers.
|
|
57
|
+
|
|
58
|
+
## 📕 Releases & Versioning
|
|
59
|
+
|
|
60
|
+
As `langchain-core` contains the base abstractions and runtime for the whole LangChain ecosystem, we will communicate any breaking changes with advance notice and version bumps. The exception for this is anything in `langchain_core.beta`. The reason for `langchain_core.beta` is that given the rate of change of the field, being able to move quickly is still a priority, and this module is our attempt to do so.
|
|
61
|
+
|
|
62
|
+
Minor version increases will occur for:
|
|
63
|
+
|
|
64
|
+
- Breaking changes for any public interfaces NOT in `langchain_core.beta`
|
|
65
|
+
|
|
66
|
+
Patch version increases will occur for:
|
|
67
|
+
|
|
68
|
+
- Bug fixes
|
|
69
|
+
- New features
|
|
70
|
+
- Any changes to private interfaces
|
|
71
|
+
- Any changes to `langchain_core.beta`
|
|
72
|
+
|
|
73
|
+
## 💁 Contributing
|
|
74
|
+
|
|
75
|
+
As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
|
|
76
|
+
|
|
77
|
+
For detailed information on how to contribute, see the [Contributing Guide](https://python.langchain.com/docs/contributing/).
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# 🦜🍎️ LangChain Core
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://pypistats.org/packages/langchain-core)
|
|
5
|
+
|
|
6
|
+
## Quick Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
pip install langchain-core
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## What is it?
|
|
13
|
+
|
|
14
|
+
LangChain Core contains the base abstractions that power the the LangChain ecosystem.
|
|
15
|
+
|
|
16
|
+
These abstractions are designed to be as modular and simple as possible.
|
|
17
|
+
|
|
18
|
+
The benefit of having these abstractions is that any provider can implement the required interface and then easily be used in the rest of the LangChain ecosystem.
|
|
19
|
+
|
|
20
|
+
For full documentation see the [API reference](https://python.langchain.com/api_reference/core/index.html).
|
|
21
|
+
|
|
22
|
+
## ⛰️ Why build on top of LangChain Core?
|
|
23
|
+
|
|
24
|
+
The LangChain ecosystem is built on top of `langchain-core`. Some of the benefits:
|
|
25
|
+
|
|
26
|
+
- **Modularity**: We've designed Core around abstractions that are independent of each other, and not tied to any specific model provider.
|
|
27
|
+
- **Stability**: We are committed to a stable versioning scheme, and will communicate any breaking changes with advance notice and version bumps.
|
|
28
|
+
- **Battle-tested**: Core components have the largest install base in the LLM ecosystem, and are used in production by many companies.
|
|
29
|
+
|
|
30
|
+
## 1️⃣ Core Interface: Runnables
|
|
31
|
+
|
|
32
|
+
The concept of a `Runnable` is central to LangChain Core – it is the interface that most LangChain Core components implement, giving them
|
|
33
|
+
|
|
34
|
+
- A common invocation interface (`invoke()`, `batch()`, `stream()`, etc.)
|
|
35
|
+
- Built-in utilities for retries, fallbacks, schemas and runtime configurability
|
|
36
|
+
- Easy deployment with [LangGraph](https://github.com/langchain-ai/langgraph)
|
|
37
|
+
|
|
38
|
+
For more check out the [`Runnable` docs](https://python.langchain.com/docs/concepts/runnables/). Examples of components that implement the interface include: Chat Models, Tools, Retrievers, and Output Parsers.
|
|
39
|
+
|
|
40
|
+
## 📕 Releases & Versioning
|
|
41
|
+
|
|
42
|
+
As `langchain-core` contains the base abstractions and runtime for the whole LangChain ecosystem, we will communicate any breaking changes with advance notice and version bumps. The exception for this is anything in `langchain_core.beta`. The reason for `langchain_core.beta` is that given the rate of change of the field, being able to move quickly is still a priority, and this module is our attempt to do so.
|
|
43
|
+
|
|
44
|
+
Minor version increases will occur for:
|
|
45
|
+
|
|
46
|
+
- Breaking changes for any public interfaces NOT in `langchain_core.beta`
|
|
47
|
+
|
|
48
|
+
Patch version increases will occur for:
|
|
49
|
+
|
|
50
|
+
- Bug fixes
|
|
51
|
+
- New features
|
|
52
|
+
- Any changes to private interfaces
|
|
53
|
+
- Any changes to `langchain_core.beta`
|
|
54
|
+
|
|
55
|
+
## 💁 Contributing
|
|
56
|
+
|
|
57
|
+
As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
|
|
58
|
+
|
|
59
|
+
For detailed information on how to contribute, see the [Contributing Guide](https://python.langchain.com/docs/contributing/).
|
|
@@ -63,6 +63,9 @@ def beta(
|
|
|
63
63
|
addendum : str, optional
|
|
64
64
|
Additional text appended directly to the final message.
|
|
65
65
|
|
|
66
|
+
Returns:
|
|
67
|
+
A decorator which can be used to mark functions or classes as beta.
|
|
68
|
+
|
|
66
69
|
Examples:
|
|
67
70
|
|
|
68
71
|
.. code-block:: python
|
|
@@ -153,50 +156,24 @@ def beta(
|
|
|
153
156
|
_name = _name or obj.fget.__qualname__
|
|
154
157
|
old_doc = obj.__doc__
|
|
155
158
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
self,
|
|
161
|
-
fget: Union[Callable[[Any], Any], None] = None,
|
|
162
|
-
fset: Union[Callable[[Any, Any], None], None] = None,
|
|
163
|
-
fdel: Union[Callable[[Any], None], None] = None,
|
|
164
|
-
doc: Union[str, None] = None,
|
|
165
|
-
) -> None:
|
|
166
|
-
super().__init__(fget, fset, fdel, doc)
|
|
167
|
-
self.__orig_fget = fget
|
|
168
|
-
self.__orig_fset = fset
|
|
169
|
-
self.__orig_fdel = fdel
|
|
170
|
-
self.__doc__ = doc
|
|
171
|
-
|
|
172
|
-
def __get__(
|
|
173
|
-
self, instance: Any, owner: Union[type, None] = None
|
|
174
|
-
) -> Any:
|
|
175
|
-
if instance is not None or owner is not None:
|
|
176
|
-
emit_warning()
|
|
177
|
-
return self.fget(instance)
|
|
178
|
-
|
|
179
|
-
def __set__(self, instance: Any, value: Any) -> None:
|
|
180
|
-
if instance is not None:
|
|
181
|
-
emit_warning()
|
|
182
|
-
return self.fset(instance, value)
|
|
159
|
+
def _fget(instance: Any) -> Any:
|
|
160
|
+
if instance is not None:
|
|
161
|
+
emit_warning()
|
|
162
|
+
return obj.fget(instance)
|
|
183
163
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
164
|
+
def _fset(instance: Any, value: Any) -> None:
|
|
165
|
+
if instance is not None:
|
|
166
|
+
emit_warning()
|
|
167
|
+
obj.fset(instance, value)
|
|
188
168
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
169
|
+
def _fdel(instance: Any) -> None:
|
|
170
|
+
if instance is not None:
|
|
171
|
+
emit_warning()
|
|
172
|
+
obj.fdel(instance)
|
|
193
173
|
|
|
194
|
-
def finalize(
|
|
174
|
+
def finalize(_wrapper: Callable[..., Any], new_doc: str) -> Any:
|
|
195
175
|
"""Finalize the property."""
|
|
196
|
-
return
|
|
197
|
-
fget=obj.fget, fset=obj.fset, fdel=obj.fdel, doc=new_doc
|
|
198
|
-
)
|
|
199
|
-
|
|
176
|
+
return property(fget=_fget, fset=_fset, fdel=_fdel, doc=new_doc)
|
|
200
177
|
else:
|
|
201
178
|
_name = _name or obj.__qualname__
|
|
202
179
|
if not _obj_type:
|
|
@@ -129,11 +129,14 @@ def deprecated(
|
|
|
129
129
|
package: str, optional
|
|
130
130
|
The package of the deprecated object.
|
|
131
131
|
|
|
132
|
+
Returns:
|
|
133
|
+
A decorator to mark a function or class as deprecated.
|
|
134
|
+
|
|
132
135
|
Examples:
|
|
133
136
|
|
|
134
137
|
.. code-block:: python
|
|
135
138
|
|
|
136
|
-
@deprecated(
|
|
139
|
+
@deprecated("1.4.0")
|
|
137
140
|
def the_function_to_deprecate():
|
|
138
141
|
pass
|
|
139
142
|
|
|
@@ -358,7 +361,8 @@ def deprecated(
|
|
|
358
361
|
# Modify the docstring to include a deprecation notice.
|
|
359
362
|
if (
|
|
360
363
|
_alternative
|
|
361
|
-
and _alternative.
|
|
364
|
+
and _alternative.rsplit(".", maxsplit=1)[-1].lower()
|
|
365
|
+
== _alternative.rsplit(".", maxsplit=1)[-1]
|
|
362
366
|
):
|
|
363
367
|
_alternative = f":meth:`~{_alternative}`"
|
|
364
368
|
elif _alternative:
|
|
@@ -366,8 +370,8 @@ def deprecated(
|
|
|
366
370
|
|
|
367
371
|
if (
|
|
368
372
|
_alternative_import
|
|
369
|
-
and _alternative_import.
|
|
370
|
-
== _alternative_import.
|
|
373
|
+
and _alternative_import.rsplit(".", maxsplit=1)[-1].lower()
|
|
374
|
+
== _alternative_import.rsplit(".", maxsplit=1)[-1]
|
|
371
375
|
):
|
|
372
376
|
_alternative_import = f":meth:`~{_alternative_import}`"
|
|
373
377
|
elif _alternative_import:
|
|
@@ -471,7 +475,7 @@ def warn_deprecated(
|
|
|
471
475
|
if not message:
|
|
472
476
|
message = ""
|
|
473
477
|
package_ = (
|
|
474
|
-
package or name.split(".")[0].replace("_", "-")
|
|
478
|
+
package or name.split(".", maxsplit=1)[0].replace("_", "-")
|
|
475
479
|
if "." in name
|
|
476
480
|
else "LangChain"
|
|
477
481
|
)
|
|
@@ -490,7 +494,7 @@ def warn_deprecated(
|
|
|
490
494
|
message += f" and will be removed {removal}"
|
|
491
495
|
|
|
492
496
|
if alternative_import:
|
|
493
|
-
alt_package = alternative_import.split(".")[0].replace("_", "-")
|
|
497
|
+
alt_package = alternative_import.split(".", maxsplit=1)[0].replace("_", "-")
|
|
494
498
|
if alt_package == package_:
|
|
495
499
|
message += f". Use {alternative_import} instead."
|
|
496
500
|
else:
|
|
@@ -544,6 +548,15 @@ def rename_parameter(
|
|
|
544
548
|
is passed to *func*, a DeprecationWarning is emitted, and its value is
|
|
545
549
|
used, even if *new* is also passed by keyword.
|
|
546
550
|
|
|
551
|
+
Args:
|
|
552
|
+
since: The version in which the parameter was renamed.
|
|
553
|
+
removal: The version in which the old parameter will be removed.
|
|
554
|
+
old: The old parameter name.
|
|
555
|
+
new: The new parameter name.
|
|
556
|
+
|
|
557
|
+
Returns:
|
|
558
|
+
A decorator indicating that a parameter was renamed.
|
|
559
|
+
|
|
547
560
|
Example:
|
|
548
561
|
|
|
549
562
|
.. code-block:: python
|
|
@@ -12,7 +12,15 @@ SEPARATOR = os.sep
|
|
|
12
12
|
def get_relative_path(
|
|
13
13
|
file: Union[Path, str], *, relative_to: Path = PACKAGE_DIR
|
|
14
14
|
) -> str:
|
|
15
|
-
"""Get the path of the file as a relative path to the package directory.
|
|
15
|
+
"""Get the path of the file as a relative path to the package directory.
|
|
16
|
+
|
|
17
|
+
Args:
|
|
18
|
+
file: The file path to convert.
|
|
19
|
+
relative_to: The base path to make the file path relative to.
|
|
20
|
+
|
|
21
|
+
Returns:
|
|
22
|
+
The relative path as a string.
|
|
23
|
+
"""
|
|
16
24
|
if isinstance(file, str):
|
|
17
25
|
file = Path(file)
|
|
18
26
|
return str(file.relative_to(relative_to))
|
|
@@ -24,7 +32,16 @@ def as_import_path(
|
|
|
24
32
|
suffix: Optional[str] = None,
|
|
25
33
|
relative_to: Path = PACKAGE_DIR,
|
|
26
34
|
) -> str:
|
|
27
|
-
"""Path of the file as a LangChain import exclude langchain top namespace.
|
|
35
|
+
"""Path of the file as a LangChain import exclude langchain top namespace.
|
|
36
|
+
|
|
37
|
+
Args:
|
|
38
|
+
file: The file path to convert.
|
|
39
|
+
suffix: An optional suffix to append to the import path.
|
|
40
|
+
relative_to: The base path to make the file path relative to.
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
The import path as a string.
|
|
44
|
+
"""
|
|
28
45
|
if isinstance(file, str):
|
|
29
46
|
file = Path(file)
|
|
30
47
|
path = get_relative_path(file, relative_to=relative_to)
|
|
@@ -17,6 +17,13 @@ def import_attr(
|
|
|
17
17
|
module_name: The name of the module to import from. If None, the attribute
|
|
18
18
|
is imported from the package itself.
|
|
19
19
|
package: The name of the package where the module is located.
|
|
20
|
+
|
|
21
|
+
Raises:
|
|
22
|
+
ImportError: If the module cannot be found.
|
|
23
|
+
AttributeError: If the attribute does not exist in the module or package.
|
|
24
|
+
|
|
25
|
+
Returns:
|
|
26
|
+
The imported attribute.
|
|
20
27
|
"""
|
|
21
28
|
if module_name == "__module__" or module_name is None:
|
|
22
29
|
try:
|
|
@@ -14,13 +14,15 @@ Agents use language models to choose a sequence of actions to take.
|
|
|
14
14
|
|
|
15
15
|
A basic agent works in the following manner:
|
|
16
16
|
|
|
17
|
-
1. Given a prompt an agent uses an LLM to request an action to take
|
|
17
|
+
1. Given a prompt an agent uses an LLM to request an action to take
|
|
18
|
+
(e.g., a tool to run).
|
|
18
19
|
2. The agent executes the action (e.g., runs the tool), and receives an observation.
|
|
19
|
-
3. The agent returns the observation to the LLM, which can then be used to generate
|
|
20
|
+
3. The agent returns the observation to the LLM, which can then be used to generate
|
|
21
|
+
the next action.
|
|
20
22
|
4. When the agent reaches a stopping condition, it returns a final return value.
|
|
21
23
|
|
|
22
24
|
The schemas for the agents themselves are defined in langchain.agents.agent.
|
|
23
|
-
"""
|
|
25
|
+
"""
|
|
24
26
|
|
|
25
27
|
from __future__ import annotations
|
|
26
28
|
|
|
@@ -84,7 +86,8 @@ class AgentAction(Serializable):
|
|
|
84
86
|
def get_lc_namespace(cls) -> list[str]:
|
|
85
87
|
"""Get the namespace of the langchain object.
|
|
86
88
|
|
|
87
|
-
|
|
89
|
+
Returns:
|
|
90
|
+
``["langchain", "schema", "agent"]``
|
|
88
91
|
"""
|
|
89
92
|
return ["langchain", "schema", "agent"]
|
|
90
93
|
|
|
@@ -153,14 +156,15 @@ class AgentFinish(Serializable):
|
|
|
153
156
|
|
|
154
157
|
@classmethod
|
|
155
158
|
def is_lc_serializable(cls) -> bool:
|
|
156
|
-
"""Return
|
|
159
|
+
"""Return True as this class is serializable."""
|
|
157
160
|
return True
|
|
158
161
|
|
|
159
162
|
@classmethod
|
|
160
163
|
def get_lc_namespace(cls) -> list[str]:
|
|
161
164
|
"""Get the namespace of the langchain object.
|
|
162
165
|
|
|
163
|
-
|
|
166
|
+
Returns:
|
|
167
|
+
``["langchain", "schema", "agent"]``
|
|
164
168
|
"""
|
|
165
169
|
return ["langchain", "schema", "agent"]
|
|
166
170
|
|
|
@@ -344,8 +344,7 @@ class Context:
|
|
|
344
344
|
chain = (
|
|
345
345
|
Context.setter("input")
|
|
346
346
|
| {
|
|
347
|
-
"context": RunnablePassthrough()
|
|
348
|
-
| Context.setter("context"),
|
|
347
|
+
"context": RunnablePassthrough() | Context.setter("context"),
|
|
349
348
|
"question": RunnablePassthrough(),
|
|
350
349
|
}
|
|
351
350
|
| PromptTemplate.from_template("{context} {question}")
|
|
@@ -922,7 +922,7 @@ class BaseCallbackManager(CallbackManagerMixin):
|
|
|
922
922
|
self.inheritable_metadata = inheritable_metadata or {}
|
|
923
923
|
|
|
924
924
|
def copy(self) -> Self:
|
|
925
|
-
"""
|
|
925
|
+
"""Return a copy of the callback manager."""
|
|
926
926
|
return self.__class__(
|
|
927
927
|
handlers=self.handlers.copy(),
|
|
928
928
|
inheritable_handlers=self.inheritable_handlers.copy(),
|
|
@@ -947,11 +947,18 @@ class BaseCallbackManager(CallbackManagerMixin):
|
|
|
947
947
|
|
|
948
948
|
.. code-block:: python
|
|
949
949
|
|
|
950
|
-
from langchain_core.callbacks.manager import
|
|
950
|
+
from langchain_core.callbacks.manager import (
|
|
951
|
+
CallbackManager,
|
|
952
|
+
trace_as_chain_group,
|
|
953
|
+
)
|
|
951
954
|
from langchain_core.callbacks.stdout import StdOutCallbackHandler
|
|
952
955
|
|
|
953
|
-
manager = CallbackManager(
|
|
954
|
-
|
|
956
|
+
manager = CallbackManager(
|
|
957
|
+
handlers=[StdOutCallbackHandler()], tags=["tag2"]
|
|
958
|
+
)
|
|
959
|
+
with trace_as_chain_group(
|
|
960
|
+
"My Group Name", tags=["tag1"]
|
|
961
|
+
) as group_manager:
|
|
955
962
|
merged_manager = group_manager.merge(manager)
|
|
956
963
|
print(merged_manager.handlers)
|
|
957
964
|
# [
|