langchain-core 1.2.2__tar.gz → 1.2.7__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.
Files changed (376) hide show
  1. {langchain_core-1.2.2 → langchain_core-1.2.7}/PKG-INFO +1 -1
  2. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/_api/__init__.py +19 -0
  3. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/_api/deprecation.py +110 -81
  4. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/_api/internal.py +2 -1
  5. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/caches.py +1 -0
  6. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/callbacks/base.py +14 -13
  7. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/callbacks/manager.py +1 -1
  8. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/document_loaders/langsmith.py +3 -2
  9. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/example_selectors/length_based.py +1 -1
  10. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/indexing/api.py +11 -0
  11. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/language_models/base.py +22 -6
  12. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/language_models/chat_models.py +29 -9
  13. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/language_models/llms.py +4 -1
  14. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/language_models/model_profile.py +1 -0
  15. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/load/__init__.py +10 -2
  16. langchain_core-1.2.7/langchain_core/load/_validation.py +176 -0
  17. langchain_core-1.2.7/langchain_core/load/dump.py +120 -0
  18. langchain_core-1.2.7/langchain_core/load/load.py +671 -0
  19. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/load/mapping.py +12 -19
  20. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/load/serializable.py +9 -8
  21. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/ai.py +26 -26
  22. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/base.py +5 -2
  23. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/block_translators/anthropic.py +18 -8
  24. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/block_translators/bedrock.py +16 -2
  25. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/block_translators/bedrock_converse.py +16 -4
  26. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/block_translators/google_genai.py +20 -3
  27. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/block_translators/groq.py +16 -2
  28. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/block_translators/openai.py +44 -15
  29. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/content.py +199 -135
  30. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/utils.py +236 -73
  31. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/output_parsers/base.py +3 -2
  32. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/output_parsers/openai_functions.py +3 -3
  33. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/output_parsers/pydantic.py +13 -3
  34. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/prompt_values.py +18 -5
  35. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/prompts/base.py +13 -13
  36. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/prompts/chat.py +17 -10
  37. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/prompts/dict.py +7 -4
  38. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/prompts/few_shot_with_templates.py +2 -1
  39. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/prompts/image.py +2 -2
  40. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/prompts/message.py +1 -1
  41. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/prompts/string.py +18 -10
  42. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/prompts/structured.py +3 -0
  43. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/base.py +14 -5
  44. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/config.py +3 -1
  45. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/graph_ascii.py +3 -0
  46. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/graph_mermaid.py +11 -7
  47. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/graph_png.py +4 -3
  48. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/history.py +4 -4
  49. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/passthrough.py +10 -16
  50. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/router.py +4 -4
  51. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/utils.py +9 -3
  52. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tools/base.py +45 -9
  53. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tools/convert.py +2 -2
  54. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tools/retriever.py +4 -2
  55. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tools/simple.py +3 -2
  56. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tools/structured.py +3 -2
  57. langchain_core-1.2.7/langchain_core/tracers/_compat.py +93 -0
  58. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/context.py +1 -1
  59. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/core.py +14 -4
  60. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/evaluation.py +4 -3
  61. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/event_stream.py +8 -8
  62. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/langchain.py +59 -7
  63. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/log_stream.py +4 -4
  64. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/run_collector.py +2 -1
  65. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/_merge.py +11 -12
  66. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/aiter.py +1 -1
  67. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/env.py +2 -2
  68. langchain_core-1.2.7/langchain_core/utils/formatting.py +80 -0
  69. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/function_calling.py +29 -28
  70. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/html.py +8 -2
  71. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/input.py +3 -0
  72. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/json.py +24 -2
  73. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/json_schema.py +20 -2
  74. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/mustache.py +22 -3
  75. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/pydantic.py +13 -12
  76. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/usage.py +21 -0
  77. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/uuid.py +3 -0
  78. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/vectorstores/__init__.py +19 -0
  79. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/vectorstores/in_memory.py +1 -1
  80. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/vectorstores/utils.py +2 -2
  81. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/version.py +1 -1
  82. {langchain_core-1.2.2 → langchain_core-1.2.7}/pyproject.toml +4 -10
  83. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/benchmarks/test_async_callbacks.py +1 -1
  84. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/benchmarks/test_imports.py +1 -1
  85. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/_api/test_deprecation.py +85 -0
  86. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/callbacks/test_sync_callback_manager.py +0 -5
  87. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/document_loaders/test_langsmith.py +3 -1
  88. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/example_selectors/test_base.py +1 -1
  89. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/example_selectors/test_length_based_example_selector.py +15 -0
  90. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/fake/callbacks.py +4 -2
  91. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/language_models/chat_models/test_base.py +18 -25
  92. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/language_models/chat_models/test_cache.py +59 -1
  93. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/load/test_imports.py +8 -1
  94. langchain_core-1.2.7/tests/unit_tests/load/test_secret_injection.py +431 -0
  95. langchain_core-1.2.7/tests/unit_tests/load/test_serializable.py +893 -0
  96. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/messages/block_translators/test_openai.py +15 -14
  97. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/messages/test_ai.py +2 -2
  98. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/messages/test_utils.py +187 -4
  99. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/output_parsers/test_openai_tools.py +11 -7
  100. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/output_parsers/test_pydantic_parser.py +6 -10
  101. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/outputs/test_chat_generation.py +4 -2
  102. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/__snapshots__/test_chat.ambr +0 -20
  103. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/test_chat.py +323 -47
  104. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/test_dict.py +1 -1
  105. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/test_few_shot.py +5 -3
  106. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/test_image.py +2 -2
  107. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/test_loading.py +1 -1
  108. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/test_prompt.py +2 -2
  109. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/test_structured.py +4 -6
  110. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/pydantic_utils.py +23 -22
  111. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/__snapshots__/test_graph.ambr +0 -10
  112. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr +0 -80
  113. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/test_concurrency.py +2 -2
  114. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/test_config.py +2 -2
  115. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/test_fallbacks.py +21 -21
  116. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/test_graph.py +45 -2
  117. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/test_history.py +8 -9
  118. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/test_runnable.py +62 -55
  119. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/test_runnable_events_v1.py +9 -13
  120. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/test_runnable_events_v2.py +5 -11
  121. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/test_tracing_interops.py +16 -8
  122. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/test_utils.py +6 -5
  123. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/stores/test_in_memory.py +3 -1
  124. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/test_messages.py +30 -6
  125. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/test_tools.py +309 -44
  126. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/tracers/test_async_base_tracer.py +63 -46
  127. langchain_core-1.2.7/tests/unit_tests/tracers/test_automatic_metadata.py +155 -0
  128. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/tracers/test_base_tracer.py +63 -46
  129. langchain_core-1.2.7/tests/unit_tests/tracers/test_langchain.py +570 -0
  130. langchain_core-1.2.7/tests/unit_tests/utils/test_formatting.py +127 -0
  131. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/test_function_calling.py +11 -0
  132. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/test_json_schema.py +78 -0
  133. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/test_utils.py +104 -1
  134. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/vectorstores/test_in_memory.py +1 -1
  135. {langchain_core-1.2.2 → langchain_core-1.2.7}/uv.lock +142 -68
  136. langchain_core-1.2.2/langchain_core/load/dump.py +0 -82
  137. langchain_core-1.2.2/langchain_core/load/load.py +0 -289
  138. langchain_core-1.2.2/langchain_core/utils/formatting.py +0 -51
  139. langchain_core-1.2.2/tests/unit_tests/load/test_serializable.py +0 -367
  140. langchain_core-1.2.2/tests/unit_tests/tracers/test_langchain.py +0 -147
  141. {langchain_core-1.2.2 → langchain_core-1.2.7}/.gitignore +0 -0
  142. {langchain_core-1.2.2 → langchain_core-1.2.7}/Makefile +0 -0
  143. {langchain_core-1.2.2 → langchain_core-1.2.7}/README.md +0 -0
  144. {langchain_core-1.2.2 → langchain_core-1.2.7}/extended_testing_deps.txt +0 -0
  145. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/__init__.py +0 -0
  146. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/_api/beta_decorator.py +0 -0
  147. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/_api/path.py +0 -0
  148. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/_import_utils.py +0 -0
  149. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/agents.py +0 -0
  150. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/callbacks/__init__.py +0 -0
  151. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/callbacks/file.py +0 -0
  152. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/callbacks/stdout.py +0 -0
  153. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/callbacks/streaming_stdout.py +0 -0
  154. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/callbacks/usage.py +0 -0
  155. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/chat_history.py +0 -0
  156. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/chat_loaders.py +0 -0
  157. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/chat_sessions.py +0 -0
  158. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/document_loaders/__init__.py +0 -0
  159. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/document_loaders/base.py +0 -0
  160. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/document_loaders/blob_loaders.py +0 -0
  161. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/documents/__init__.py +0 -0
  162. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/documents/base.py +0 -0
  163. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/documents/compressor.py +0 -0
  164. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/documents/transformers.py +0 -0
  165. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/embeddings/__init__.py +0 -0
  166. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/embeddings/embeddings.py +0 -0
  167. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/embeddings/fake.py +0 -0
  168. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/env.py +0 -0
  169. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/example_selectors/__init__.py +0 -0
  170. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/example_selectors/base.py +0 -0
  171. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/example_selectors/semantic_similarity.py +0 -0
  172. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/exceptions.py +0 -0
  173. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/globals.py +0 -0
  174. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/indexing/__init__.py +0 -0
  175. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/indexing/base.py +0 -0
  176. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/indexing/in_memory.py +0 -0
  177. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/language_models/__init__.py +0 -0
  178. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/language_models/_utils.py +0 -0
  179. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/language_models/fake.py +0 -0
  180. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/language_models/fake_chat_models.py +0 -0
  181. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/__init__.py +0 -0
  182. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/block_translators/__init__.py +0 -0
  183. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/block_translators/google_vertexai.py +0 -0
  184. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/block_translators/langchain_v0.py +0 -0
  185. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/chat.py +0 -0
  186. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/function.py +0 -0
  187. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/human.py +0 -0
  188. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/modifier.py +0 -0
  189. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/system.py +0 -0
  190. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/messages/tool.py +0 -0
  191. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/output_parsers/__init__.py +0 -0
  192. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/output_parsers/format_instructions.py +0 -0
  193. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/output_parsers/json.py +0 -0
  194. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/output_parsers/list.py +0 -0
  195. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/output_parsers/openai_tools.py +0 -0
  196. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/output_parsers/string.py +0 -0
  197. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/output_parsers/transform.py +0 -0
  198. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/output_parsers/xml.py +0 -0
  199. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/outputs/__init__.py +0 -0
  200. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/outputs/chat_generation.py +0 -0
  201. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/outputs/chat_result.py +0 -0
  202. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/outputs/generation.py +0 -0
  203. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/outputs/llm_result.py +0 -0
  204. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/outputs/run_info.py +0 -0
  205. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/prompts/__init__.py +0 -0
  206. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/prompts/few_shot.py +0 -0
  207. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/prompts/loading.py +0 -0
  208. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/prompts/prompt.py +0 -0
  209. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/py.typed +0 -0
  210. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/rate_limiters.py +0 -0
  211. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/retrievers.py +0 -0
  212. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/__init__.py +0 -0
  213. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/branch.py +0 -0
  214. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/configurable.py +0 -0
  215. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/fallbacks.py +0 -0
  216. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/graph.py +0 -0
  217. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/retry.py +0 -0
  218. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/runnables/schema.py +0 -0
  219. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/stores.py +0 -0
  220. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/structured_query.py +0 -0
  221. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/sys_info.py +0 -0
  222. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tools/__init__.py +0 -0
  223. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tools/render.py +0 -0
  224. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/__init__.py +0 -0
  225. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/_streaming.py +0 -0
  226. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/base.py +0 -0
  227. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/memory_stream.py +0 -0
  228. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/root_listeners.py +0 -0
  229. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/schemas.py +0 -0
  230. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/tracers/stdout.py +0 -0
  231. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/__init__.py +0 -0
  232. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/image.py +0 -0
  233. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/interactive_env.py +0 -0
  234. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/iter.py +0 -0
  235. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/strings.py +0 -0
  236. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/utils/utils.py +0 -0
  237. {langchain_core-1.2.2 → langchain_core-1.2.7}/langchain_core/vectorstores/base.py +0 -0
  238. {langchain_core-1.2.2 → langchain_core-1.2.7}/scripts/check_imports.py +0 -0
  239. {langchain_core-1.2.2 → langchain_core-1.2.7}/scripts/lint_imports.sh +0 -0
  240. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/__init__.py +0 -0
  241. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/benchmarks/__init__.py +0 -0
  242. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/integration_tests/__init__.py +0 -0
  243. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/integration_tests/test_compile.py +0 -0
  244. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/__init__.py +0 -0
  245. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/_api/__init__.py +0 -0
  246. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/_api/test_beta_decorator.py +0 -0
  247. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/_api/test_imports.py +0 -0
  248. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/_api/test_path.py +0 -0
  249. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/caches/__init__.py +0 -0
  250. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/caches/test_in_memory_cache.py +0 -0
  251. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/callbacks/__init__.py +0 -0
  252. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/callbacks/test_async_callback_manager.py +0 -0
  253. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/callbacks/test_dispatch_custom_event.py +0 -0
  254. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/callbacks/test_imports.py +0 -0
  255. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/callbacks/test_usage_callback.py +0 -0
  256. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/chat_history/__init__.py +0 -0
  257. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/chat_history/test_chat_history.py +0 -0
  258. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/conftest.py +0 -0
  259. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/data/prompt_file.txt +0 -0
  260. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/data/prompts/prompt_extra_args.json +0 -0
  261. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/data/prompts/prompt_missing_args.json +0 -0
  262. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/data/prompts/simple_prompt.json +0 -0
  263. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/dependencies/__init__.py +0 -0
  264. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/dependencies/test_dependencies.py +0 -0
  265. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/document_loaders/__init__.py +0 -0
  266. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/document_loaders/test_base.py +0 -0
  267. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/documents/__init__.py +0 -0
  268. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/documents/test_document.py +0 -0
  269. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/documents/test_imports.py +0 -0
  270. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/documents/test_str.py +0 -0
  271. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/embeddings/__init__.py +0 -0
  272. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/embeddings/test_deterministic_embedding.py +0 -0
  273. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/example_selectors/__init__.py +0 -0
  274. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/example_selectors/test_imports.py +0 -0
  275. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/example_selectors/test_similarity.py +0 -0
  276. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/example-non-utf8.csv +0 -0
  277. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/example-non-utf8.txt +0 -0
  278. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/example-utf8.csv +0 -0
  279. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/example-utf8.txt +0 -0
  280. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/example_prompt.json +0 -0
  281. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/examples.json +0 -0
  282. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/examples.yaml +0 -0
  283. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/few_shot_prompt.json +0 -0
  284. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/few_shot_prompt.yaml +0 -0
  285. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/few_shot_prompt_example_prompt.json +0 -0
  286. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/few_shot_prompt_examples_in.json +0 -0
  287. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/few_shot_prompt_yaml_examples.yaml +0 -0
  288. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/jinja_injection_prompt.json +0 -0
  289. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/jinja_injection_prompt.yaml +0 -0
  290. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/prompt_with_output_parser.json +0 -0
  291. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/simple_prompt.json +0 -0
  292. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/simple_prompt.yaml +0 -0
  293. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/simple_prompt_with_template_file.json +0 -0
  294. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/examples/simple_template.txt +0 -0
  295. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/fake/__init__.py +0 -0
  296. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/fake/test_fake_chat_model.py +0 -0
  297. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/indexing/__init__.py +0 -0
  298. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/indexing/test_hashed_document.py +0 -0
  299. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/indexing/test_in_memory_indexer.py +0 -0
  300. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/indexing/test_in_memory_record_manager.py +0 -0
  301. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/indexing/test_indexing.py +0 -0
  302. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/indexing/test_public_api.py +0 -0
  303. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/language_models/__init__.py +0 -0
  304. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/language_models/chat_models/__init__.py +0 -0
  305. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/language_models/chat_models/test_benchmark.py +0 -0
  306. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/language_models/chat_models/test_rate_limiting.py +0 -0
  307. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/language_models/llms/__init__.py +0 -0
  308. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/language_models/llms/test_base.py +0 -0
  309. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/language_models/llms/test_cache.py +0 -0
  310. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/language_models/test_imports.py +0 -0
  311. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/load/__init__.py +0 -0
  312. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/messages/__init__.py +0 -0
  313. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/messages/block_translators/__init__.py +0 -0
  314. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/messages/block_translators/test_anthropic.py +0 -0
  315. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/messages/block_translators/test_bedrock.py +0 -0
  316. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/messages/block_translators/test_bedrock_converse.py +0 -0
  317. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/messages/block_translators/test_google_genai.py +0 -0
  318. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/messages/block_translators/test_groq.py +0 -0
  319. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/messages/block_translators/test_langchain_v0.py +0 -0
  320. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/messages/block_translators/test_registration.py +0 -0
  321. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/messages/test_imports.py +0 -0
  322. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/output_parsers/__init__.py +0 -0
  323. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/output_parsers/test_base_parsers.py +0 -0
  324. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/output_parsers/test_imports.py +0 -0
  325. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/output_parsers/test_json.py +0 -0
  326. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/output_parsers/test_list_parser.py +0 -0
  327. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/output_parsers/test_openai_functions.py +0 -0
  328. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/output_parsers/test_xml_parser.py +0 -0
  329. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/outputs/__init__.py +0 -0
  330. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/outputs/test_imports.py +0 -0
  331. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompt_file.txt +0 -0
  332. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/__init__.py +0 -0
  333. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/__snapshots__/test_prompt.ambr +0 -0
  334. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/prompt_extra_args.json +0 -0
  335. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/prompt_missing_args.json +0 -0
  336. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/simple_prompt.json +0 -0
  337. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/test_few_shot_with_templates.py +0 -0
  338. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/test_imports.py +0 -0
  339. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/test_string.py +0 -0
  340. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/prompts/test_utils.py +0 -0
  341. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/rate_limiters/__init__.py +0 -0
  342. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/rate_limiters/test_in_memory_rate_limiter.py +0 -0
  343. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/__init__.py +0 -0
  344. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr +0 -0
  345. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/test_configurable.py +0 -0
  346. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/runnables/test_imports.py +0 -0
  347. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/stores/__init__.py +0 -0
  348. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/stubs.py +0 -0
  349. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/test_globals.py +0 -0
  350. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/test_imports.py +0 -0
  351. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/test_outputs.py +0 -0
  352. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/test_prompt_values.py +0 -0
  353. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/test_pydantic_imports.py +0 -0
  354. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/test_pydantic_serde.py +0 -0
  355. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/test_retrievers.py +0 -0
  356. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/test_setup.py +0 -0
  357. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/test_sys_info.py +0 -0
  358. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/tracers/__init__.py +0 -0
  359. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/tracers/test_imports.py +2 -2
  360. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/tracers/test_memory_stream.py +0 -0
  361. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/tracers/test_run_collector.py +0 -0
  362. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/tracers/test_schemas.py +0 -0
  363. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/__init__.py +0 -0
  364. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/test_aiter.py +0 -0
  365. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/test_env.py +0 -0
  366. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/test_html.py +0 -0
  367. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/test_imports.py +0 -0
  368. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/test_iter.py +0 -0
  369. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/test_pydantic.py +0 -0
  370. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/test_rm_titles.py +0 -0
  371. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/test_strings.py +0 -0
  372. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/test_usage.py +0 -0
  373. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/utils/test_uuid_utils.py +0 -0
  374. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/vectorstores/__init__.py +0 -0
  375. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/vectorstores/test_utils.py +0 -0
  376. {langchain_core-1.2.2 → langchain_core-1.2.7}/tests/unit_tests/vectorstores/test_vectorstore.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langchain-core
3
- Version: 1.2.2
3
+ Version: 1.2.7
4
4
  Summary: Building applications with LLMs through composability
5
5
  Project-URL: Homepage, https://docs.langchain.com/
6
6
  Project-URL: Documentation, https://reference.langchain.com/python/langchain_core/
@@ -58,6 +58,20 @@ _dynamic_imports = {
58
58
 
59
59
 
60
60
  def __getattr__(attr_name: str) -> object:
61
+ """Dynamically import and return an attribute from a submodule.
62
+
63
+ This function enables lazy loading of API functions from submodules, reducing
64
+ initial import time and circular dependency issues.
65
+
66
+ Args:
67
+ attr_name: Name of the attribute to import.
68
+
69
+ Returns:
70
+ The imported attribute object.
71
+
72
+ Raises:
73
+ AttributeError: If the attribute is not a valid dynamic import.
74
+ """
61
75
  module_name = _dynamic_imports.get(attr_name)
62
76
  result = import_attr(attr_name, module_name, __spec__.parent)
63
77
  globals()[attr_name] = result
@@ -65,4 +79,9 @@ def __getattr__(attr_name: str) -> object:
65
79
 
66
80
 
67
81
  def __dir__() -> list[str]:
82
+ """Return a list of available attributes for this module.
83
+
84
+ Returns:
85
+ List of attribute names that can be imported from this module.
86
+ """
68
87
  return list(__all__)
@@ -28,6 +28,27 @@ from pydantic.v1.fields import FieldInfo as FieldInfoV1
28
28
  from langchain_core._api.internal import is_caller_internal
29
29
 
30
30
 
31
+ def _build_deprecation_message(
32
+ *,
33
+ alternative: str = "",
34
+ alternative_import: str = "",
35
+ ) -> str:
36
+ """Build a simple deprecation message for `__deprecated__` attribute.
37
+
38
+ Args:
39
+ alternative: An alternative API name.
40
+ alternative_import: A fully qualified import path for the alternative.
41
+
42
+ Returns:
43
+ A deprecation message string for IDE/type checker display.
44
+ """
45
+ if alternative_import:
46
+ return f"Use {alternative_import} instead."
47
+ if alternative:
48
+ return f"Use {alternative} instead."
49
+ return "Deprecated."
50
+
51
+
31
52
  class LangChainDeprecationWarning(DeprecationWarning):
32
53
  """A class for issuing deprecation warnings for LangChain users."""
33
54
 
@@ -81,60 +102,57 @@ def deprecated(
81
102
  ) -> Callable[[T], T]:
82
103
  """Decorator to mark a function, a class, or a property as deprecated.
83
104
 
84
- When deprecating a classmethod, a staticmethod, or a property, the
85
- `@deprecated` decorator should go *under* `@classmethod` and
86
- `@staticmethod` (i.e., `deprecated` should directly decorate the
87
- underlying callable), but *over* `@property`.
105
+ When deprecating a classmethod, a staticmethod, or a property, the `@deprecated`
106
+ decorator should go *under* `@classmethod` and `@staticmethod` (i.e., `deprecated`
107
+ should directly decorate the underlying callable), but *over* `@property`.
88
108
 
89
- When deprecating a class `C` intended to be used as a base class in a
90
- multiple inheritance hierarchy, `C` *must* define an `__init__` method
91
- (if `C` instead inherited its `__init__` from its own base class, then
92
- `@deprecated` would mess up `__init__` inheritance when installing its
93
- own (deprecation-emitting) `C.__init__`).
109
+ When deprecating a class `C` intended to be used as a base class in a multiple
110
+ inheritance hierarchy, `C` *must* define an `__init__` method (if `C` instead
111
+ inherited its `__init__` from its own base class, then `@deprecated` would mess up
112
+ `__init__` inheritance when installing its own (deprecation-emitting) `C.__init__`).
94
113
 
95
- Parameters are the same as for `warn_deprecated`, except that *obj_type*
96
- defaults to 'class' if decorating a class, 'attribute' if decorating a
97
- property, and 'function' otherwise.
114
+ Parameters are the same as for `warn_deprecated`, except that *obj_type* defaults to
115
+ 'class' if decorating a class, 'attribute' if decorating a property, and 'function'
116
+ otherwise.
98
117
 
99
118
  Args:
100
- since:
101
- The release at which this API became deprecated.
102
- message:
103
- Override the default deprecation message. The %(since)s,
104
- %(name)s, %(alternative)s, %(obj_type)s, %(addendum)s,
105
- and %(removal)s format specifiers will be replaced by the
119
+ since: The release at which this API became deprecated.
120
+ message: Override the default deprecation message.
121
+
122
+ The `%(since)s`, `%(name)s`, `%(alternative)s`, `%(obj_type)s`,
123
+ `%(addendum)s`, and `%(removal)s` format specifiers will be replaced by the
106
124
  values of the respective arguments passed to this function.
107
- name:
108
- The name of the deprecated object.
109
- alternative:
110
- An alternative API that the user may use in place of the
111
- deprecated API. The deprecation warning will tell the user
112
- about this alternative if provided.
113
- alternative_import:
114
- An alternative import that the user may use instead.
115
- pending:
116
- If `True`, uses a `PendingDeprecationWarning` instead of a
117
- DeprecationWarning. Cannot be used together with removal.
118
- obj_type:
119
- The object type being deprecated.
120
- addendum:
121
- Additional text appended directly to the final message.
122
- removal:
123
- The expected removal version. With the default (an empty
124
- string), a removal version is automatically computed from
125
- since. Set to other Falsy values to not schedule a removal
126
- date. Cannot be used together with pending.
127
- package:
128
- The package of the deprecated object.
125
+ name: The name of the deprecated object.
126
+ alternative: An alternative API that the user may use in place of the deprecated
127
+ API.
128
+
129
+ The deprecation warning will tell the user about this alternative if
130
+ provided.
131
+ alternative_import: An alternative import that the user may use instead.
132
+ pending: If `True`, uses a `PendingDeprecationWarning` instead of a
133
+ `DeprecationWarning`.
134
+
135
+ Cannot be used together with removal.
136
+ obj_type: The object type being deprecated.
137
+ addendum: Additional text appended directly to the final message.
138
+ removal: The expected removal version.
139
+
140
+ With the default (an empty string), a removal version is automatically
141
+ computed from since. Set to other Falsy values to not schedule a removal
142
+ date.
143
+
144
+ Cannot be used together with pending.
145
+ package: The package of the deprecated object.
129
146
 
130
147
  Returns:
131
148
  A decorator to mark a function or class as deprecated.
132
149
 
133
- ```python
134
- @deprecated("1.4.0")
135
- def the_function_to_deprecate():
136
- pass
137
- ```
150
+ Example:
151
+ ```python
152
+ @deprecated("1.4.0")
153
+ def the_function_to_deprecate():
154
+ pass
155
+ ```
138
156
  """
139
157
  _validate_deprecation_params(
140
158
  removal, alternative, alternative_import, pending=pending
@@ -223,6 +241,11 @@ def deprecated(
223
241
  obj.__init__ = functools.wraps(obj.__init__)( # type: ignore[misc]
224
242
  warn_if_direct_instance
225
243
  )
244
+ # Set __deprecated__ for PEP 702 (IDE/type checker support)
245
+ obj.__deprecated__ = _build_deprecation_message( # type: ignore[attr-defined]
246
+ alternative=alternative,
247
+ alternative_import=alternative_import,
248
+ )
226
249
  return obj
227
250
 
228
251
  elif isinstance(obj, FieldInfoV1):
@@ -315,12 +338,15 @@ def deprecated(
315
338
 
316
339
  def finalize(wrapper: Callable[..., Any], new_doc: str) -> T: # noqa: ARG001
317
340
  """Finalize the property."""
318
- return cast(
319
- "T",
320
- _DeprecatedProperty(
321
- fget=obj.fget, fset=obj.fset, fdel=obj.fdel, doc=new_doc
322
- ),
341
+ prop = _DeprecatedProperty(
342
+ fget=obj.fget, fset=obj.fset, fdel=obj.fdel, doc=new_doc
323
343
  )
344
+ # Set __deprecated__ for PEP 702 (IDE/type checker support)
345
+ prop.__deprecated__ = _build_deprecation_message( # type: ignore[attr-defined]
346
+ alternative=alternative,
347
+ alternative_import=alternative_import,
348
+ )
349
+ return cast("T", prop)
324
350
 
325
351
  else:
326
352
  _name = _name or cast("type | Callable", obj).__qualname__
@@ -343,6 +369,11 @@ def deprecated(
343
369
  """
344
370
  wrapper = functools.wraps(wrapped)(wrapper)
345
371
  wrapper.__doc__ = new_doc
372
+ # Set __deprecated__ for PEP 702 (IDE/type checker support)
373
+ wrapper.__deprecated__ = _build_deprecation_message( # type: ignore[attr-defined]
374
+ alternative=alternative,
375
+ alternative_import=alternative_import,
376
+ )
346
377
  return cast("T", wrapper)
347
378
 
348
379
  old_doc = inspect.cleandoc(old_doc or "").strip("\n")
@@ -398,7 +429,7 @@ def deprecated(
398
429
 
399
430
  @contextlib.contextmanager
400
431
  def suppress_langchain_deprecation_warning() -> Generator[None, None, None]:
401
- """Context manager to suppress LangChainDeprecationWarning."""
432
+ """Context manager to suppress `LangChainDeprecationWarning`."""
402
433
  with warnings.catch_warnings():
403
434
  warnings.simplefilter("ignore", LangChainDeprecationWarning)
404
435
  warnings.simplefilter("ignore", LangChainPendingDeprecationWarning)
@@ -421,35 +452,33 @@ def warn_deprecated(
421
452
  """Display a standardized deprecation.
422
453
 
423
454
  Args:
424
- since:
425
- The release at which this API became deprecated.
426
- message:
427
- Override the default deprecation message. The %(since)s,
428
- %(name)s, %(alternative)s, %(obj_type)s, %(addendum)s,
429
- and %(removal)s format specifiers will be replaced by the
455
+ since: The release at which this API became deprecated.
456
+ message: Override the default deprecation message.
457
+
458
+ The `%(since)s`, `%(name)s`, `%(alternative)s`, `%(obj_type)s`,
459
+ `%(addendum)s`, and `%(removal)s` format specifiers will be replaced by the
430
460
  values of the respective arguments passed to this function.
431
- name:
432
- The name of the deprecated object.
433
- alternative:
434
- An alternative API that the user may use in place of the
435
- deprecated API. The deprecation warning will tell the user
436
- about this alternative if provided.
437
- alternative_import:
438
- An alternative import that the user may use instead.
439
- pending:
440
- If `True`, uses a `PendingDeprecationWarning` instead of a
441
- DeprecationWarning. Cannot be used together with removal.
442
- obj_type:
443
- The object type being deprecated.
444
- addendum:
445
- Additional text appended directly to the final message.
446
- removal:
447
- The expected removal version. With the default (an empty
448
- string), a removal version is automatically computed from
449
- since. Set to other Falsy values to not schedule a removal
450
- date. Cannot be used together with pending.
451
- package:
452
- The package of the deprecated object.
461
+ name: The name of the deprecated object.
462
+ alternative: An alternative API that the user may use in place of the
463
+ deprecated API.
464
+
465
+ The deprecation warning will tell the user about this alternative if
466
+ provided.
467
+ alternative_import: An alternative import that the user may use instead.
468
+ pending: If `True`, uses a `PendingDeprecationWarning` instead of a
469
+ `DeprecationWarning`.
470
+
471
+ Cannot be used together with removal.
472
+ obj_type: The object type being deprecated.
473
+ addendum: Additional text appended directly to the final message.
474
+ removal: The expected removal version.
475
+
476
+ With the default (an empty string), a removal version is automatically
477
+ computed from since. Set to other Falsy values to not schedule a removal
478
+ date.
479
+
480
+ Cannot be used together with pending.
481
+ package: The package of the deprecated object.
453
482
  """
454
483
  if not pending:
455
484
  if not removal:
@@ -534,8 +563,8 @@ def rename_parameter(
534
563
  """Decorator indicating that parameter *old* of *func* is renamed to *new*.
535
564
 
536
565
  The actual implementation of *func* should use *new*, not *old*. If *old* is passed
537
- to *func*, a DeprecationWarning is emitted, and its value is used, even if *new* is
538
- also passed by keyword.
566
+ to *func*, a `DeprecationWarning` is emitted, and its value is used, even if *new*
567
+ is also passed by keyword.
539
568
 
540
569
  Args:
541
570
  since: The version in which the parameter was renamed.
@@ -1,4 +1,5 @@
1
1
  import inspect
2
+ from typing import cast
2
3
 
3
4
 
4
5
  def is_caller_internal(depth: int = 2) -> bool:
@@ -16,7 +17,7 @@ def is_caller_internal(depth: int = 2) -> bool:
16
17
  return False
17
18
  # Directly access the module name from the frame's global variables
18
19
  module_globals = frame.f_globals
19
- caller_module_name = module_globals.get("__name__", "")
20
+ caller_module_name = cast("str", module_globals.get("__name__", ""))
20
21
  return caller_module_name.startswith("langchain")
21
22
  finally:
22
23
  del frame
@@ -3,6 +3,7 @@
3
3
  Distinct from provider-based [prompt caching](https://docs.langchain.com/oss/python/langchain/models#prompt-caching).
4
4
 
5
5
  !!! warning "Beta feature"
6
+
6
7
  This is a beta feature. Please be wary of deploying experimental code to production
7
8
  unless you've taken appropriate precautions.
8
9
 
@@ -960,28 +960,29 @@ class BaseCallbackManager(CallbackManagerMixin):
960
960
  # ['tag2', 'tag1']
961
961
  ```
962
962
  """ # noqa: E501
963
- manager = self.__class__(
963
+ # Combine handlers and inheritable_handlers separately, using sets
964
+ # to deduplicate (order not preserved)
965
+ combined_handlers = list(set(self.handlers) | set(other.handlers))
966
+ combined_inheritable = list(
967
+ set(self.inheritable_handlers) | set(other.inheritable_handlers)
968
+ )
969
+
970
+ return self.__class__(
964
971
  parent_run_id=self.parent_run_id or other.parent_run_id,
965
- handlers=[],
966
- inheritable_handlers=[],
972
+ handlers=combined_handlers,
973
+ inheritable_handlers=combined_inheritable,
967
974
  tags=list(set(self.tags + other.tags)),
968
975
  inheritable_tags=list(set(self.inheritable_tags + other.inheritable_tags)),
969
976
  metadata={
970
977
  **self.metadata,
971
978
  **other.metadata,
972
979
  },
980
+ inheritable_metadata={
981
+ **self.inheritable_metadata,
982
+ **other.inheritable_metadata,
983
+ },
973
984
  )
974
985
 
975
- handlers = self.handlers + other.handlers
976
- inheritable_handlers = self.inheritable_handlers + other.inheritable_handlers
977
-
978
- for handler in handlers:
979
- manager.add_handler(handler)
980
-
981
- for handler in inheritable_handlers:
982
- manager.add_handler(handler, inherit=True)
983
- return manager
984
-
985
986
  @property
986
987
  def is_async(self) -> bool:
987
988
  """Whether the callback manager is async."""
@@ -12,7 +12,6 @@ from concurrent.futures import ThreadPoolExecutor
12
12
  from contextlib import asynccontextmanager, contextmanager
13
13
  from contextvars import copy_context
14
14
  from typing import TYPE_CHECKING, Any, TypeVar, cast
15
- from uuid import UUID
16
15
 
17
16
  from langsmith.run_helpers import get_tracing_context
18
17
  from typing_extensions import Self, override
@@ -44,6 +43,7 @@ from langchain_core.utils.uuid import uuid7
44
43
 
45
44
  if TYPE_CHECKING:
46
45
  from collections.abc import AsyncGenerator, Coroutine, Generator, Sequence
46
+ from uuid import UUID
47
47
 
48
48
  from tenacity import RetryCallState
49
49
 
@@ -11,6 +11,7 @@ from typing_extensions import override
11
11
 
12
12
  from langchain_core.document_loaders.base import BaseLoader
13
13
  from langchain_core.documents import Document
14
+ from langchain_core.tracers._compat import pydantic_to_dict
14
15
 
15
16
 
16
17
  class LangSmithLoader(BaseLoader):
@@ -118,14 +119,14 @@ class LangSmithLoader(BaseLoader):
118
119
  for key in self.content_key:
119
120
  content = content[key]
120
121
  content_str = self.format_content(content)
121
- metadata = example.dict()
122
+ metadata = pydantic_to_dict(example)
122
123
  # Stringify datetime and UUID types.
123
124
  for k in ("dataset_id", "created_at", "modified_at", "source_run_id", "id"):
124
125
  metadata[k] = str(metadata[k]) if metadata[k] else metadata[k]
125
126
  yield Document(content_str, metadata=metadata)
126
127
 
127
128
 
128
- def _stringify(x: str | dict) -> str:
129
+ def _stringify(x: str | dict[str, Any]) -> str:
129
130
  if isinstance(x, str):
130
131
  return x
131
132
  try:
@@ -11,7 +11,7 @@ from langchain_core.prompts.prompt import PromptTemplate
11
11
 
12
12
 
13
13
  def _get_length_based(text: str) -> int:
14
- return len(re.split("\n| ", text))
14
+ return len(re.split(r"\n| ", text))
15
15
 
16
16
 
17
17
  class LengthBasedExampleSelector(BaseExampleSelector, BaseModel):
@@ -242,6 +242,17 @@ def _delete(
242
242
  vector_store: VectorStore | DocumentIndex,
243
243
  ids: list[str],
244
244
  ) -> None:
245
+ """Delete documents from a vector store or document index by their IDs.
246
+
247
+ Args:
248
+ vector_store: The vector store or document index to delete from.
249
+ ids: List of document IDs to delete.
250
+
251
+ Raises:
252
+ IndexingException: If the delete operation fails.
253
+ TypeError: If the `vector_store` is neither a `VectorStore` nor a
254
+ `DocumentIndex`.
255
+ """
245
256
  if isinstance(vector_store, VectorStore):
246
257
  delete_ok = vector_store.delete(ids)
247
258
  if delete_ok is not None and delete_ok is False:
@@ -12,13 +12,14 @@ from typing import (
12
12
  Literal,
13
13
  TypeAlias,
14
14
  TypeVar,
15
+ cast,
15
16
  )
16
17
 
17
18
  from pydantic import BaseModel, ConfigDict, Field, field_validator
18
19
  from typing_extensions import TypedDict, override
19
20
 
20
- from langchain_core.caches import BaseCache
21
- from langchain_core.callbacks import Callbacks
21
+ from langchain_core.caches import BaseCache # noqa: TC001
22
+ from langchain_core.callbacks import Callbacks # noqa: TC001
22
23
  from langchain_core.globals import get_verbose
23
24
  from langchain_core.messages import (
24
25
  AIMessage,
@@ -86,13 +87,28 @@ def get_tokenizer() -> Any:
86
87
  return GPT2TokenizerFast.from_pretrained("gpt2")
87
88
 
88
89
 
90
+ _GPT2_TOKENIZER_WARNED = False
91
+
92
+
89
93
  def _get_token_ids_default_method(text: str) -> list[int]:
90
- """Encode the text into token IDs."""
91
- # get the cached tokenizer
94
+ """Encode the text into token IDs using the fallback GPT-2 tokenizer."""
95
+ global _GPT2_TOKENIZER_WARNED # noqa: PLW0603
96
+ if not _GPT2_TOKENIZER_WARNED:
97
+ warnings.warn(
98
+ "Using fallback GPT-2 tokenizer for token counting. "
99
+ "Token counts may be inaccurate for non-GPT-2 models. "
100
+ "For accurate counts, use a model-specific method if available.",
101
+ stacklevel=3,
102
+ )
103
+ _GPT2_TOKENIZER_WARNED = True
104
+
92
105
  tokenizer = get_tokenizer()
93
106
 
94
- # tokenize the text using the GPT-2 tokenizer
95
- return tokenizer.encode(text)
107
+ # Pass verbose=False to suppress the "Token indices sequence length is longer than
108
+ # the specified maximum sequence length" warning from HuggingFace. This warning is
109
+ # about GPT-2's 1024 token context limit, but we're only using the tokenizer for
110
+ # counting, not for model input.
111
+ return cast("list[int]", tokenizer.encode(text, verbose=False))
96
112
 
97
113
 
98
114
  LanguageModelInput = PromptValue | str | Sequence[MessageLikeRepresentation]
@@ -341,6 +341,7 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
341
341
  """Profile detailing model capabilities.
342
342
 
343
343
  !!! warning "Beta feature"
344
+
344
345
  This is a beta feature. The format of model profiles is subject to change.
345
346
 
346
347
  If not specified, automatically loaded from the provider package on initialization
@@ -358,7 +359,10 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
358
359
 
359
360
  @cached_property
360
361
  def _serialized(self) -> dict[str, Any]:
361
- return dumpd(self)
362
+ # self is always a Serializable object in this case, thus the result is
363
+ # guaranteed to be a dict since dumps uses the default callback, which uses
364
+ # obj.to_json which always returns TypedDict subclasses
365
+ return cast("dict[str, Any]", dumpd(self))
362
366
 
363
367
  # --- Runnable methods ---
364
368
 
@@ -461,7 +465,7 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
461
465
 
462
466
  # Check if a runtime streaming flag has been passed in.
463
467
  if "stream" in kwargs:
464
- return kwargs["stream"]
468
+ return bool(kwargs["stream"])
465
469
 
466
470
  if "streaming" in self.model_fields_set:
467
471
  streaming_value = getattr(self, "streaming", None)
@@ -547,7 +551,7 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
547
551
  ):
548
552
  if block["type"] != index_type:
549
553
  index_type = block["type"]
550
- index = index + 1
554
+ index += 1
551
555
  if "index" not in block:
552
556
  block["index"] = index
553
557
  run_manager.on_llm_new_token(
@@ -679,7 +683,7 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
679
683
  ):
680
684
  if block["type"] != index_type:
681
685
  index_type = block["type"]
682
- index = index + 1
686
+ index += 1
683
687
  if "index" not in block:
684
688
  block["index"] = index
685
689
  await run_manager.on_llm_new_token(
@@ -730,7 +734,7 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
730
734
 
731
735
  # --- Custom methods ---
732
736
 
733
- def _combine_llm_outputs(self, llm_outputs: list[dict | None]) -> dict: # noqa: ARG002
737
+ def _combine_llm_outputs(self, _llm_outputs: list[dict | None], /) -> dict:
734
738
  return {}
735
739
 
736
740
  def _convert_cached_generations(self, cache_val: list) -> list[ChatGeneration]:
@@ -1144,7 +1148,15 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
1144
1148
  if check_cache:
1145
1149
  if llm_cache:
1146
1150
  llm_string = self._get_llm_string(stop=stop, **kwargs)
1147
- prompt = dumps(messages)
1151
+ normalized_messages = [
1152
+ (
1153
+ msg.model_copy(update={"id": None})
1154
+ if getattr(msg, "id", None) is not None
1155
+ else msg
1156
+ )
1157
+ for msg in messages
1158
+ ]
1159
+ prompt = dumps(normalized_messages)
1148
1160
  cache_val = llm_cache.lookup(prompt, llm_string)
1149
1161
  if isinstance(cache_val, list):
1150
1162
  converted_generations = self._convert_cached_generations(cache_val)
@@ -1187,7 +1199,7 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
1187
1199
  ):
1188
1200
  if block["type"] != index_type:
1189
1201
  index_type = block["type"]
1190
- index = index + 1
1202
+ index += 1
1191
1203
  if "index" not in block:
1192
1204
  block["index"] = index
1193
1205
  if run_manager:
@@ -1262,7 +1274,15 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
1262
1274
  if check_cache:
1263
1275
  if llm_cache:
1264
1276
  llm_string = self._get_llm_string(stop=stop, **kwargs)
1265
- prompt = dumps(messages)
1277
+ normalized_messages = [
1278
+ (
1279
+ msg.model_copy(update={"id": None})
1280
+ if getattr(msg, "id", None) is not None
1281
+ else msg
1282
+ )
1283
+ for msg in messages
1284
+ ]
1285
+ prompt = dumps(normalized_messages)
1266
1286
  cache_val = await llm_cache.alookup(prompt, llm_string)
1267
1287
  if isinstance(cache_val, list):
1268
1288
  converted_generations = self._convert_cached_generations(cache_val)
@@ -1305,7 +1325,7 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
1305
1325
  ):
1306
1326
  if block["type"] != index_type:
1307
1327
  index_type = block["type"]
1308
- index = index + 1
1328
+ index += 1
1309
1329
  if "index" not in block:
1310
1330
  block["index"] = index
1311
1331
  if run_manager:
@@ -301,7 +301,10 @@ class BaseLLM(BaseLanguageModel[str], ABC):
301
301
 
302
302
  @functools.cached_property
303
303
  def _serialized(self) -> dict[str, Any]:
304
- return dumpd(self)
304
+ # self is always a Serializable object in this case, thus the result is
305
+ # guaranteed to be a dict since dumps uses the default callback, which uses
306
+ # obj.to_json which always returns TypedDict subclasses
307
+ return cast("dict[str, Any]", dumpd(self))
305
308
 
306
309
  # --- Runnable methods ---
307
310
 
@@ -7,6 +7,7 @@ class ModelProfile(TypedDict, total=False):
7
7
  """Model profile.
8
8
 
9
9
  !!! warning "Beta feature"
10
+
10
11
  This is a beta feature. The format of model profiles is subject to change.
11
12
 
12
13
  Provides information about chat model capabilities, such as context window sizes
@@ -6,7 +6,7 @@ from langchain_core._import_utils import import_attr
6
6
 
7
7
  if TYPE_CHECKING:
8
8
  from langchain_core.load.dump import dumpd, dumps
9
- from langchain_core.load.load import loads
9
+ from langchain_core.load.load import InitValidator, loads
10
10
  from langchain_core.load.serializable import Serializable
11
11
 
12
12
  # Unfortunately, we have to eagerly import load from langchain_core/load/load.py
@@ -15,11 +15,19 @@ if TYPE_CHECKING:
15
15
  # the `from langchain_core.load.load import load` absolute import should also work.
16
16
  from langchain_core.load.load import load
17
17
 
18
- __all__ = ("Serializable", "dumpd", "dumps", "load", "loads")
18
+ __all__ = (
19
+ "InitValidator",
20
+ "Serializable",
21
+ "dumpd",
22
+ "dumps",
23
+ "load",
24
+ "loads",
25
+ )
19
26
 
20
27
  _dynamic_imports = {
21
28
  "dumpd": "dump",
22
29
  "dumps": "dump",
30
+ "InitValidator": "load",
23
31
  "loads": "load",
24
32
  "Serializable": "serializable",
25
33
  }