langchain-core 1.0.0rc3__tar.gz → 1.0.5__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-1.0.0rc3 → langchain_core-1.0.5}/.gitignore +2 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/PKG-INFO +9 -8
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/README.md +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/agents.py +41 -34
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/caches.py +16 -7
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/callbacks/base.py +1 -6
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/callbacks/manager.py +19 -13
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/callbacks/usage.py +4 -4
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/chat_history.py +5 -5
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/document_loaders/base.py +6 -4
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/document_loaders/blob_loaders.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/document_loaders/langsmith.py +9 -13
- langchain_core-1.0.5/langchain_core/documents/__init__.py +54 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/documents/base.py +78 -67
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/documents/compressor.py +6 -6
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/documents/transformers.py +6 -6
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/embeddings/fake.py +2 -2
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/example_selectors/length_based.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/example_selectors/semantic_similarity.py +7 -7
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/exceptions.py +14 -12
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/indexing/__init__.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/indexing/api.py +79 -76
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/indexing/base.py +20 -22
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/indexing/in_memory.py +2 -4
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/language_models/__init__.py +6 -5
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/language_models/_utils.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/language_models/base.py +55 -26
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/language_models/chat_models.py +164 -101
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/language_models/fake_chat_models.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/language_models/llms.py +84 -52
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/load/dump.py +6 -8
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/load/load.py +15 -9
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/load/serializable.py +4 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/__init__.py +9 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/ai.py +13 -9
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/base.py +8 -3
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/block_translators/__init__.py +2 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/block_translators/google_genai.py +5 -3
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/block_translators/openai.py +2 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/content.py +6 -6
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/utils.py +29 -25
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/output_parsers/__init__.py +17 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/output_parsers/base.py +3 -0
- langchain_core-1.0.5/langchain_core/output_parsers/format_instructions.py +16 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/output_parsers/json.py +5 -2
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/output_parsers/list.py +16 -16
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/output_parsers/openai_tools.py +16 -4
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/output_parsers/pydantic.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/output_parsers/string.py +3 -3
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/output_parsers/xml.py +28 -25
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/outputs/chat_generation.py +4 -2
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/outputs/generation.py +8 -8
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/prompt_values.py +2 -8
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/prompts/base.py +54 -47
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/prompts/chat.py +94 -79
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/prompts/dict.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/prompts/message.py +5 -5
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/prompts/string.py +9 -4
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/prompts/structured.py +12 -8
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/retrievers.py +41 -37
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/base.py +123 -82
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/branch.py +30 -28
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/config.py +2 -4
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/configurable.py +33 -32
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/fallbacks.py +24 -22
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/graph.py +8 -5
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/graph_ascii.py +2 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/graph_mermaid.py +4 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/graph_png.py +28 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/history.py +43 -32
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/passthrough.py +35 -25
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/retry.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/router.py +5 -5
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/schema.py +3 -6
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/utils.py +6 -5
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/stores.py +4 -6
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/sys_info.py +4 -2
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tools/base.py +139 -70
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tools/convert.py +39 -26
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tools/retriever.py +6 -5
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tools/structured.py +7 -5
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/core.py +6 -6
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/event_stream.py +4 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/log_stream.py +6 -3
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/function_calling.py +19 -7
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/input.py +3 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/json.py +4 -2
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/json_schema.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/pydantic.py +5 -4
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/strings.py +1 -4
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/utils.py +12 -5
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/vectorstores/base.py +136 -136
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/vectorstores/in_memory.py +5 -6
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/vectorstores/utils.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/version.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/pyproject.toml +22 -16
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/callbacks/test_async_callback_manager.py +62 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/indexing/test_hashed_document.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/indexing/test_indexing.py +6 -6
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/language_models/chat_models/test_base.py +108 -0
- langchain_core-1.0.5/tests/unit_tests/messages/block_translators/test_groq.py +140 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/messages/test_imports.py +3 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/output_parsers/test_openai_tools.py +459 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/output_parsers/test_pydantic_parser.py +29 -14
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/__snapshots__/test_chat.ambr +22 -32
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/test_chat.py +347 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/pydantic_utils.py +20 -27
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/__snapshots__/test_graph.ambr +11 -16
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr +88 -128
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/test_concurrency.py +4 -2
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/test_fallbacks.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/test_history.py +0 -4
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/test_runnable.py +45 -5
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/test_runnable_events_v1.py +3 -3
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/test_runnable_events_v2.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/test_tracing_interops.py +8 -4
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/test_tools.py +281 -12
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/tracers/test_memory_stream.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/utils/test_function_calling.py +13 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/utils/test_pydantic.py +6 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/utils/test_strings.py +1 -1
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/utils/test_utils.py +9 -2
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/vectorstores/test_vectorstore.py +5 -5
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/uv.lock +155 -88
- langchain_core-1.0.0rc3/langchain_core/documents/__init__.py +0 -33
- langchain_core-1.0.0rc3/langchain_core/output_parsers/format_instructions.py +0 -11
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/Makefile +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/extended_testing_deps.txt +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/_api/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/_api/beta_decorator.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/_api/deprecation.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/_api/internal.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/_api/path.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/_import_utils.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/callbacks/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/callbacks/file.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/callbacks/stdout.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/callbacks/streaming_stdout.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/chat_loaders.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/chat_sessions.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/document_loaders/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/embeddings/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/embeddings/embeddings.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/env.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/example_selectors/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/example_selectors/base.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/globals.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/language_models/fake.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/load/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/load/mapping.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/block_translators/anthropic.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/block_translators/bedrock.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/block_translators/bedrock_converse.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/block_translators/google_vertexai.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/block_translators/groq.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/block_translators/langchain_v0.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/chat.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/function.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/human.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/modifier.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/system.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/messages/tool.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/output_parsers/openai_functions.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/output_parsers/transform.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/outputs/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/outputs/chat_result.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/outputs/llm_result.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/outputs/run_info.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/prompts/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/prompts/few_shot.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/prompts/few_shot_with_templates.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/prompts/image.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/prompts/loading.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/prompts/prompt.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/py.typed +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/rate_limiters.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/runnables/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/structured_query.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tools/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tools/render.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tools/simple.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/_streaming.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/base.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/context.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/evaluation.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/langchain.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/memory_stream.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/root_listeners.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/run_collector.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/schemas.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/tracers/stdout.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/_merge.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/aiter.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/env.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/formatting.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/html.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/image.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/interactive_env.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/iter.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/mustache.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/utils/usage.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/vectorstores/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/scripts/check_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/scripts/lint_imports.sh +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/benchmarks/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/benchmarks/test_async_callbacks.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/benchmarks/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/integration_tests/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/integration_tests/test_compile.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/_api/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/_api/test_beta_decorator.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/_api/test_deprecation.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/_api/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/_api/test_path.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/caches/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/caches/test_in_memory_cache.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/callbacks/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/callbacks/test_dispatch_custom_event.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/callbacks/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/callbacks/test_sync_callback_manager.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/callbacks/test_usage_callback.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/chat_history/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/chat_history/test_chat_history.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/conftest.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/data/prompt_file.txt +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/data/prompts/prompt_extra_args.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/data/prompts/prompt_missing_args.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/data/prompts/simple_prompt.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/dependencies/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/dependencies/test_dependencies.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/document_loaders/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/document_loaders/test_base.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/document_loaders/test_langsmith.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/documents/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/documents/test_document.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/documents/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/documents/test_str.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/embeddings/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/embeddings/test_deterministic_embedding.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/example_selectors/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/example_selectors/test_base.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/example_selectors/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/example_selectors/test_length_based_example_selector.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/example_selectors/test_similarity.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/example-non-utf8.csv +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/example-non-utf8.txt +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/example-utf8.csv +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/example-utf8.txt +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/example_prompt.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/examples.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/examples.yaml +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/few_shot_prompt.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/few_shot_prompt.yaml +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/few_shot_prompt_example_prompt.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/few_shot_prompt_examples_in.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/few_shot_prompt_yaml_examples.yaml +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/jinja_injection_prompt.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/jinja_injection_prompt.yaml +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/prompt_with_output_parser.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/simple_prompt.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/simple_prompt.yaml +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/simple_prompt_with_template_file.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/examples/simple_template.txt +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/fake/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/fake/callbacks.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/fake/test_fake_chat_model.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/indexing/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/indexing/test_in_memory_indexer.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/indexing/test_in_memory_record_manager.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/indexing/test_public_api.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/language_models/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/language_models/chat_models/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/language_models/chat_models/test_benchmark.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/language_models/chat_models/test_cache.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/language_models/chat_models/test_rate_limiting.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/language_models/llms/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/language_models/llms/test_base.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/language_models/llms/test_cache.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/language_models/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/load/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/load/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/load/test_serializable.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/messages/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/messages/block_translators/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/messages/block_translators/test_anthropic.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/messages/block_translators/test_bedrock.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/messages/block_translators/test_bedrock_converse.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/messages/block_translators/test_langchain_v0.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/messages/block_translators/test_openai.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/messages/block_translators/test_registration.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/messages/test_ai.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/messages/test_utils.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/output_parsers/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/output_parsers/test_base_parsers.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/output_parsers/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/output_parsers/test_json.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/output_parsers/test_list_parser.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/output_parsers/test_openai_functions.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/output_parsers/test_xml_parser.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/outputs/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/outputs/test_chat_generation.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/outputs/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompt_file.txt +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/__snapshots__/test_prompt.ambr +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/prompt_extra_args.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/prompt_missing_args.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/simple_prompt.json +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/test_dict.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/test_few_shot.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/test_few_shot_with_templates.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/test_image.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/test_loading.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/test_prompt.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/test_string.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/test_structured.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/prompts/test_utils.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/rate_limiters/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/rate_limiters/test_in_memory_rate_limiter.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/test_config.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/test_configurable.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/test_graph.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/runnables/test_utils.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/stores/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/stores/test_in_memory.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/stubs.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/test_globals.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/test_messages.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/test_outputs.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/test_prompt_values.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/test_pydantic_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/test_pydantic_serde.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/test_retrievers.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/test_setup.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/test_sys_info.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/tracers/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/tracers/test_async_base_tracer.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/tracers/test_base_tracer.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/tracers/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/tracers/test_langchain.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/tracers/test_run_collector.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/tracers/test_schemas.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/utils/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/utils/test_aiter.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/utils/test_env.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/utils/test_html.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/utils/test_imports.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/utils/test_iter.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/utils/test_json_schema.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/utils/test_rm_titles.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/utils/test_usage.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/vectorstores/__init__.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/vectorstores/test_in_memory.py +0 -0
- {langchain_core-1.0.0rc3 → langchain_core-1.0.5}/tests/unit_tests/vectorstores/test_utils.py +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langchain-core
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.5
|
|
4
4
|
Summary: Building applications with LLMs through composability
|
|
5
|
-
Project-URL:
|
|
6
|
-
Project-URL:
|
|
7
|
-
Project-URL:
|
|
8
|
-
Project-URL:
|
|
9
|
-
Project-URL:
|
|
10
|
-
Project-URL:
|
|
5
|
+
Project-URL: Homepage, https://docs.langchain.com/
|
|
6
|
+
Project-URL: Documentation, https://reference.langchain.com/python/langchain_core/
|
|
7
|
+
Project-URL: Source, https://github.com/langchain-ai/langchain/tree/master/libs/core
|
|
8
|
+
Project-URL: Changelog, https://github.com/langchain-ai/langchain/releases?q=%22langchain-core%3D%3D1%22
|
|
9
|
+
Project-URL: Twitter, https://x.com/LangChainAI
|
|
10
|
+
Project-URL: Slack, https://www.langchain.com/join-community
|
|
11
|
+
Project-URL: Reddit, https://www.reddit.com/r/LangChain/
|
|
11
12
|
License: MIT
|
|
12
13
|
Requires-Python: <4.0.0,>=3.10.0
|
|
13
14
|
Requires-Dist: jsonpatch<2.0.0,>=1.33.0
|
|
@@ -55,7 +56,7 @@ The LangChain ecosystem is built on top of `langchain-core`. Some of the benefit
|
|
|
55
56
|
|
|
56
57
|
## 📖 Documentation
|
|
57
58
|
|
|
58
|
-
For full documentation, see the [API reference](https://reference.langchain.com/python/langchain_core/).
|
|
59
|
+
For full documentation, see the [API reference](https://reference.langchain.com/python/langchain_core/). For conceptual guides, tutorials, and examples on using LangChain, see the [LangChain Docs](https://docs.langchain.com/oss/python/langchain/overview).
|
|
59
60
|
|
|
60
61
|
## 📕 Releases & Versioning
|
|
61
62
|
|
|
@@ -34,7 +34,7 @@ The LangChain ecosystem is built on top of `langchain-core`. Some of the benefit
|
|
|
34
34
|
|
|
35
35
|
## 📖 Documentation
|
|
36
36
|
|
|
37
|
-
For full documentation, see the [API reference](https://reference.langchain.com/python/langchain_core/).
|
|
37
|
+
For full documentation, see the [API reference](https://reference.langchain.com/python/langchain_core/). For conceptual guides, tutorials, and examples on using LangChain, see the [LangChain Docs](https://docs.langchain.com/oss/python/langchain/overview).
|
|
38
38
|
|
|
39
39
|
## 📕 Releases & Versioning
|
|
40
40
|
|
|
@@ -5,12 +5,10 @@
|
|
|
5
5
|
|
|
6
6
|
!!! warning
|
|
7
7
|
New agents should be built using the
|
|
8
|
-
[
|
|
8
|
+
[`langchain` library](https://pypi.org/project/langchain/), which provides a
|
|
9
9
|
simpler and more flexible way to define agents.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
[migration guide](https://python.langchain.com/docs/how_to/migrate_agent/) for
|
|
13
|
-
information on how to migrate existing agents to modern langgraph agents.
|
|
11
|
+
See docs on [building agents](https://docs.langchain.com/oss/python/langchain/agents).
|
|
14
12
|
|
|
15
13
|
Agents use language models to choose a sequence of actions to take.
|
|
16
14
|
|
|
@@ -54,31 +52,33 @@ class AgentAction(Serializable):
|
|
|
54
52
|
"""The input to pass in to the Tool."""
|
|
55
53
|
log: str
|
|
56
54
|
"""Additional information to log about the action.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
|
|
56
|
+
This log can be used in a few ways. First, it can be used to audit what exactly the
|
|
57
|
+
LLM predicted to lead to this `(tool, tool_input)`.
|
|
58
|
+
|
|
59
|
+
Second, it can be used in future iterations to show the LLMs prior thoughts. This is
|
|
60
|
+
useful when `(tool, tool_input)` does not contain full information about the LLM
|
|
61
|
+
prediction (for example, any `thought` before the tool/tool_input).
|
|
62
|
+
"""
|
|
63
63
|
type: Literal["AgentAction"] = "AgentAction"
|
|
64
64
|
|
|
65
65
|
# Override init to support instantiation by position for backward compat.
|
|
66
66
|
def __init__(self, tool: str, tool_input: str | dict, log: str, **kwargs: Any):
|
|
67
|
-
"""Create an AgentAction
|
|
67
|
+
"""Create an `AgentAction`.
|
|
68
68
|
|
|
69
69
|
Args:
|
|
70
70
|
tool: The name of the tool to execute.
|
|
71
|
-
tool_input: The input to pass in to the Tool
|
|
71
|
+
tool_input: The input to pass in to the `Tool`.
|
|
72
72
|
log: Additional information to log about the action.
|
|
73
73
|
"""
|
|
74
74
|
super().__init__(tool=tool, tool_input=tool_input, log=log, **kwargs)
|
|
75
75
|
|
|
76
76
|
@classmethod
|
|
77
77
|
def is_lc_serializable(cls) -> bool:
|
|
78
|
-
"""AgentAction is serializable.
|
|
78
|
+
"""`AgentAction` is serializable.
|
|
79
79
|
|
|
80
80
|
Returns:
|
|
81
|
-
True
|
|
81
|
+
`True`
|
|
82
82
|
"""
|
|
83
83
|
return True
|
|
84
84
|
|
|
@@ -100,19 +100,23 @@ class AgentAction(Serializable):
|
|
|
100
100
|
class AgentActionMessageLog(AgentAction):
|
|
101
101
|
"""Representation of an action to be executed by an agent.
|
|
102
102
|
|
|
103
|
-
This is similar to AgentAction
|
|
104
|
-
chat messages.
|
|
105
|
-
|
|
103
|
+
This is similar to `AgentAction`, but includes a message log consisting of
|
|
104
|
+
chat messages.
|
|
105
|
+
|
|
106
|
+
This is useful when working with `ChatModels`, and is used to reconstruct
|
|
107
|
+
conversation history from the agent's perspective.
|
|
106
108
|
"""
|
|
107
109
|
|
|
108
110
|
message_log: Sequence[BaseMessage]
|
|
109
|
-
"""Similar to log, this can be used to pass along extra
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (tool, tool_input) cannot be used to fully recreate the
|
|
113
|
-
prediction, and you need that LLM prediction (for future agent iteration).
|
|
111
|
+
"""Similar to log, this can be used to pass along extra information about what exact
|
|
112
|
+
messages were predicted by the LLM before parsing out the `(tool, tool_input)`.
|
|
113
|
+
|
|
114
|
+
This is again useful if `(tool, tool_input)` cannot be used to fully recreate the
|
|
115
|
+
LLM prediction, and you need that LLM prediction (for future agent iteration).
|
|
116
|
+
|
|
114
117
|
Compared to `log`, this is useful when the underlying LLM is a
|
|
115
|
-
chat model (and therefore returns messages rather than a string).
|
|
118
|
+
chat model (and therefore returns messages rather than a string).
|
|
119
|
+
"""
|
|
116
120
|
# Ignoring type because we're overriding the type from AgentAction.
|
|
117
121
|
# And this is the correct thing to do in this case.
|
|
118
122
|
# The type literal is used for serialization purposes.
|
|
@@ -120,12 +124,12 @@ class AgentActionMessageLog(AgentAction):
|
|
|
120
124
|
|
|
121
125
|
|
|
122
126
|
class AgentStep(Serializable):
|
|
123
|
-
"""Result of running an AgentAction
|
|
127
|
+
"""Result of running an `AgentAction`."""
|
|
124
128
|
|
|
125
129
|
action: AgentAction
|
|
126
|
-
"""The AgentAction that was executed."""
|
|
130
|
+
"""The `AgentAction` that was executed."""
|
|
127
131
|
observation: Any
|
|
128
|
-
"""The result of the AgentAction
|
|
132
|
+
"""The result of the `AgentAction`."""
|
|
129
133
|
|
|
130
134
|
@property
|
|
131
135
|
def messages(self) -> Sequence[BaseMessage]:
|
|
@@ -134,19 +138,22 @@ class AgentStep(Serializable):
|
|
|
134
138
|
|
|
135
139
|
|
|
136
140
|
class AgentFinish(Serializable):
|
|
137
|
-
"""Final return value of an ActionAgent
|
|
141
|
+
"""Final return value of an `ActionAgent`.
|
|
138
142
|
|
|
139
|
-
Agents return an AgentFinish when they have reached a stopping condition.
|
|
143
|
+
Agents return an `AgentFinish` when they have reached a stopping condition.
|
|
140
144
|
"""
|
|
141
145
|
|
|
142
146
|
return_values: dict
|
|
143
147
|
"""Dictionary of return values."""
|
|
144
148
|
log: str
|
|
145
149
|
"""Additional information to log about the return value.
|
|
150
|
+
|
|
146
151
|
This is used to pass along the full LLM prediction, not just the parsed out
|
|
147
|
-
return value.
|
|
148
|
-
|
|
149
|
-
|
|
152
|
+
return value.
|
|
153
|
+
|
|
154
|
+
For example, if the full LLM prediction was `Final Answer: 2` you may want to just
|
|
155
|
+
return `2` as a return value, but pass along the full string as a `log` (for
|
|
156
|
+
debugging or observability purposes).
|
|
150
157
|
"""
|
|
151
158
|
type: Literal["AgentFinish"] = "AgentFinish"
|
|
152
159
|
|
|
@@ -156,7 +163,7 @@ class AgentFinish(Serializable):
|
|
|
156
163
|
|
|
157
164
|
@classmethod
|
|
158
165
|
def is_lc_serializable(cls) -> bool:
|
|
159
|
-
"""Return True as this class is serializable."""
|
|
166
|
+
"""Return `True` as this class is serializable."""
|
|
160
167
|
return True
|
|
161
168
|
|
|
162
169
|
@classmethod
|
|
@@ -204,7 +211,7 @@ def _convert_agent_observation_to_messages(
|
|
|
204
211
|
observation: Observation to convert to a message.
|
|
205
212
|
|
|
206
213
|
Returns:
|
|
207
|
-
AIMessage that corresponds to the original tool invocation.
|
|
214
|
+
`AIMessage` that corresponds to the original tool invocation.
|
|
208
215
|
"""
|
|
209
216
|
if isinstance(agent_action, AgentActionMessageLog):
|
|
210
217
|
return [_create_function_message(agent_action, observation)]
|
|
@@ -227,7 +234,7 @@ def _create_function_message(
|
|
|
227
234
|
observation: the result of the tool invocation.
|
|
228
235
|
|
|
229
236
|
Returns:
|
|
230
|
-
FunctionMessage that corresponds to the original tool invocation.
|
|
237
|
+
`FunctionMessage` that corresponds to the original tool invocation.
|
|
231
238
|
"""
|
|
232
239
|
if not isinstance(observation, str):
|
|
233
240
|
try:
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
"""
|
|
1
|
+
"""Optional caching layer for language models.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
Distinct from provider-based [prompt caching](https://docs.langchain.com/oss/python/langchain/models#prompt-caching).
|
|
4
|
+
|
|
5
|
+
!!! warning "Beta feature"
|
|
6
|
+
This is a beta feature. Please be wary of deploying experimental code to production
|
|
5
7
|
unless you've taken appropriate precautions.
|
|
6
8
|
|
|
7
9
|
A cache is useful for two reasons:
|
|
@@ -47,17 +49,18 @@ class BaseCache(ABC):
|
|
|
47
49
|
"""Look up based on `prompt` and `llm_string`.
|
|
48
50
|
|
|
49
51
|
A cache implementation is expected to generate a key from the 2-tuple
|
|
50
|
-
of prompt and llm_string (e.g., by concatenating them with a delimiter).
|
|
52
|
+
of `prompt` and `llm_string` (e.g., by concatenating them with a delimiter).
|
|
51
53
|
|
|
52
54
|
Args:
|
|
53
55
|
prompt: A string representation of the prompt.
|
|
54
56
|
In the case of a chat model, the prompt is a non-trivial
|
|
55
57
|
serialization of the prompt into the language model.
|
|
56
58
|
llm_string: A string representation of the LLM configuration.
|
|
59
|
+
|
|
57
60
|
This is used to capture the invocation parameters of the LLM
|
|
58
61
|
(e.g., model name, temperature, stop tokens, max tokens, etc.).
|
|
59
|
-
|
|
60
|
-
representation.
|
|
62
|
+
|
|
63
|
+
These invocation parameters are serialized into a string representation.
|
|
61
64
|
|
|
62
65
|
Returns:
|
|
63
66
|
On a cache miss, return `None`. On a cache hit, return the cached value.
|
|
@@ -76,8 +79,10 @@ class BaseCache(ABC):
|
|
|
76
79
|
In the case of a chat model, the prompt is a non-trivial
|
|
77
80
|
serialization of the prompt into the language model.
|
|
78
81
|
llm_string: A string representation of the LLM configuration.
|
|
82
|
+
|
|
79
83
|
This is used to capture the invocation parameters of the LLM
|
|
80
84
|
(e.g., model name, temperature, stop tokens, max tokens, etc.).
|
|
85
|
+
|
|
81
86
|
These invocation parameters are serialized into a string
|
|
82
87
|
representation.
|
|
83
88
|
return_val: The value to be cached. The value is a list of `Generation`
|
|
@@ -92,15 +97,17 @@ class BaseCache(ABC):
|
|
|
92
97
|
"""Async look up based on `prompt` and `llm_string`.
|
|
93
98
|
|
|
94
99
|
A cache implementation is expected to generate a key from the 2-tuple
|
|
95
|
-
of prompt and llm_string (e.g., by concatenating them with a delimiter).
|
|
100
|
+
of `prompt` and `llm_string` (e.g., by concatenating them with a delimiter).
|
|
96
101
|
|
|
97
102
|
Args:
|
|
98
103
|
prompt: A string representation of the prompt.
|
|
99
104
|
In the case of a chat model, the prompt is a non-trivial
|
|
100
105
|
serialization of the prompt into the language model.
|
|
101
106
|
llm_string: A string representation of the LLM configuration.
|
|
107
|
+
|
|
102
108
|
This is used to capture the invocation parameters of the LLM
|
|
103
109
|
(e.g., model name, temperature, stop tokens, max tokens, etc.).
|
|
110
|
+
|
|
104
111
|
These invocation parameters are serialized into a string
|
|
105
112
|
representation.
|
|
106
113
|
|
|
@@ -123,8 +130,10 @@ class BaseCache(ABC):
|
|
|
123
130
|
In the case of a chat model, the prompt is a non-trivial
|
|
124
131
|
serialization of the prompt into the language model.
|
|
125
132
|
llm_string: A string representation of the LLM configuration.
|
|
133
|
+
|
|
126
134
|
This is used to capture the invocation parameters of the LLM
|
|
127
135
|
(e.g., model name, temperature, stop tokens, max tokens, etc.).
|
|
136
|
+
|
|
128
137
|
These invocation parameters are serialized into a string
|
|
129
138
|
representation.
|
|
130
139
|
return_val: The value to be cached. The value is a list of `Generation`
|
|
@@ -5,13 +5,12 @@ from __future__ import annotations
|
|
|
5
5
|
import logging
|
|
6
6
|
from typing import TYPE_CHECKING, Any
|
|
7
7
|
|
|
8
|
-
from typing_extensions import Self
|
|
9
|
-
|
|
10
8
|
if TYPE_CHECKING:
|
|
11
9
|
from collections.abc import Sequence
|
|
12
10
|
from uuid import UUID
|
|
13
11
|
|
|
14
12
|
from tenacity import RetryCallState
|
|
13
|
+
from typing_extensions import Self
|
|
15
14
|
|
|
16
15
|
from langchain_core.agents import AgentAction, AgentFinish
|
|
17
16
|
from langchain_core.documents import Document
|
|
@@ -420,8 +419,6 @@ class RunManagerMixin:
|
|
|
420
419
|
(includes inherited tags).
|
|
421
420
|
metadata: The metadata associated with the custom event
|
|
422
421
|
(includes inherited metadata).
|
|
423
|
-
|
|
424
|
-
!!! version-added "Added in version 0.2.15"
|
|
425
422
|
"""
|
|
426
423
|
|
|
427
424
|
|
|
@@ -882,8 +879,6 @@ class AsyncCallbackHandler(BaseCallbackHandler):
|
|
|
882
879
|
(includes inherited tags).
|
|
883
880
|
metadata: The metadata associated with the custom event
|
|
884
881
|
(includes inherited metadata).
|
|
885
|
-
|
|
886
|
-
!!! version-added "Added in version 0.2.15"
|
|
887
882
|
"""
|
|
888
883
|
|
|
889
884
|
|
|
@@ -39,7 +39,6 @@ from langchain_core.tracers.context import (
|
|
|
39
39
|
tracing_v2_callback_var,
|
|
40
40
|
)
|
|
41
41
|
from langchain_core.tracers.langchain import LangChainTracer
|
|
42
|
-
from langchain_core.tracers.schemas import Run
|
|
43
42
|
from langchain_core.tracers.stdout import ConsoleCallbackHandler
|
|
44
43
|
from langchain_core.utils.env import env_var_is_set
|
|
45
44
|
|
|
@@ -52,6 +51,7 @@ if TYPE_CHECKING:
|
|
|
52
51
|
from langchain_core.documents import Document
|
|
53
52
|
from langchain_core.outputs import ChatGenerationChunk, GenerationChunk, LLMResult
|
|
54
53
|
from langchain_core.runnables.config import RunnableConfig
|
|
54
|
+
from langchain_core.tracers.schemas import Run
|
|
55
55
|
|
|
56
56
|
logger = logging.getLogger(__name__)
|
|
57
57
|
|
|
@@ -229,7 +229,24 @@ def shielded(func: Func) -> Func:
|
|
|
229
229
|
|
|
230
230
|
@functools.wraps(func)
|
|
231
231
|
async def wrapped(*args: Any, **kwargs: Any) -> Any:
|
|
232
|
-
|
|
232
|
+
# Capture the current context to preserve context variables
|
|
233
|
+
ctx = copy_context()
|
|
234
|
+
|
|
235
|
+
# Create the coroutine
|
|
236
|
+
coro = func(*args, **kwargs)
|
|
237
|
+
|
|
238
|
+
# For Python 3.11+, create task with explicit context
|
|
239
|
+
# For older versions, fallback to original behavior
|
|
240
|
+
try:
|
|
241
|
+
# Create a task with the captured context to preserve context variables
|
|
242
|
+
task = asyncio.create_task(coro, context=ctx) # type: ignore[call-arg, unused-ignore]
|
|
243
|
+
# `call-arg` used to not fail 3.9 or 3.10 tests
|
|
244
|
+
return await asyncio.shield(task)
|
|
245
|
+
except TypeError:
|
|
246
|
+
# Python < 3.11 fallback - create task normally then shield
|
|
247
|
+
# This won't preserve context perfectly but is better than nothing
|
|
248
|
+
task = asyncio.create_task(coro)
|
|
249
|
+
return await asyncio.shield(task)
|
|
233
250
|
|
|
234
251
|
return cast("Func", wrapped)
|
|
235
252
|
|
|
@@ -1566,9 +1583,6 @@ class CallbackManager(BaseCallbackManager):
|
|
|
1566
1583
|
|
|
1567
1584
|
Raises:
|
|
1568
1585
|
ValueError: If additional keyword arguments are passed.
|
|
1569
|
-
|
|
1570
|
-
!!! version-added "Added in version 0.2.14"
|
|
1571
|
-
|
|
1572
1586
|
"""
|
|
1573
1587
|
if not self.handlers:
|
|
1574
1588
|
return
|
|
@@ -2042,8 +2056,6 @@ class AsyncCallbackManager(BaseCallbackManager):
|
|
|
2042
2056
|
|
|
2043
2057
|
Raises:
|
|
2044
2058
|
ValueError: If additional keyword arguments are passed.
|
|
2045
|
-
|
|
2046
|
-
!!! version-added "Added in version 0.2.14"
|
|
2047
2059
|
"""
|
|
2048
2060
|
if not self.handlers:
|
|
2049
2061
|
return
|
|
@@ -2555,9 +2567,6 @@ async def adispatch_custom_event(
|
|
|
2555
2567
|
This is due to a limitation in asyncio for python <= 3.10 that prevents
|
|
2556
2568
|
LangChain from automatically propagating the config object on the user's
|
|
2557
2569
|
behalf.
|
|
2558
|
-
|
|
2559
|
-
!!! version-added "Added in version 0.2.15"
|
|
2560
|
-
|
|
2561
2570
|
"""
|
|
2562
2571
|
# Import locally to prevent circular imports.
|
|
2563
2572
|
from langchain_core.runnables.config import ( # noqa: PLC0415
|
|
@@ -2630,9 +2639,6 @@ def dispatch_custom_event(
|
|
|
2630
2639
|
foo_ = RunnableLambda(foo)
|
|
2631
2640
|
foo_.invoke({"a": "1"}, {"callbacks": [CustomCallbackManager()]})
|
|
2632
2641
|
```
|
|
2633
|
-
|
|
2634
|
-
!!! version-added "Added in version 0.2.15"
|
|
2635
|
-
|
|
2636
2642
|
"""
|
|
2637
2643
|
# Import locally to prevent circular imports.
|
|
2638
2644
|
from langchain_core.runnables.config import ( # noqa: PLC0415
|
|
@@ -24,7 +24,7 @@ class UsageMetadataCallbackHandler(BaseCallbackHandler):
|
|
|
24
24
|
from langchain_core.callbacks import UsageMetadataCallbackHandler
|
|
25
25
|
|
|
26
26
|
llm_1 = init_chat_model(model="openai:gpt-4o-mini")
|
|
27
|
-
llm_2 = init_chat_model(model="anthropic:claude-3-5-haiku-
|
|
27
|
+
llm_2 = init_chat_model(model="anthropic:claude-3-5-haiku-20241022")
|
|
28
28
|
|
|
29
29
|
callback = UsageMetadataCallbackHandler()
|
|
30
30
|
result_1 = llm_1.invoke("Hello", config={"callbacks": [callback]})
|
|
@@ -43,7 +43,7 @@ class UsageMetadataCallbackHandler(BaseCallbackHandler):
|
|
|
43
43
|
'input_token_details': {'cache_read': 0, 'cache_creation': 0}}}
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
!!! version-added "Added in
|
|
46
|
+
!!! version-added "Added in `langchain-core` 0.3.49"
|
|
47
47
|
|
|
48
48
|
"""
|
|
49
49
|
|
|
@@ -109,7 +109,7 @@ def get_usage_metadata_callback(
|
|
|
109
109
|
from langchain_core.callbacks import get_usage_metadata_callback
|
|
110
110
|
|
|
111
111
|
llm_1 = init_chat_model(model="openai:gpt-4o-mini")
|
|
112
|
-
llm_2 = init_chat_model(model="anthropic:claude-3-5-haiku-
|
|
112
|
+
llm_2 = init_chat_model(model="anthropic:claude-3-5-haiku-20241022")
|
|
113
113
|
|
|
114
114
|
with get_usage_metadata_callback() as cb:
|
|
115
115
|
llm_1.invoke("Hello")
|
|
@@ -134,7 +134,7 @@ def get_usage_metadata_callback(
|
|
|
134
134
|
}
|
|
135
135
|
```
|
|
136
136
|
|
|
137
|
-
!!! version-added "Added in
|
|
137
|
+
!!! version-added "Added in `langchain-core` 0.3.49"
|
|
138
138
|
|
|
139
139
|
"""
|
|
140
140
|
usage_metadata_callback_var: ContextVar[UsageMetadataCallbackHandler | None] = (
|
|
@@ -121,7 +121,7 @@ class BaseChatMessageHistory(ABC):
|
|
|
121
121
|
This method may be deprecated in a future release.
|
|
122
122
|
|
|
123
123
|
Args:
|
|
124
|
-
message: The
|
|
124
|
+
message: The `HumanMessage` to add to the store.
|
|
125
125
|
"""
|
|
126
126
|
if isinstance(message, HumanMessage):
|
|
127
127
|
self.add_message(message)
|
|
@@ -129,7 +129,7 @@ class BaseChatMessageHistory(ABC):
|
|
|
129
129
|
self.add_message(HumanMessage(content=message))
|
|
130
130
|
|
|
131
131
|
def add_ai_message(self, message: AIMessage | str) -> None:
|
|
132
|
-
"""Convenience method for adding an
|
|
132
|
+
"""Convenience method for adding an `AIMessage` string to the store.
|
|
133
133
|
|
|
134
134
|
!!! note
|
|
135
135
|
This is a convenience method. Code should favor the bulk `add_messages`
|
|
@@ -138,7 +138,7 @@ class BaseChatMessageHistory(ABC):
|
|
|
138
138
|
This method may be deprecated in a future release.
|
|
139
139
|
|
|
140
140
|
Args:
|
|
141
|
-
message: The
|
|
141
|
+
message: The `AIMessage` to add.
|
|
142
142
|
"""
|
|
143
143
|
if isinstance(message, AIMessage):
|
|
144
144
|
self.add_message(message)
|
|
@@ -173,7 +173,7 @@ class BaseChatMessageHistory(ABC):
|
|
|
173
173
|
in an efficient manner to avoid unnecessary round-trips to the underlying store.
|
|
174
174
|
|
|
175
175
|
Args:
|
|
176
|
-
messages: A sequence of BaseMessage objects to store.
|
|
176
|
+
messages: A sequence of `BaseMessage` objects to store.
|
|
177
177
|
"""
|
|
178
178
|
for message in messages:
|
|
179
179
|
self.add_message(message)
|
|
@@ -182,7 +182,7 @@ class BaseChatMessageHistory(ABC):
|
|
|
182
182
|
"""Async add a list of messages.
|
|
183
183
|
|
|
184
184
|
Args:
|
|
185
|
-
messages: A sequence of BaseMessage objects to store.
|
|
185
|
+
messages: A sequence of `BaseMessage` objects to store.
|
|
186
186
|
"""
|
|
187
187
|
await run_in_executor(None, self.add_messages, messages)
|
|
188
188
|
|
|
@@ -27,7 +27,7 @@ class BaseLoader(ABC): # noqa: B024
|
|
|
27
27
|
"""Interface for Document Loader.
|
|
28
28
|
|
|
29
29
|
Implementations should implement the lazy-loading method using generators
|
|
30
|
-
to avoid loading all
|
|
30
|
+
to avoid loading all documents into memory at once.
|
|
31
31
|
|
|
32
32
|
`load` is provided just for user convenience and should not be overridden.
|
|
33
33
|
"""
|
|
@@ -53,9 +53,11 @@ class BaseLoader(ABC): # noqa: B024
|
|
|
53
53
|
def load_and_split(
|
|
54
54
|
self, text_splitter: TextSplitter | None = None
|
|
55
55
|
) -> list[Document]:
|
|
56
|
-
"""Load
|
|
56
|
+
"""Load `Document` and split into chunks. Chunks are returned as `Document`.
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
!!! danger
|
|
59
|
+
|
|
60
|
+
Do not override this method. It should be considered to be deprecated!
|
|
59
61
|
|
|
60
62
|
Args:
|
|
61
63
|
text_splitter: `TextSplitter` instance to use for splitting documents.
|
|
@@ -135,7 +137,7 @@ class BaseBlobParser(ABC):
|
|
|
135
137
|
"""
|
|
136
138
|
|
|
137
139
|
def parse(self, blob: Blob) -> list[Document]:
|
|
138
|
-
"""Eagerly parse the blob into a `Document` or `Document` objects.
|
|
140
|
+
"""Eagerly parse the blob into a `Document` or list of `Document` objects.
|
|
139
141
|
|
|
140
142
|
This is a convenience method for interactive development environment.
|
|
141
143
|
|
{langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/document_loaders/blob_loaders.py
RENAMED
|
@@ -28,7 +28,7 @@ class BlobLoader(ABC):
|
|
|
28
28
|
def yield_blobs(
|
|
29
29
|
self,
|
|
30
30
|
) -> Iterable[Blob]:
|
|
31
|
-
"""A lazy loader for raw data represented by LangChain's Blob object.
|
|
31
|
+
"""A lazy loader for raw data represented by LangChain's `Blob` object.
|
|
32
32
|
|
|
33
33
|
Returns:
|
|
34
34
|
A generator over blobs
|
{langchain_core-1.0.0rc3 → langchain_core-1.0.5}/langchain_core/document_loaders/langsmith.py
RENAMED
|
@@ -14,13 +14,13 @@ from langchain_core.documents import Document
|
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class LangSmithLoader(BaseLoader):
|
|
17
|
-
"""Load LangSmith Dataset examples as
|
|
17
|
+
"""Load LangSmith Dataset examples as `Document` objects.
|
|
18
18
|
|
|
19
|
-
Loads the example inputs as the Document page content and places the entire
|
|
20
|
-
into the Document metadata. This allows you to easily create few-shot
|
|
21
|
-
retrievers from the loaded documents.
|
|
19
|
+
Loads the example inputs as the `Document` page content and places the entire
|
|
20
|
+
example into the `Document` metadata. This allows you to easily create few-shot
|
|
21
|
+
example retrievers from the loaded documents.
|
|
22
22
|
|
|
23
|
-
??? note "Lazy
|
|
23
|
+
??? note "Lazy loading example"
|
|
24
24
|
|
|
25
25
|
```python
|
|
26
26
|
from langchain_core.document_loaders import LangSmithLoader
|
|
@@ -34,9 +34,6 @@ class LangSmithLoader(BaseLoader):
|
|
|
34
34
|
```python
|
|
35
35
|
# -> [Document("...", metadata={"inputs": {...}, "outputs": {...}, ...}), ...]
|
|
36
36
|
```
|
|
37
|
-
|
|
38
|
-
!!! version-added "Added in version 0.2.34"
|
|
39
|
-
|
|
40
37
|
"""
|
|
41
38
|
|
|
42
39
|
def __init__(
|
|
@@ -69,12 +66,11 @@ class LangSmithLoader(BaseLoader):
|
|
|
69
66
|
format_content: Function for converting the content extracted from the example
|
|
70
67
|
inputs into a string. Defaults to JSON-encoding the contents.
|
|
71
68
|
example_ids: The IDs of the examples to filter by.
|
|
72
|
-
as_of: The dataset version tag
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
of the tagged (or timestamped) version.
|
|
69
|
+
as_of: The dataset version tag or timestamp to retrieve the examples as of.
|
|
70
|
+
Response examples will only be those that were present at the time of
|
|
71
|
+
the tagged (or timestamped) version.
|
|
76
72
|
splits: A list of dataset splits, which are
|
|
77
|
-
divisions of your dataset such as
|
|
73
|
+
divisions of your dataset such as `train`, `test`, or `validation`.
|
|
78
74
|
Returns examples only from the specified splits.
|
|
79
75
|
inline_s3_urls: Whether to inline S3 URLs.
|
|
80
76
|
offset: The offset to start from.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""Documents module for data retrieval and processing workflows.
|
|
2
|
+
|
|
3
|
+
This module provides core abstractions for handling data in retrieval-augmented
|
|
4
|
+
generation (RAG) pipelines, vector stores, and document processing workflows.
|
|
5
|
+
|
|
6
|
+
!!! warning "Documents vs. message content"
|
|
7
|
+
This module is distinct from `langchain_core.messages.content`, which provides
|
|
8
|
+
multimodal content blocks for **LLM chat I/O** (text, images, audio, etc. within
|
|
9
|
+
messages).
|
|
10
|
+
|
|
11
|
+
**Key distinction:**
|
|
12
|
+
|
|
13
|
+
- **Documents** (this module): For **data retrieval and processing workflows**
|
|
14
|
+
- Vector stores, retrievers, RAG pipelines
|
|
15
|
+
- Text chunking, embedding, and semantic search
|
|
16
|
+
- Example: Chunks of a PDF stored in a vector database
|
|
17
|
+
|
|
18
|
+
- **Content Blocks** (`messages.content`): For **LLM conversational I/O**
|
|
19
|
+
- Multimodal message content sent to/from models
|
|
20
|
+
- Tool calls, reasoning, citations within chat
|
|
21
|
+
- Example: An image sent to a vision model in a chat message (via
|
|
22
|
+
[`ImageContentBlock`][langchain.messages.ImageContentBlock])
|
|
23
|
+
|
|
24
|
+
While both can represent similar data types (text, files), they serve different
|
|
25
|
+
architectural purposes in LangChain applications.
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from typing import TYPE_CHECKING
|
|
29
|
+
|
|
30
|
+
from langchain_core._import_utils import import_attr
|
|
31
|
+
|
|
32
|
+
if TYPE_CHECKING:
|
|
33
|
+
from .base import Document
|
|
34
|
+
from .compressor import BaseDocumentCompressor
|
|
35
|
+
from .transformers import BaseDocumentTransformer
|
|
36
|
+
|
|
37
|
+
__all__ = ("BaseDocumentCompressor", "BaseDocumentTransformer", "Document")
|
|
38
|
+
|
|
39
|
+
_dynamic_imports = {
|
|
40
|
+
"Document": "base",
|
|
41
|
+
"BaseDocumentCompressor": "compressor",
|
|
42
|
+
"BaseDocumentTransformer": "transformers",
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def __getattr__(attr_name: str) -> object:
|
|
47
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
48
|
+
result = import_attr(attr_name, module_name, __spec__.parent)
|
|
49
|
+
globals()[attr_name] = result
|
|
50
|
+
return result
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def __dir__() -> list[str]:
|
|
54
|
+
return list(__all__)
|