langchain-core 0.3.72__tar.gz → 0.3.74__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.
Potentially problematic release.
This version of langchain-core might be problematic. Click here for more details.
- {langchain_core-0.3.72 → langchain_core-0.3.74}/PKG-INFO +1 -1
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/_api/beta_decorator.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/_api/deprecation.py +2 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/beta/runnables/context.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/callbacks/file.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/callbacks/manager.py +4 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/callbacks/usage.py +3 -1
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/chat_history.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/document_loaders/langsmith.py +2 -1
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/documents/base.py +2 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/embeddings/fake.py +2 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/indexing/api.py +10 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/language_models/_utils.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/language_models/chat_models.py +58 -27
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/language_models/llms.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/memory.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/messages/ai.py +3 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/messages/human.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/messages/tool.py +3 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/messages/utils.py +7 -2
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/output_parsers/base.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/output_parsers/openai_functions.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/outputs/llm_result.py +4 -1
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompts/base.py +4 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompts/chat.py +3 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompts/few_shot.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompts/few_shot_with_templates.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompts/image.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompts/pipeline.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompts/prompt.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompts/structured.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/rate_limiters.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/retrievers.py +3 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/base.py +59 -48
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/branch.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/configurable.py +2 -1
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/fallbacks.py +3 -7
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/graph.py +2 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/graph_ascii.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/graph_mermaid.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/history.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/passthrough.py +3 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/retry.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/router.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/schema.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/stores.py +3 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tools/base.py +11 -6
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tools/convert.py +3 -1
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tools/structured.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/context.py +1 -1
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/log_stream.py +2 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/_merge.py +1 -1
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/aiter.py +5 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/function_calling.py +12 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/iter.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/vectorstores/base.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/version.py +1 -1
- {langchain_core-0.3.72 → langchain_core-0.3.74}/pyproject.toml +1 -1
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/conftest.py +1 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/indexing/test_indexing.py +135 -21
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/language_models/chat_models/test_cache.py +109 -1
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/messages/test_utils.py +27 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/test_messages.py +5 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/test_tools.py +12 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/README.md +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/_api/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/_api/internal.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/_api/path.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/_import_utils.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/agents.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/beta/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/beta/runnables/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/caches.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/callbacks/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/callbacks/base.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/callbacks/stdout.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/callbacks/streaming_stdout.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/chat_loaders.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/chat_sessions.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/document_loaders/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/document_loaders/base.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/document_loaders/blob_loaders.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/documents/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/documents/compressor.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/documents/transformers.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/embeddings/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/embeddings/embeddings.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/env.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/example_selectors/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/example_selectors/base.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/example_selectors/length_based.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/example_selectors/semantic_similarity.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/exceptions.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/globals.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/indexing/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/indexing/base.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/indexing/in_memory.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/language_models/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/language_models/base.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/language_models/fake.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/language_models/fake_chat_models.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/load/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/load/dump.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/load/load.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/load/mapping.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/load/serializable.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/messages/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/messages/base.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/messages/chat.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/messages/content_blocks.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/messages/function.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/messages/modifier.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/messages/system.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/output_parsers/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/output_parsers/format_instructions.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/output_parsers/json.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/output_parsers/list.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/output_parsers/openai_tools.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/output_parsers/pydantic.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/output_parsers/string.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/output_parsers/transform.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/output_parsers/xml.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/outputs/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/outputs/chat_generation.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/outputs/chat_result.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/outputs/generation.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/outputs/run_info.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompt_values.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompts/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompts/dict.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompts/loading.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompts/message.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/prompts/string.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/py.typed +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/pydantic_v1/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/pydantic_v1/dataclasses.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/pydantic_v1/main.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/config.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/graph_png.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/runnables/utils.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/structured_query.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/sys_info.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tools/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tools/render.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tools/retriever.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tools/simple.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/_streaming.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/base.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/core.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/evaluation.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/event_stream.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/langchain.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/langchain_v1.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/memory_stream.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/root_listeners.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/run_collector.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/schemas.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/tracers/stdout.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/env.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/formatting.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/html.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/image.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/input.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/interactive_env.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/json.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/json_schema.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/loading.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/mustache.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/pydantic.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/strings.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/usage.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/utils/utils.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/vectorstores/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/vectorstores/in_memory.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/vectorstores/utils.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/benchmarks/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/benchmarks/test_async_callbacks.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/benchmarks/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/integration_tests/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/integration_tests/test_compile.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/_api/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/_api/test_beta_decorator.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/_api/test_deprecation.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/_api/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/_api/test_path.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/caches/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/caches/test_in_memory_cache.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/callbacks/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/callbacks/test_async_callback_manager.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/callbacks/test_dispatch_custom_event.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/callbacks/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/callbacks/test_sync_callback_manager.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/callbacks/test_usage_callback.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/chat_history/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/chat_history/test_chat_history.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/data/prompt_file.txt +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/data/prompts/prompt_extra_args.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/data/prompts/prompt_missing_args.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/data/prompts/simple_prompt.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/dependencies/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/dependencies/test_dependencies.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/document_loaders/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/document_loaders/test_base.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/document_loaders/test_langsmith.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/documents/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/documents/test_document.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/documents/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/documents/test_str.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/embeddings/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/embeddings/test_deterministic_embedding.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/example_selectors/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/example_selectors/test_base.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/example_selectors/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/example_selectors/test_length_based_example_selector.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/example_selectors/test_similarity.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/example-non-utf8.csv +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/example-non-utf8.txt +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/example-utf8.csv +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/example-utf8.txt +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/example_prompt.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/examples.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/examples.yaml +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/few_shot_prompt.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/few_shot_prompt.yaml +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/few_shot_prompt_example_prompt.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/few_shot_prompt_examples_in.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/few_shot_prompt_yaml_examples.yaml +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/jinja_injection_prompt.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/jinja_injection_prompt.yaml +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/prompt_with_output_parser.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/simple_prompt.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/simple_prompt.yaml +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/simple_prompt_with_template_file.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/examples/simple_template.txt +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/fake/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/fake/callbacks.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/fake/test_fake_chat_model.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/indexing/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/indexing/test_hashed_document.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/indexing/test_in_memory_indexer.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/indexing/test_in_memory_record_manager.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/indexing/test_public_api.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/language_models/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/language_models/chat_models/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/language_models/chat_models/test_base.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/language_models/chat_models/test_benchmark.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/language_models/chat_models/test_rate_limiting.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/language_models/llms/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/language_models/llms/test_base.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/language_models/llms/test_cache.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/language_models/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/load/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/load/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/load/test_serializable.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/messages/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/messages/test_ai.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/messages/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/output_parsers/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/output_parsers/test_base_parsers.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/output_parsers/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/output_parsers/test_json.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/output_parsers/test_list_parser.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/output_parsers/test_openai_functions.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/output_parsers/test_openai_tools.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/output_parsers/test_pydantic_parser.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/output_parsers/test_xml_parser.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/outputs/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/outputs/test_chat_generation.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/outputs/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompt_file.txt +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/__snapshots__/test_chat.ambr +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/__snapshots__/test_prompt.ambr +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/prompt_extra_args.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/prompt_missing_args.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/simple_prompt.json +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/test_chat.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/test_dict.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/test_few_shot.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/test_few_shot_with_templates.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/test_image.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/test_loading.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/test_pipeline_prompt.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/test_prompt.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/test_structured.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/prompts/test_utils.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/pydantic_utils.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/rate_limiters/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/rate_limiters/test_in_memory_rate_limiter.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/__snapshots__/test_graph.ambr +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/test_concurrency.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/test_config.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/test_configurable.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/test_context.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/test_fallbacks.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/test_graph.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/test_history.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/test_runnable.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/test_runnable_events_v1.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/test_runnable_events_v2.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/test_tracing_interops.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/runnables/test_utils.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/stores/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/stores/test_in_memory.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/stubs.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/test_globals.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/test_outputs.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/test_prompt_values.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/test_pydantic_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/test_pydantic_serde.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/test_retrievers.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/test_setup.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/test_sys_info.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/tracers/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/tracers/test_async_base_tracer.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/tracers/test_base_tracer.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/tracers/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/tracers/test_langchain.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/tracers/test_memory_stream.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/tracers/test_run_collector.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/tracers/test_schemas.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/utils/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/utils/test_aiter.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/utils/test_env.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/utils/test_function_calling.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/utils/test_html.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/utils/test_imports.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/utils/test_iter.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/utils/test_json_schema.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/utils/test_pydantic.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/utils/test_rm_titles.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/utils/test_strings.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/utils/test_usage.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/utils/test_utils.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/vectorstores/__init__.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/vectorstores/test_in_memory.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/vectorstores/test_utils.py +0 -0
- {langchain_core-0.3.72 → langchain_core-0.3.74}/tests/unit_tests/vectorstores/test_vectorstore.py +0 -0
|
@@ -136,6 +136,7 @@ def deprecated(
|
|
|
136
136
|
@deprecated('1.4.0')
|
|
137
137
|
def the_function_to_deprecate():
|
|
138
138
|
pass
|
|
139
|
+
|
|
139
140
|
"""
|
|
140
141
|
_validate_deprecation_params(
|
|
141
142
|
removal, alternative, alternative_import, pending=pending
|
|
@@ -549,6 +550,7 @@ def rename_parameter(
|
|
|
549
550
|
|
|
550
551
|
@_api.rename_parameter("3.1", "bad_name", "good_name")
|
|
551
552
|
def func(good_name): ...
|
|
553
|
+
|
|
552
554
|
"""
|
|
553
555
|
|
|
554
556
|
def decorator(f: Callable[_P, _R]) -> Callable[_P, _R]:
|
|
@@ -53,6 +53,7 @@ class FileCallbackHandler(BaseCallbackHandler):
|
|
|
53
53
|
When not used as a context manager, a deprecation warning will be issued
|
|
54
54
|
on first use. The file will be opened immediately in ``__init__`` and closed
|
|
55
55
|
in ``__del__`` or when ``close()`` is called explicitly.
|
|
56
|
+
|
|
56
57
|
"""
|
|
57
58
|
|
|
58
59
|
def __init__(
|
|
@@ -105,6 +105,7 @@ def trace_as_chain_group(
|
|
|
105
105
|
# Use the callback manager for the chain group
|
|
106
106
|
res = llm.invoke(llm_input, {"callbacks": manager})
|
|
107
107
|
manager.on_chain_end({"output": res})
|
|
108
|
+
|
|
108
109
|
""" # noqa: E501
|
|
109
110
|
from langchain_core.tracers.context import _get_trace_callbacks
|
|
110
111
|
|
|
@@ -186,6 +187,7 @@ async def atrace_as_chain_group(
|
|
|
186
187
|
# Use the async callback manager for the chain group
|
|
187
188
|
res = await llm.ainvoke(llm_input, {"callbacks": manager})
|
|
188
189
|
await manager.on_chain_end({"output": res})
|
|
190
|
+
|
|
189
191
|
""" # noqa: E501
|
|
190
192
|
from langchain_core.tracers.context import _get_trace_callbacks
|
|
191
193
|
|
|
@@ -2575,6 +2577,7 @@ async def adispatch_custom_event(
|
|
|
2575
2577
|
behalf.
|
|
2576
2578
|
|
|
2577
2579
|
.. versionadded:: 0.2.15
|
|
2580
|
+
|
|
2578
2581
|
"""
|
|
2579
2582
|
from langchain_core.runnables.config import (
|
|
2580
2583
|
ensure_config,
|
|
@@ -2645,6 +2648,7 @@ def dispatch_custom_event(
|
|
|
2645
2648
|
foo_.invoke({"a": "1"}, {"callbacks": [CustomCallbackManager()]})
|
|
2646
2649
|
|
|
2647
2650
|
.. versionadded:: 0.2.15
|
|
2651
|
+
|
|
2648
2652
|
"""
|
|
2649
2653
|
from langchain_core.runnables.config import (
|
|
2650
2654
|
ensure_config,
|
|
@@ -44,6 +44,7 @@ class UsageMetadataCallbackHandler(BaseCallbackHandler):
|
|
|
44
44
|
'input_token_details': {'cache_read': 0, 'cache_creation': 0}}}
|
|
45
45
|
|
|
46
46
|
.. versionadded:: 0.3.49
|
|
47
|
+
|
|
47
48
|
"""
|
|
48
49
|
|
|
49
50
|
def __init__(self) -> None:
|
|
@@ -98,7 +99,7 @@ def get_usage_metadata_callback(
|
|
|
98
99
|
|
|
99
100
|
Args:
|
|
100
101
|
name (str): The name of the context variable. Defaults to
|
|
101
|
-
``
|
|
102
|
+
``'usage_metadata_callback'``.
|
|
102
103
|
|
|
103
104
|
Example:
|
|
104
105
|
.. code-block:: python
|
|
@@ -127,6 +128,7 @@ def get_usage_metadata_callback(
|
|
|
127
128
|
'input_token_details': {'cache_read': 0, 'cache_creation': 0}}}
|
|
128
129
|
|
|
129
130
|
.. versionadded:: 0.3.49
|
|
131
|
+
|
|
130
132
|
"""
|
|
131
133
|
from langchain_core.tracers.context import register_configure_hook
|
|
132
134
|
|
{langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/document_loaders/langsmith.py
RENAMED
|
@@ -36,6 +36,7 @@ class LangSmithLoader(BaseLoader):
|
|
|
36
36
|
# -> [Document("...", metadata={"inputs": {...}, "outputs": {...}, ...}), ...]
|
|
37
37
|
|
|
38
38
|
.. versionadded:: 0.2.34
|
|
39
|
+
|
|
39
40
|
""" # noqa: E501
|
|
40
41
|
|
|
41
42
|
def __init__(
|
|
@@ -61,7 +62,7 @@ class LangSmithLoader(BaseLoader):
|
|
|
61
62
|
Args:
|
|
62
63
|
dataset_id: The ID of the dataset to filter by. Defaults to None.
|
|
63
64
|
dataset_name: The name of the dataset to filter by. Defaults to None.
|
|
64
|
-
content_key: The inputs key to set as Document page content. ``
|
|
65
|
+
content_key: The inputs key to set as Document page content. ``'.'`` characters
|
|
65
66
|
are interpreted as nested keys. E.g. ``content_key="first.second"`` will
|
|
66
67
|
result in
|
|
67
68
|
``Document(page_content=format_content(example.inputs["first"]["second"]))``
|
|
@@ -102,6 +102,7 @@ class Blob(BaseMedia):
|
|
|
102
102
|
# Read the blob as a byte stream
|
|
103
103
|
with blob.as_bytes_io() as f:
|
|
104
104
|
print(f.read())
|
|
105
|
+
|
|
105
106
|
"""
|
|
106
107
|
|
|
107
108
|
data: Union[bytes, str, None] = None
|
|
@@ -265,6 +266,7 @@ class Document(BaseMedia):
|
|
|
265
266
|
page_content="Hello, world!",
|
|
266
267
|
metadata={"source": "https://example.com"}
|
|
267
268
|
)
|
|
269
|
+
|
|
268
270
|
"""
|
|
269
271
|
|
|
270
272
|
page_content: str
|
|
@@ -46,6 +46,7 @@ class FakeEmbeddings(Embeddings, BaseModel):
|
|
|
46
46
|
|
|
47
47
|
2
|
|
48
48
|
[-0.5670477847544458, -0.31403828652395727, -0.5840547508955257]
|
|
49
|
+
|
|
49
50
|
"""
|
|
50
51
|
|
|
51
52
|
size: int
|
|
@@ -103,6 +104,7 @@ class DeterministicFakeEmbedding(Embeddings, BaseModel):
|
|
|
103
104
|
|
|
104
105
|
2
|
|
105
106
|
[-0.5670477847544458, -0.31403828652395727, -0.5840547508955257]
|
|
107
|
+
|
|
106
108
|
"""
|
|
107
109
|
|
|
108
110
|
size: int
|
|
@@ -444,6 +444,9 @@ def index(
|
|
|
444
444
|
scoped_full_cleanup_source_ids: set[str] = set()
|
|
445
445
|
|
|
446
446
|
for doc_batch in _batch(batch_size, doc_iterator):
|
|
447
|
+
# Track original batch size before deduplication
|
|
448
|
+
original_batch_size = len(doc_batch)
|
|
449
|
+
|
|
447
450
|
hashed_docs = list(
|
|
448
451
|
_deduplicate_in_order(
|
|
449
452
|
[
|
|
@@ -452,6 +455,8 @@ def index(
|
|
|
452
455
|
]
|
|
453
456
|
)
|
|
454
457
|
)
|
|
458
|
+
# Count documents removed by within-batch deduplication
|
|
459
|
+
num_skipped += original_batch_size - len(hashed_docs)
|
|
455
460
|
|
|
456
461
|
source_ids: Sequence[Optional[str]] = [
|
|
457
462
|
source_id_assigner(hashed_doc) for hashed_doc in hashed_docs
|
|
@@ -784,6 +789,9 @@ async def aindex(
|
|
|
784
789
|
scoped_full_cleanup_source_ids: set[str] = set()
|
|
785
790
|
|
|
786
791
|
async for doc_batch in _abatch(batch_size, async_doc_iterator):
|
|
792
|
+
# Track original batch size before deduplication
|
|
793
|
+
original_batch_size = len(doc_batch)
|
|
794
|
+
|
|
787
795
|
hashed_docs = list(
|
|
788
796
|
_deduplicate_in_order(
|
|
789
797
|
[
|
|
@@ -792,6 +800,8 @@ async def aindex(
|
|
|
792
800
|
]
|
|
793
801
|
)
|
|
794
802
|
)
|
|
803
|
+
# Count documents removed by within-batch deduplication
|
|
804
|
+
num_skipped += original_batch_size - len(hashed_docs)
|
|
795
805
|
|
|
796
806
|
source_ids: Sequence[Optional[str]] = [
|
|
797
807
|
source_id_assigner(doc) for doc in hashed_docs
|
{langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/language_models/chat_models.py
RENAMED
|
@@ -11,22 +11,9 @@ from abc import ABC, abstractmethod
|
|
|
11
11
|
from collections.abc import AsyncIterator, Iterator, Sequence
|
|
12
12
|
from functools import cached_property
|
|
13
13
|
from operator import itemgetter
|
|
14
|
-
from typing import
|
|
15
|
-
TYPE_CHECKING,
|
|
16
|
-
Any,
|
|
17
|
-
Callable,
|
|
18
|
-
Literal,
|
|
19
|
-
Optional,
|
|
20
|
-
Union,
|
|
21
|
-
cast,
|
|
22
|
-
)
|
|
14
|
+
from typing import TYPE_CHECKING, Any, Callable, Literal, Optional, Union, cast
|
|
23
15
|
|
|
24
|
-
from pydantic import
|
|
25
|
-
BaseModel,
|
|
26
|
-
ConfigDict,
|
|
27
|
-
Field,
|
|
28
|
-
model_validator,
|
|
29
|
-
)
|
|
16
|
+
from pydantic import BaseModel, ConfigDict, Field, model_validator
|
|
30
17
|
from typing_extensions import override
|
|
31
18
|
|
|
32
19
|
from langchain_core._api import deprecated
|
|
@@ -63,6 +50,7 @@ from langchain_core.outputs import (
|
|
|
63
50
|
ChatGeneration,
|
|
64
51
|
ChatGenerationChunk,
|
|
65
52
|
ChatResult,
|
|
53
|
+
Generation,
|
|
66
54
|
LLMResult,
|
|
67
55
|
RunInfo,
|
|
68
56
|
)
|
|
@@ -653,6 +641,44 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
|
|
653
641
|
def _combine_llm_outputs(self, llm_outputs: list[Optional[dict]]) -> dict: # noqa: ARG002
|
|
654
642
|
return {}
|
|
655
643
|
|
|
644
|
+
def _convert_cached_generations(self, cache_val: list) -> list[ChatGeneration]:
|
|
645
|
+
"""Convert cached Generation objects to ChatGeneration objects.
|
|
646
|
+
|
|
647
|
+
Handle case where cache contains Generation objects instead of
|
|
648
|
+
ChatGeneration objects. This can happen due to serialization/deserialization
|
|
649
|
+
issues or legacy cache data (see #22389).
|
|
650
|
+
|
|
651
|
+
Args:
|
|
652
|
+
cache_val: List of cached generation objects.
|
|
653
|
+
|
|
654
|
+
Returns:
|
|
655
|
+
List of ChatGeneration objects.
|
|
656
|
+
"""
|
|
657
|
+
converted_generations = []
|
|
658
|
+
for gen in cache_val:
|
|
659
|
+
if isinstance(gen, Generation) and not isinstance(gen, ChatGeneration):
|
|
660
|
+
# Convert Generation to ChatGeneration by creating AIMessage
|
|
661
|
+
# from the text content
|
|
662
|
+
chat_gen = ChatGeneration(
|
|
663
|
+
message=AIMessage(content=gen.text),
|
|
664
|
+
generation_info=gen.generation_info,
|
|
665
|
+
)
|
|
666
|
+
converted_generations.append(chat_gen)
|
|
667
|
+
else:
|
|
668
|
+
# Already a ChatGeneration or other expected type
|
|
669
|
+
if hasattr(gen, "message") and isinstance(gen.message, AIMessage):
|
|
670
|
+
# We zero out cost on cache hits
|
|
671
|
+
gen.message = gen.message.model_copy(
|
|
672
|
+
update={
|
|
673
|
+
"usage_metadata": {
|
|
674
|
+
**(gen.message.usage_metadata or {}),
|
|
675
|
+
"total_cost": 0,
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
)
|
|
679
|
+
converted_generations.append(gen)
|
|
680
|
+
return converted_generations
|
|
681
|
+
|
|
656
682
|
def _get_invocation_params(
|
|
657
683
|
self,
|
|
658
684
|
stop: Optional[list[str]] = None,
|
|
@@ -1010,7 +1036,8 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
|
|
1010
1036
|
prompt = dumps(messages)
|
|
1011
1037
|
cache_val = llm_cache.lookup(prompt, llm_string)
|
|
1012
1038
|
if isinstance(cache_val, list):
|
|
1013
|
-
|
|
1039
|
+
converted_generations = self._convert_cached_generations(cache_val)
|
|
1040
|
+
return ChatResult(generations=converted_generations)
|
|
1014
1041
|
elif self.cache is None:
|
|
1015
1042
|
pass
|
|
1016
1043
|
else:
|
|
@@ -1082,7 +1109,8 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
|
|
1082
1109
|
prompt = dumps(messages)
|
|
1083
1110
|
cache_val = await llm_cache.alookup(prompt, llm_string)
|
|
1084
1111
|
if isinstance(cache_val, list):
|
|
1085
|
-
|
|
1112
|
+
converted_generations = self._convert_cached_generations(cache_val)
|
|
1113
|
+
return ChatResult(generations=converted_generations)
|
|
1086
1114
|
elif self.cache is None:
|
|
1087
1115
|
pass
|
|
1088
1116
|
else:
|
|
@@ -1367,12 +1395,13 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
|
|
1367
1395
|
"""Model wrapper that returns outputs formatted to match the given schema.
|
|
1368
1396
|
|
|
1369
1397
|
Args:
|
|
1370
|
-
schema:
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1398
|
+
schema: The output schema. Can be passed in as:
|
|
1399
|
+
|
|
1400
|
+
- an OpenAI function/tool schema,
|
|
1401
|
+
- a JSON Schema,
|
|
1402
|
+
- a TypedDict class,
|
|
1403
|
+
- or a Pydantic class.
|
|
1404
|
+
|
|
1376
1405
|
If ``schema`` is a Pydantic class then the model output will be a
|
|
1377
1406
|
Pydantic instance of that class, and the model-generated fields will be
|
|
1378
1407
|
validated by the Pydantic class. Otherwise the model output will be a
|
|
@@ -1386,7 +1415,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
|
|
1386
1415
|
then both the raw model response (a BaseMessage) and the parsed model
|
|
1387
1416
|
response will be returned. If an error occurs during output parsing it
|
|
1388
1417
|
will be caught and returned as well. The final output is always a dict
|
|
1389
|
-
with keys
|
|
1418
|
+
with keys ``'raw'``, ``'parsed'``, and ``'parsing_error'``.
|
|
1390
1419
|
|
|
1391
1420
|
Returns:
|
|
1392
1421
|
A Runnable that takes same inputs as a :class:`langchain_core.language_models.chat.BaseChatModel`.
|
|
@@ -1397,9 +1426,10 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
|
|
1397
1426
|
Otherwise, if ``include_raw`` is False then Runnable outputs a dict.
|
|
1398
1427
|
|
|
1399
1428
|
If ``include_raw`` is True, then Runnable outputs a dict with keys:
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1429
|
+
|
|
1430
|
+
- ``'raw'``: BaseMessage
|
|
1431
|
+
- ``'parsed'``: None if there was a parsing error, otherwise the type depends on the ``schema`` as described above.
|
|
1432
|
+
- ``'parsing_error'``: Optional[BaseException]
|
|
1403
1433
|
|
|
1404
1434
|
Example: Pydantic schema (include_raw=False):
|
|
1405
1435
|
.. code-block:: python
|
|
@@ -1465,6 +1495,7 @@ class BaseChatModel(BaseLanguageModel[BaseMessage], ABC):
|
|
|
1465
1495
|
.. versionchanged:: 0.2.26
|
|
1466
1496
|
|
|
1467
1497
|
Added support for TypedDict class.
|
|
1498
|
+
|
|
1468
1499
|
""" # noqa: E501
|
|
1469
1500
|
_ = kwargs.pop("method", None)
|
|
1470
1501
|
_ = kwargs.pop("strict", None)
|
|
@@ -57,6 +57,7 @@ class InputTokenDetails(TypedDict, total=False):
|
|
|
57
57
|
.. versionadded:: 0.3.9
|
|
58
58
|
|
|
59
59
|
May also hold extra provider-specific keys.
|
|
60
|
+
|
|
60
61
|
"""
|
|
61
62
|
|
|
62
63
|
audio: int
|
|
@@ -89,6 +90,7 @@ class OutputTokenDetails(TypedDict, total=False):
|
|
|
89
90
|
}
|
|
90
91
|
|
|
91
92
|
.. versionadded:: 0.3.9
|
|
93
|
+
|
|
92
94
|
"""
|
|
93
95
|
|
|
94
96
|
audio: int
|
|
@@ -128,6 +130,7 @@ class UsageMetadata(TypedDict):
|
|
|
128
130
|
.. versionchanged:: 0.3.9
|
|
129
131
|
|
|
130
132
|
Added ``input_token_details`` and ``output_token_details``.
|
|
133
|
+
|
|
131
134
|
"""
|
|
132
135
|
|
|
133
136
|
input_tokens: int
|
|
@@ -59,6 +59,7 @@ class ToolMessage(BaseMessage, ToolOutputMixin):
|
|
|
59
59
|
The tool_call_id field is used to associate the tool call request with the
|
|
60
60
|
tool call response. This is useful in situations where a chat model is able
|
|
61
61
|
to request multiple tool calls in parallel.
|
|
62
|
+
|
|
62
63
|
""" # noqa: E501
|
|
63
64
|
|
|
64
65
|
tool_call_id: str
|
|
@@ -191,6 +192,7 @@ class ToolCall(TypedDict):
|
|
|
191
192
|
|
|
192
193
|
This represents a request to call the tool named "foo" with arguments {"a": 1}
|
|
193
194
|
and an identifier of "123".
|
|
195
|
+
|
|
194
196
|
"""
|
|
195
197
|
|
|
196
198
|
name: str
|
|
@@ -240,6 +242,7 @@ class ToolCallChunk(TypedDict):
|
|
|
240
242
|
AIMessageChunk(content="", tool_call_chunks=left_chunks)
|
|
241
243
|
+ AIMessageChunk(content="", tool_call_chunks=right_chunks)
|
|
242
244
|
).tool_call_chunks == [ToolCallChunk(name='foo', args='{"a":1}', index=0)]
|
|
245
|
+
|
|
243
246
|
"""
|
|
244
247
|
|
|
245
248
|
name: Optional[str]
|
|
@@ -111,6 +111,7 @@ def get_buffer_string(
|
|
|
111
111
|
]
|
|
112
112
|
get_buffer_string(messages)
|
|
113
113
|
# -> "Human: Hi, how are you?\nAI: Good, how are you?"
|
|
114
|
+
|
|
114
115
|
"""
|
|
115
116
|
string_messages = []
|
|
116
117
|
for m in messages:
|
|
@@ -463,6 +464,7 @@ def filter_messages(
|
|
|
463
464
|
SystemMessage("you're a good assistant."),
|
|
464
465
|
HumanMessage("what's your name", id="foo", name="example_user"),
|
|
465
466
|
]
|
|
467
|
+
|
|
466
468
|
""" # noqa: E501
|
|
467
469
|
messages = convert_to_messages(messages)
|
|
468
470
|
filtered: list[BaseMessage] = []
|
|
@@ -869,6 +871,7 @@ def trim_messages(
|
|
|
869
871
|
HumanMessage("This is a 4 token text. The full message is 10 tokens.", id="first"),
|
|
870
872
|
AIMessage( [{"type": "text", "text": "This is the FIRST 4 token block."}], id="second"),
|
|
871
873
|
]
|
|
874
|
+
|
|
872
875
|
""" # noqa: E501
|
|
873
876
|
# Validate arguments
|
|
874
877
|
if start_on and strategy == "first":
|
|
@@ -1176,7 +1179,9 @@ def convert_to_openai_messages(
|
|
|
1176
1179
|
"id": block["id"],
|
|
1177
1180
|
"function": {
|
|
1178
1181
|
"name": block["name"],
|
|
1179
|
-
"arguments": json.dumps(
|
|
1182
|
+
"arguments": json.dumps(
|
|
1183
|
+
block["input"], ensure_ascii=False
|
|
1184
|
+
),
|
|
1180
1185
|
},
|
|
1181
1186
|
}
|
|
1182
1187
|
)
|
|
@@ -1550,7 +1555,7 @@ def _convert_to_openai_tool_calls(tool_calls: list[ToolCall]) -> list[dict]:
|
|
|
1550
1555
|
"id": tool_call["id"],
|
|
1551
1556
|
"function": {
|
|
1552
1557
|
"name": tool_call["name"],
|
|
1553
|
-
"arguments": json.dumps(tool_call["args"]),
|
|
1558
|
+
"arguments": json.dumps(tool_call["args"], ensure_ascii=False),
|
|
1554
1559
|
},
|
|
1555
1560
|
}
|
|
1556
1561
|
for tool_call in tool_calls
|
{langchain_core-0.3.72 → langchain_core-0.3.74}/langchain_core/output_parsers/openai_functions.py
RENAMED
|
@@ -214,6 +214,7 @@ class PydanticOutputFunctionsParser(OutputFunctionsParser):
|
|
|
214
214
|
pydantic_schema={"cookie": Cookie, "dog": Dog}
|
|
215
215
|
)
|
|
216
216
|
result = parser.parse_result([chat_generation])
|
|
217
|
+
|
|
217
218
|
"""
|
|
218
219
|
|
|
219
220
|
pydantic_schema: Union[type[BaseModel], dict[str, type[BaseModel]]]
|
|
@@ -46,7 +46,10 @@ class LLMResult(BaseModel):
|
|
|
46
46
|
relevant information from standardized fields present in AIMessage.
|
|
47
47
|
"""
|
|
48
48
|
run: Optional[list[RunInfo]] = None
|
|
49
|
-
"""List of metadata info for model call for each input.
|
|
49
|
+
"""List of metadata info for model call for each input.
|
|
50
|
+
|
|
51
|
+
See :class:`~langchain_core.outputs.run_info.RunInfo` for details.
|
|
52
|
+
"""
|
|
50
53
|
|
|
51
54
|
type: Literal["LLMResult"] = "LLMResult"
|
|
52
55
|
"""Type is used exclusively for serialization purposes."""
|
|
@@ -307,6 +307,7 @@ class BasePromptTemplate(
|
|
|
307
307
|
.. code-block:: python
|
|
308
308
|
|
|
309
309
|
prompt.format(variable1="foo")
|
|
310
|
+
|
|
310
311
|
"""
|
|
311
312
|
|
|
312
313
|
async def aformat(self, **kwargs: Any) -> FormatOutputType:
|
|
@@ -323,6 +324,7 @@ class BasePromptTemplate(
|
|
|
323
324
|
.. code-block:: python
|
|
324
325
|
|
|
325
326
|
await prompt.aformat(variable1="foo")
|
|
327
|
+
|
|
326
328
|
"""
|
|
327
329
|
return self.format(**kwargs)
|
|
328
330
|
|
|
@@ -363,6 +365,7 @@ class BasePromptTemplate(
|
|
|
363
365
|
.. code-block:: python
|
|
364
366
|
|
|
365
367
|
prompt.save(file_path="path/prompt.yaml")
|
|
368
|
+
|
|
366
369
|
"""
|
|
367
370
|
if self.partial_variables:
|
|
368
371
|
msg = "Cannot save prompt with partial variables."
|
|
@@ -442,6 +445,7 @@ def format_document(doc: Document, prompt: BasePromptTemplate[str]) -> str:
|
|
|
442
445
|
prompt = PromptTemplate.from_template("Page {page}: {page_content}")
|
|
443
446
|
format_document(doc, prompt)
|
|
444
447
|
>>> "Page 1: This is a joke"
|
|
448
|
+
|
|
445
449
|
"""
|
|
446
450
|
return prompt.format(**_get_document_info(doc, prompt))
|
|
447
451
|
|
|
@@ -126,6 +126,7 @@ class MessagesPlaceholder(BaseMessagePromptTemplate):
|
|
|
126
126
|
# -> [
|
|
127
127
|
# HumanMessage(content="Hello!"),
|
|
128
128
|
# ]
|
|
129
|
+
|
|
129
130
|
"""
|
|
130
131
|
|
|
131
132
|
variable_name: str
|
|
@@ -1164,6 +1165,7 @@ class ChatPromptTemplate(BaseChatPromptTemplate):
|
|
|
1164
1165
|
|
|
1165
1166
|
Returns:
|
|
1166
1167
|
a chat prompt template.
|
|
1168
|
+
|
|
1167
1169
|
"""
|
|
1168
1170
|
return cls(messages, template_format=template_format)
|
|
1169
1171
|
|
|
@@ -1248,6 +1250,7 @@ class ChatPromptTemplate(BaseChatPromptTemplate):
|
|
|
1248
1250
|
template2 = template.partial(user="Lucy", name="R2D2")
|
|
1249
1251
|
|
|
1250
1252
|
template2.format_messages(input="hello")
|
|
1253
|
+
|
|
1251
1254
|
"""
|
|
1252
1255
|
prompt_dict = self.__dict__.copy()
|
|
1253
1256
|
prompt_dict["input_variables"] = list(
|
|
@@ -357,6 +357,7 @@ class FewShotChatMessagePromptTemplate(
|
|
|
357
357
|
from langchain_core.chat_models import ChatAnthropic
|
|
358
358
|
chain = final_prompt | ChatAnthropic(model="claude-3-haiku-20240307")
|
|
359
359
|
chain.invoke({"input": "What's 3+3?"})
|
|
360
|
+
|
|
360
361
|
"""
|
|
361
362
|
|
|
362
363
|
input_variables: list[str] = Field(default_factory=list)
|
|
@@ -124,6 +124,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC):
|
|
|
124
124
|
# Op -- (n_docs,1) -- Cosine Sim with each doc
|
|
125
125
|
results = cosine_similarity(self.tfidf_array, query_vec).reshape((-1,))
|
|
126
126
|
return [self.docs[i] for i in results.argsort()[-self.k :][::-1]]
|
|
127
|
+
|
|
127
128
|
""" # noqa: E501
|
|
128
129
|
|
|
129
130
|
model_config = ConfigDict(
|
|
@@ -230,6 +231,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC):
|
|
|
230
231
|
.. code-block:: python
|
|
231
232
|
|
|
232
233
|
retriever.invoke("query")
|
|
234
|
+
|
|
233
235
|
"""
|
|
234
236
|
from langchain_core.callbacks.manager import CallbackManager
|
|
235
237
|
|
|
@@ -294,6 +296,7 @@ class BaseRetriever(RunnableSerializable[RetrieverInput, RetrieverOutput], ABC):
|
|
|
294
296
|
.. code-block:: python
|
|
295
297
|
|
|
296
298
|
await retriever.ainvoke("query")
|
|
299
|
+
|
|
297
300
|
"""
|
|
298
301
|
from langchain_core.callbacks.manager import AsyncCallbackManager
|
|
299
302
|
|