langchain-core 0.3.79__tar.gz → 1.0.0__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 (386) hide show
  1. langchain_core-1.0.0/.gitignore +163 -0
  2. langchain_core-1.0.0/Makefile +75 -0
  3. {langchain_core-0.3.79 → langchain_core-1.0.0}/PKG-INFO +28 -27
  4. {langchain_core-0.3.79 → langchain_core-1.0.0}/README.md +15 -17
  5. langchain_core-1.0.0/extended_testing_deps.txt +1 -0
  6. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/__init__.py +1 -1
  7. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/_api/__init__.py +3 -4
  8. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/_api/beta_decorator.py +23 -26
  9. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/_api/deprecation.py +52 -65
  10. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/_api/path.py +3 -6
  11. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/_import_utils.py +3 -4
  12. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/agents.py +19 -19
  13. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/caches.py +53 -63
  14. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/callbacks/__init__.py +1 -8
  15. langchain_core-1.0.0/langchain_core/callbacks/base.py +1107 -0
  16. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/callbacks/file.py +44 -44
  17. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/callbacks/manager.py +441 -507
  18. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/callbacks/stdout.py +29 -30
  19. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/callbacks/streaming_stdout.py +32 -32
  20. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/callbacks/usage.py +60 -57
  21. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/chat_history.py +48 -63
  22. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/document_loaders/base.py +23 -23
  23. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/document_loaders/langsmith.py +37 -37
  24. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/documents/__init__.py +0 -1
  25. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/documents/base.py +62 -65
  26. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/documents/compressor.py +4 -4
  27. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/documents/transformers.py +28 -29
  28. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/embeddings/fake.py +50 -54
  29. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/example_selectors/length_based.py +1 -1
  30. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/example_selectors/semantic_similarity.py +21 -25
  31. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/exceptions.py +10 -11
  32. langchain_core-1.0.0/langchain_core/globals.py +72 -0
  33. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/indexing/api.py +61 -66
  34. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/indexing/base.py +58 -58
  35. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/indexing/in_memory.py +3 -3
  36. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/language_models/__init__.py +14 -27
  37. langchain_core-1.0.0/langchain_core/language_models/_utils.py +326 -0
  38. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/language_models/base.py +55 -162
  39. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/language_models/chat_models.py +442 -402
  40. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/language_models/fake.py +11 -11
  41. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/language_models/fake_chat_models.py +61 -39
  42. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/language_models/llms.py +123 -231
  43. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/load/dump.py +4 -5
  44. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/load/load.py +18 -28
  45. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/load/mapping.py +2 -4
  46. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/load/serializable.py +39 -40
  47. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/messages/__init__.py +61 -22
  48. langchain_core-1.0.0/langchain_core/messages/ai.py +800 -0
  49. langchain_core-1.0.0/langchain_core/messages/base.py +479 -0
  50. langchain_core-1.0.0/langchain_core/messages/block_translators/__init__.py +111 -0
  51. langchain_core-1.0.0/langchain_core/messages/block_translators/anthropic.py +470 -0
  52. langchain_core-1.0.0/langchain_core/messages/block_translators/bedrock.py +94 -0
  53. langchain_core-1.0.0/langchain_core/messages/block_translators/bedrock_converse.py +297 -0
  54. langchain_core-1.0.0/langchain_core/messages/block_translators/google_genai.py +530 -0
  55. langchain_core-1.0.0/langchain_core/messages/block_translators/google_vertexai.py +21 -0
  56. langchain_core-1.0.0/langchain_core/messages/block_translators/groq.py +143 -0
  57. langchain_core-1.0.0/langchain_core/messages/block_translators/langchain_v0.py +301 -0
  58. langchain_core-1.0.0/langchain_core/messages/block_translators/openai.py +1010 -0
  59. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/messages/chat.py +2 -6
  60. langchain_core-1.0.0/langchain_core/messages/content.py +1423 -0
  61. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/messages/function.py +6 -10
  62. langchain_core-1.0.0/langchain_core/messages/human.py +70 -0
  63. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/messages/modifier.py +2 -2
  64. langchain_core-1.0.0/langchain_core/messages/system.py +70 -0
  65. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/messages/tool.py +96 -103
  66. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/messages/utils.py +478 -504
  67. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/output_parsers/__init__.py +1 -14
  68. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/output_parsers/base.py +58 -61
  69. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/output_parsers/json.py +7 -8
  70. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/output_parsers/list.py +5 -7
  71. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/output_parsers/openai_functions.py +49 -47
  72. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/output_parsers/openai_tools.py +14 -19
  73. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/output_parsers/pydantic.py +12 -13
  74. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/output_parsers/string.py +2 -2
  75. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/output_parsers/transform.py +15 -17
  76. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/output_parsers/xml.py +8 -10
  77. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/outputs/__init__.py +1 -1
  78. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/outputs/chat_generation.py +18 -18
  79. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/outputs/chat_result.py +1 -3
  80. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/outputs/generation.py +8 -8
  81. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/outputs/llm_result.py +10 -10
  82. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/prompt_values.py +12 -12
  83. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/prompts/__init__.py +3 -27
  84. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/prompts/base.py +45 -55
  85. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/prompts/chat.py +254 -313
  86. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/prompts/dict.py +5 -5
  87. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/prompts/few_shot.py +81 -88
  88. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/prompts/few_shot_with_templates.py +11 -13
  89. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/prompts/image.py +12 -14
  90. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/prompts/loading.py +6 -8
  91. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/prompts/message.py +3 -3
  92. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/prompts/prompt.py +24 -39
  93. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/prompts/string.py +4 -4
  94. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/prompts/structured.py +42 -50
  95. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/rate_limiters.py +51 -60
  96. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/retrievers.py +49 -190
  97. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/base.py +1484 -1709
  98. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/branch.py +45 -61
  99. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/config.py +80 -88
  100. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/configurable.py +117 -134
  101. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/fallbacks.py +83 -79
  102. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/graph.py +85 -95
  103. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/graph_ascii.py +27 -28
  104. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/graph_mermaid.py +38 -50
  105. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/graph_png.py +15 -16
  106. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/history.py +135 -148
  107. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/passthrough.py +124 -150
  108. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/retry.py +46 -51
  109. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/router.py +25 -30
  110. langchain_core-1.0.0/langchain_core/runnables/schema.py +185 -0
  111. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/utils.py +62 -68
  112. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/stores.py +81 -115
  113. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/structured_query.py +8 -8
  114. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/sys_info.py +27 -29
  115. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tools/__init__.py +1 -14
  116. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tools/base.py +179 -187
  117. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tools/convert.py +131 -139
  118. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tools/render.py +10 -10
  119. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tools/retriever.py +11 -11
  120. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tools/simple.py +19 -24
  121. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tools/structured.py +30 -39
  122. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tracers/__init__.py +1 -9
  123. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tracers/base.py +97 -99
  124. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tracers/context.py +29 -52
  125. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tracers/core.py +50 -60
  126. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tracers/evaluation.py +11 -11
  127. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tracers/event_stream.py +115 -70
  128. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tracers/langchain.py +21 -21
  129. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tracers/log_stream.py +43 -43
  130. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tracers/memory_stream.py +3 -3
  131. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tracers/root_listeners.py +16 -16
  132. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tracers/run_collector.py +2 -4
  133. langchain_core-1.0.0/langchain_core/tracers/schemas.py +14 -0
  134. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tracers/stdout.py +3 -3
  135. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/__init__.py +1 -4
  136. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/_merge.py +46 -8
  137. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/aiter.py +57 -61
  138. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/env.py +9 -9
  139. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/function_calling.py +89 -191
  140. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/html.py +7 -8
  141. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/input.py +6 -6
  142. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/interactive_env.py +1 -1
  143. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/iter.py +37 -42
  144. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/json.py +4 -3
  145. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/json_schema.py +8 -8
  146. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/mustache.py +9 -11
  147. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/pydantic.py +33 -35
  148. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/strings.py +5 -5
  149. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/usage.py +1 -1
  150. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/utils.py +80 -54
  151. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/vectorstores/base.py +129 -164
  152. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/vectorstores/in_memory.py +99 -174
  153. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/vectorstores/utils.py +5 -5
  154. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/version.py +1 -1
  155. langchain_core-1.0.0/pyproject.toml +136 -0
  156. langchain_core-1.0.0/scripts/check_imports.py +24 -0
  157. langchain_core-1.0.0/scripts/lint_imports.sh +17 -0
  158. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/benchmarks/test_async_callbacks.py +7 -7
  159. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/_api/test_deprecation.py +12 -12
  160. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/callbacks/test_async_callback_manager.py +2 -2
  161. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/callbacks/test_dispatch_custom_event.py +5 -5
  162. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/conftest.py +4 -5
  163. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/example_selectors/test_base.py +1 -3
  164. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/example_selectors/test_similarity.py +6 -6
  165. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/fake/callbacks.py +3 -3
  166. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/fake/test_fake_chat_model.py +19 -13
  167. langchain_core-1.0.0/tests/unit_tests/language_models/chat_models/test_base.py +1219 -0
  168. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/language_models/chat_models/test_cache.py +4 -4
  169. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/language_models/chat_models/test_rate_limiting.py +5 -3
  170. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/language_models/llms/test_base.py +15 -15
  171. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/language_models/llms/test_cache.py +7 -7
  172. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/language_models/test_imports.py +1 -0
  173. langchain_core-1.0.0/tests/unit_tests/messages/block_translators/test_anthropic.py +487 -0
  174. langchain_core-1.0.0/tests/unit_tests/messages/block_translators/test_bedrock.py +405 -0
  175. langchain_core-1.0.0/tests/unit_tests/messages/block_translators/test_bedrock_converse.py +379 -0
  176. langchain_core-1.0.0/tests/unit_tests/messages/block_translators/test_langchain_v0.py +113 -0
  177. langchain_core-1.0.0/tests/unit_tests/messages/block_translators/test_openai.py +604 -0
  178. langchain_core-1.0.0/tests/unit_tests/messages/block_translators/test_registration.py +29 -0
  179. langchain_core-1.0.0/tests/unit_tests/messages/test_ai.py +504 -0
  180. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/messages/test_imports.py +19 -0
  181. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/messages/test_utils.py +36 -10
  182. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/output_parsers/test_base_parsers.py +2 -2
  183. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/output_parsers/test_openai_tools.py +1 -1
  184. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/output_parsers/test_pydantic_parser.py +19 -12
  185. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/outputs/test_chat_generation.py +2 -4
  186. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/__snapshots__/test_chat.ambr +278 -300
  187. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/test_chat.py +11 -54
  188. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/test_few_shot.py +15 -15
  189. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/test_imports.py +0 -1
  190. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/test_prompt.py +2 -2
  191. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/test_structured.py +5 -5
  192. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/pydantic_utils.py +21 -28
  193. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/__snapshots__/test_graph.ambr +134 -145
  194. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr +1088 -1184
  195. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/test_configurable.py +5 -5
  196. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/test_fallbacks.py +13 -16
  197. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/test_graph.py +3 -3
  198. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/test_history.py +21 -26
  199. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/test_runnable.py +26 -33
  200. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/test_runnable_events_v1.py +82 -17
  201. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/test_runnable_events_v2.py +84 -25
  202. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/test_tracing_interops.py +5 -6
  203. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/test_utils.py +1 -5
  204. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/test_imports.py +1 -1
  205. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/test_messages.py +236 -97
  206. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/test_tools.py +83 -76
  207. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/tracers/test_async_base_tracer.py +3 -1
  208. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/tracers/test_base_tracer.py +3 -1
  209. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/tracers/test_memory_stream.py +1 -1
  210. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/tracers/test_run_collector.py +2 -2
  211. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/tracers/test_schemas.py +0 -10
  212. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/utils/test_function_calling.py +14 -23
  213. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/utils/test_imports.py +0 -1
  214. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/utils/test_pydantic.py +8 -2
  215. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/utils/test_utils.py +20 -14
  216. langchain_core-1.0.0/tests/unit_tests/vectorstores/__init__.py +0 -0
  217. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/vectorstores/test_vectorstore.py +7 -7
  218. langchain_core-1.0.0/uv.lock +3395 -0
  219. langchain_core-0.3.79/langchain_core/beta/__init__.py +0 -1
  220. langchain_core-0.3.79/langchain_core/beta/runnables/__init__.py +0 -1
  221. langchain_core-0.3.79/langchain_core/beta/runnables/context.py +0 -447
  222. langchain_core-0.3.79/langchain_core/callbacks/base.py +0 -1118
  223. langchain_core-0.3.79/langchain_core/globals.py +0 -220
  224. langchain_core-0.3.79/langchain_core/language_models/_utils.py +0 -140
  225. langchain_core-0.3.79/langchain_core/memory.py +0 -120
  226. langchain_core-0.3.79/langchain_core/messages/ai.py +0 -595
  227. langchain_core-0.3.79/langchain_core/messages/base.py +0 -308
  228. langchain_core-0.3.79/langchain_core/messages/content_blocks.py +0 -176
  229. langchain_core-0.3.79/langchain_core/messages/human.py +0 -67
  230. langchain_core-0.3.79/langchain_core/messages/system.py +0 -60
  231. langchain_core-0.3.79/langchain_core/prompts/pipeline.py +0 -138
  232. langchain_core-0.3.79/langchain_core/pydantic_v1/__init__.py +0 -30
  233. langchain_core-0.3.79/langchain_core/pydantic_v1/dataclasses.py +0 -23
  234. langchain_core-0.3.79/langchain_core/pydantic_v1/main.py +0 -23
  235. langchain_core-0.3.79/langchain_core/runnables/schema.py +0 -180
  236. langchain_core-0.3.79/langchain_core/tracers/langchain_v1.py +0 -31
  237. langchain_core-0.3.79/langchain_core/tracers/schemas.py +0 -143
  238. langchain_core-0.3.79/langchain_core/utils/loading.py +0 -35
  239. langchain_core-0.3.79/pyproject.toml +0 -181
  240. langchain_core-0.3.79/tests/unit_tests/language_models/chat_models/test_base.py +0 -710
  241. langchain_core-0.3.79/tests/unit_tests/messages/test_ai.py +0 -198
  242. langchain_core-0.3.79/tests/unit_tests/prompts/test_pipeline_prompt.py +0 -68
  243. langchain_core-0.3.79/tests/unit_tests/runnables/test_context.py +0 -427
  244. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/_api/internal.py +0 -0
  245. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/chat_loaders.py +0 -0
  246. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/chat_sessions.py +0 -0
  247. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/document_loaders/__init__.py +0 -0
  248. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/document_loaders/blob_loaders.py +0 -0
  249. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/embeddings/__init__.py +0 -0
  250. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/embeddings/embeddings.py +0 -0
  251. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/env.py +0 -0
  252. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/example_selectors/__init__.py +0 -0
  253. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/example_selectors/base.py +0 -0
  254. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/indexing/__init__.py +0 -0
  255. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/load/__init__.py +0 -0
  256. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/output_parsers/format_instructions.py +0 -0
  257. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/outputs/run_info.py +0 -0
  258. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/py.typed +0 -0
  259. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/runnables/__init__.py +0 -0
  260. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/tracers/_streaming.py +0 -0
  261. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/formatting.py +0 -0
  262. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/utils/image.py +0 -0
  263. {langchain_core-0.3.79 → langchain_core-1.0.0}/langchain_core/vectorstores/__init__.py +0 -0
  264. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/__init__.py +0 -0
  265. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/benchmarks/__init__.py +0 -0
  266. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/benchmarks/test_imports.py +0 -0
  267. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/integration_tests/__init__.py +0 -0
  268. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/integration_tests/test_compile.py +0 -0
  269. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/__init__.py +0 -0
  270. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/_api/__init__.py +0 -0
  271. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/_api/test_beta_decorator.py +0 -0
  272. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/_api/test_imports.py +0 -0
  273. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/_api/test_path.py +0 -0
  274. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/caches/__init__.py +0 -0
  275. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/caches/test_in_memory_cache.py +0 -0
  276. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/callbacks/__init__.py +0 -0
  277. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/callbacks/test_imports.py +0 -0
  278. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/callbacks/test_sync_callback_manager.py +0 -0
  279. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/callbacks/test_usage_callback.py +0 -0
  280. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/chat_history/__init__.py +0 -0
  281. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/chat_history/test_chat_history.py +0 -0
  282. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/data/prompt_file.txt +0 -0
  283. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/data/prompts/prompt_extra_args.json +0 -0
  284. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/data/prompts/prompt_missing_args.json +0 -0
  285. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/data/prompts/simple_prompt.json +0 -0
  286. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/dependencies/__init__.py +0 -0
  287. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/dependencies/test_dependencies.py +0 -0
  288. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/document_loaders/__init__.py +0 -0
  289. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/document_loaders/test_base.py +0 -0
  290. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/document_loaders/test_langsmith.py +0 -0
  291. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/documents/__init__.py +0 -0
  292. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/documents/test_document.py +0 -0
  293. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/documents/test_imports.py +0 -0
  294. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/documents/test_str.py +0 -0
  295. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/embeddings/__init__.py +0 -0
  296. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/embeddings/test_deterministic_embedding.py +0 -0
  297. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/example_selectors/__init__.py +0 -0
  298. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/example_selectors/test_imports.py +0 -0
  299. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/example_selectors/test_length_based_example_selector.py +0 -0
  300. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/example-non-utf8.csv +0 -0
  301. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/example-non-utf8.txt +0 -0
  302. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/example-utf8.csv +0 -0
  303. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/example-utf8.txt +0 -0
  304. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/example_prompt.json +0 -0
  305. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/examples.json +0 -0
  306. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/examples.yaml +0 -0
  307. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/few_shot_prompt.json +0 -0
  308. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/few_shot_prompt.yaml +0 -0
  309. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/few_shot_prompt_example_prompt.json +0 -0
  310. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/few_shot_prompt_examples_in.json +0 -0
  311. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/few_shot_prompt_yaml_examples.yaml +0 -0
  312. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/jinja_injection_prompt.json +0 -0
  313. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/jinja_injection_prompt.yaml +0 -0
  314. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/prompt_with_output_parser.json +0 -0
  315. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/simple_prompt.json +0 -0
  316. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/simple_prompt.yaml +0 -0
  317. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/simple_prompt_with_template_file.json +0 -0
  318. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/examples/simple_template.txt +0 -0
  319. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/fake/__init__.py +0 -0
  320. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/indexing/__init__.py +0 -0
  321. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/indexing/test_hashed_document.py +0 -0
  322. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/indexing/test_in_memory_indexer.py +0 -0
  323. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/indexing/test_in_memory_record_manager.py +0 -0
  324. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/indexing/test_indexing.py +0 -0
  325. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/indexing/test_public_api.py +0 -0
  326. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/language_models/__init__.py +0 -0
  327. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/language_models/chat_models/__init__.py +0 -0
  328. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/language_models/chat_models/test_benchmark.py +0 -0
  329. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/language_models/llms/__init__.py +0 -0
  330. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/load/__init__.py +0 -0
  331. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/load/test_imports.py +0 -0
  332. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/load/test_serializable.py +0 -0
  333. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/messages/__init__.py +0 -0
  334. {langchain_core-0.3.79/tests/unit_tests/output_parsers → langchain_core-1.0.0/tests/unit_tests/messages/block_translators}/__init__.py +0 -0
  335. {langchain_core-0.3.79/tests/unit_tests/outputs → langchain_core-1.0.0/tests/unit_tests/output_parsers}/__init__.py +0 -0
  336. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/output_parsers/test_imports.py +0 -0
  337. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/output_parsers/test_json.py +0 -0
  338. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/output_parsers/test_list_parser.py +0 -0
  339. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/output_parsers/test_openai_functions.py +0 -0
  340. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/output_parsers/test_xml_parser.py +0 -0
  341. {langchain_core-0.3.79/tests/unit_tests/rate_limiters → langchain_core-1.0.0/tests/unit_tests/outputs}/__init__.py +0 -0
  342. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/outputs/test_imports.py +0 -0
  343. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompt_file.txt +0 -0
  344. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/__init__.py +0 -0
  345. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/__snapshots__/test_prompt.ambr +0 -0
  346. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/prompt_extra_args.json +0 -0
  347. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/prompt_missing_args.json +0 -0
  348. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/simple_prompt.json +0 -0
  349. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/test_dict.py +0 -0
  350. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/test_few_shot_with_templates.py +0 -0
  351. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/test_image.py +0 -0
  352. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/test_loading.py +0 -0
  353. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/test_string.py +0 -0
  354. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/prompts/test_utils.py +0 -0
  355. {langchain_core-0.3.79/tests/unit_tests/runnables → langchain_core-1.0.0/tests/unit_tests/rate_limiters}/__init__.py +0 -0
  356. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/rate_limiters/test_in_memory_rate_limiter.py +0 -0
  357. {langchain_core-0.3.79/tests/unit_tests/stores → langchain_core-1.0.0/tests/unit_tests/runnables}/__init__.py +0 -0
  358. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr +0 -0
  359. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/test_concurrency.py +0 -0
  360. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/test_config.py +0 -0
  361. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/runnables/test_imports.py +0 -0
  362. {langchain_core-0.3.79/tests/unit_tests/tracers → langchain_core-1.0.0/tests/unit_tests/stores}/__init__.py +0 -0
  363. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/stores/test_in_memory.py +0 -0
  364. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/stubs.py +0 -0
  365. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/test_globals.py +0 -0
  366. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/test_outputs.py +0 -0
  367. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/test_prompt_values.py +0 -0
  368. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/test_pydantic_imports.py +0 -0
  369. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/test_pydantic_serde.py +0 -0
  370. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/test_retrievers.py +0 -0
  371. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/test_setup.py +0 -0
  372. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/test_sys_info.py +0 -0
  373. {langchain_core-0.3.79/tests/unit_tests/utils → langchain_core-1.0.0/tests/unit_tests/tracers}/__init__.py +0 -0
  374. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/tracers/test_imports.py +0 -0
  375. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/tracers/test_langchain.py +0 -0
  376. {langchain_core-0.3.79/tests/unit_tests/vectorstores → langchain_core-1.0.0/tests/unit_tests/utils}/__init__.py +0 -0
  377. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/utils/test_aiter.py +0 -0
  378. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/utils/test_env.py +0 -0
  379. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/utils/test_html.py +0 -0
  380. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/utils/test_iter.py +0 -0
  381. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/utils/test_json_schema.py +0 -0
  382. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/utils/test_rm_titles.py +0 -0
  383. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/utils/test_strings.py +0 -0
  384. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/utils/test_usage.py +0 -0
  385. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/vectorstores/test_in_memory.py +0 -0
  386. {langchain_core-0.3.79 → langchain_core-1.0.0}/tests/unit_tests/vectorstores/test_utils.py +0 -0
@@ -0,0 +1,163 @@
1
+ .vs/
2
+ .claude/
3
+ .idea/
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+
9
+ # C extensions
10
+ *.so
11
+
12
+ # Distribution / packaging
13
+ .Python
14
+ build/
15
+ develop-eggs/
16
+ dist/
17
+ downloads/
18
+ eggs/
19
+ .eggs/
20
+ lib/
21
+ lib64/
22
+ parts/
23
+ sdist/
24
+ var/
25
+ wheels/
26
+ pip-wheel-metadata/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # Google GitHub Actions credentials files created by:
34
+ # https://github.com/google-github-actions/auth
35
+ #
36
+ # That action recommends adding this gitignore to prevent accidentally committing keys.
37
+ gha-creds-*.json
38
+
39
+ # PyInstaller
40
+ # Usually these files are written by a python script from a template
41
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
42
+ *.manifest
43
+ *.spec
44
+
45
+ # Installer logs
46
+ pip-log.txt
47
+ pip-delete-this-directory.txt
48
+
49
+ # Unit test / coverage reports
50
+ htmlcov/
51
+ .tox/
52
+ .nox/
53
+ .coverage
54
+ .coverage.*
55
+ .cache
56
+ nosetests.xml
57
+ coverage.xml
58
+ *.cover
59
+ *.py,cover
60
+ .hypothesis/
61
+ .pytest_cache/
62
+ .codspeed/
63
+
64
+ # Translations
65
+ *.mo
66
+ *.pot
67
+
68
+ # Django stuff:
69
+ *.log
70
+ local_settings.py
71
+ db.sqlite3
72
+ db.sqlite3-journal
73
+
74
+ # Flask stuff:
75
+ instance/
76
+ .webassets-cache
77
+
78
+ # Scrapy stuff:
79
+ .scrapy
80
+
81
+ # PyBuilder
82
+ target/
83
+
84
+ # Jupyter Notebook
85
+ .ipynb_checkpoints
86
+ notebooks/
87
+
88
+ # IPython
89
+ profile_default/
90
+ ipython_config.py
91
+
92
+ # pyenv
93
+ .python-version
94
+
95
+ # pipenv
96
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
98
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
99
+ # install all needed dependencies.
100
+ #Pipfile.lock
101
+
102
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
103
+ __pypackages__/
104
+
105
+ # Celery stuff
106
+ celerybeat-schedule
107
+ celerybeat.pid
108
+
109
+ # SageMath parsed files
110
+ *.sage.py
111
+
112
+ # Environments
113
+ .env
114
+ .envrc
115
+ .venv*
116
+ venv*
117
+ env/
118
+ ENV/
119
+ env.bak/
120
+
121
+ # Spyder project settings
122
+ .spyderproject
123
+ .spyproject
124
+
125
+ # Rope project settings
126
+ .ropeproject
127
+
128
+ # mkdocs documentation
129
+ /site
130
+
131
+ # mypy
132
+ .mypy_cache/
133
+ .mypy_cache_test/
134
+ .dmypy.json
135
+ dmypy.json
136
+
137
+ # Pyre type checker
138
+ .pyre/
139
+
140
+ # macOS display setting files
141
+ .DS_Store
142
+
143
+ # Wandb directory
144
+ wandb/
145
+
146
+ # asdf tool versions
147
+ .tool-versions
148
+ /.ruff_cache/
149
+
150
+ *.pkl
151
+ *.bin
152
+
153
+ # integration test artifacts
154
+ data_map*
155
+ \[('_type', 'fake'), ('stop', None)]
156
+
157
+ # Replit files
158
+ *replit*
159
+
160
+ node_modules
161
+
162
+ prof
163
+ virtualenv/
@@ -0,0 +1,75 @@
1
+ .PHONY: all format lint test tests test_watch integration_tests help extended_tests
2
+
3
+ # Default target executed when no arguments are given to make.
4
+ all: help
5
+
6
+ # Define a variable for the test file path.
7
+ TEST_FILE ?= tests/unit_tests/
8
+
9
+ .EXPORT_ALL_VARIABLES:
10
+ UV_FROZEN = true
11
+
12
+ test tests:
13
+ env \
14
+ -u LANGCHAIN_TRACING_V2 \
15
+ -u LANGCHAIN_API_KEY \
16
+ -u LANGSMITH_TRACING \
17
+ -u LANGCHAIN_PROJECT \
18
+ uv run --group test pytest -n auto --disable-socket --allow-unix-socket $(TEST_FILE)
19
+
20
+ test_watch:
21
+ env \
22
+ -u LANGCHAIN_TRACING_V2 \
23
+ -u LANGCHAIN_API_KEY \
24
+ -u LANGSMITH_TRACING \
25
+ -u LANGCHAIN_PROJECT \
26
+ uv run --group test ptw --snapshot-update --now . --disable-socket --allow-unix-socket -vv -- $(TEST_FILE)
27
+
28
+ test_profile:
29
+ uv run --group test pytest -vv tests/unit_tests/ --profile-svg
30
+
31
+ check_imports: $(shell find langchain_core -name '*.py')
32
+ uv run --group test python ./scripts/check_imports.py $^
33
+
34
+ extended_tests:
35
+ uv run --group test pytest --only-extended --disable-socket --allow-unix-socket $(TEST_FILE)
36
+
37
+
38
+ ######################
39
+ # LINTING AND FORMATTING
40
+ ######################
41
+
42
+ # Define a variable for Python and notebook files.
43
+ PYTHON_FILES=.
44
+ MYPY_CACHE=.mypy_cache
45
+ lint format: PYTHON_FILES=.
46
+ lint_diff format_diff: PYTHON_FILES=$(shell git diff --relative=libs/core --name-only --diff-filter=d master | grep -E '\.py$$|\.ipynb$$')
47
+ lint_package: PYTHON_FILES=langchain_core
48
+ lint_tests: PYTHON_FILES=tests
49
+ lint_tests: MYPY_CACHE=.mypy_cache_test
50
+
51
+ lint lint_diff lint_package lint_tests:
52
+ ./scripts/lint_imports.sh
53
+ [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff check $(PYTHON_FILES)
54
+ [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff format $(PYTHON_FILES) --diff
55
+ [ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE) && uv run --all-groups mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE)
56
+
57
+ format format_diff:
58
+ [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff format $(PYTHON_FILES)
59
+ [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff check --fix $(PYTHON_FILES)
60
+
61
+ benchmark:
62
+ uv run pytest tests/benchmarks --codspeed
63
+
64
+ ######################
65
+ # HELP
66
+ ######################
67
+
68
+ help:
69
+ @echo '----'
70
+ @echo 'format - run code formatters'
71
+ @echo 'lint - run linters'
72
+ @echo 'test - run unit tests'
73
+ @echo 'tests - run unit tests'
74
+ @echo 'test TEST_FILE=<test_file> - run all tests in file'
75
+ @echo 'test_watch - run unit tests in watch mode'
@@ -1,25 +1,35 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: langchain-core
3
- Version: 0.3.79
3
+ Version: 1.0.0
4
4
  Summary: Building applications with LLMs through composability
5
+ Project-URL: homepage, https://docs.langchain.com/
6
+ Project-URL: repository, https://github.com/langchain-ai/langchain/tree/master/libs/core
7
+ Project-URL: changelog, https://github.com/langchain-ai/langchain/releases?q=%22langchain-core%3D%3D1%22
8
+ Project-URL: twitter, https://x.com/LangChainAI
9
+ Project-URL: slack, https://www.langchain.com/join-community
10
+ Project-URL: reddit, https://www.reddit.com/r/LangChain/
5
11
  License: MIT
6
- Project-URL: Source Code, https://github.com/langchain-ai/langchain/tree/master/libs/core
7
- Project-URL: Release Notes, https://github.com/langchain-ai/langchain/releases?q=tag%3A%22langchain-core%3D%3D0%22&expanded=true
8
- Project-URL: repository, https://github.com/langchain-ai/langchain
9
- Requires-Python: <4.0.0,>=3.9.0
10
- Requires-Dist: langsmith<1.0.0,>=0.3.45
11
- Requires-Dist: tenacity!=8.4.0,<10.0.0,>=8.1.0
12
+ Requires-Python: <4.0.0,>=3.10.0
12
13
  Requires-Dist: jsonpatch<2.0.0,>=1.33.0
13
- Requires-Dist: PyYAML<7.0.0,>=5.3.0
14
- Requires-Dist: typing-extensions<5.0.0,>=4.7.0
14
+ Requires-Dist: langsmith<1.0.0,>=0.3.45
15
15
  Requires-Dist: packaging<26.0.0,>=23.2.0
16
16
  Requires-Dist: pydantic<3.0.0,>=2.7.4
17
+ Requires-Dist: pyyaml<7.0.0,>=5.3.0
18
+ Requires-Dist: tenacity!=8.4.0,<10.0.0,>=8.1.0
19
+ Requires-Dist: typing-extensions<5.0.0,>=4.7.0
17
20
  Description-Content-Type: text/markdown
18
21
 
19
22
  # 🦜🍎️ LangChain Core
20
23
 
21
- [![PyPI - License](https://img.shields.io/pypi/l/langchain-core?style=flat-square)](https://opensource.org/licenses/MIT)
24
+ [![PyPI - Version](https://img.shields.io/pypi/v/langchain-core?label=%20)](https://pypi.org/project/langchain-core/#history)
25
+ [![PyPI - License](https://img.shields.io/pypi/l/langchain-core)](https://opensource.org/licenses/MIT)
22
26
  [![PyPI - Downloads](https://img.shields.io/pepy/dt/langchain-core)](https://pypistats.org/packages/langchain-core)
27
+ [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/langchainai.svg?style=social&label=Follow%20%40LangChainAI)](https://twitter.com/langchainai)
28
+
29
+ Looking for the JS/TS version? Check out [LangChain.js](https://github.com/langchain-ai/langchainjs).
30
+
31
+ To help you ship LangChain apps to production faster, check out [LangSmith](https://smith.langchain.com).
32
+ [LangSmith](https://smith.langchain.com) is a unified developer platform for building, testing, and monitoring LLM applications.
23
33
 
24
34
  ## Quick Install
25
35
 
@@ -27,16 +37,14 @@ Description-Content-Type: text/markdown
27
37
  pip install langchain-core
28
38
  ```
29
39
 
30
- ## What is it?
40
+ ## 🤔 What is this?
31
41
 
32
- LangChain Core contains the base abstractions that power the the LangChain ecosystem.
42
+ LangChain Core contains the base abstractions that power the LangChain ecosystem.
33
43
 
34
44
  These abstractions are designed to be as modular and simple as possible.
35
45
 
36
46
  The benefit of having these abstractions is that any provider can implement the required interface and then easily be used in the rest of the LangChain ecosystem.
37
47
 
38
- For full documentation see the [API reference](https://python.langchain.com/api_reference/core/index.html).
39
-
40
48
  ## ⛰️ Why build on top of LangChain Core?
41
49
 
42
50
  The LangChain ecosystem is built on top of `langchain-core`. Some of the benefits:
@@ -45,23 +53,16 @@ The LangChain ecosystem is built on top of `langchain-core`. Some of the benefit
45
53
  - **Stability**: We are committed to a stable versioning scheme, and will communicate any breaking changes with advance notice and version bumps.
46
54
  - **Battle-tested**: Core components have the largest install base in the LLM ecosystem, and are used in production by many companies.
47
55
 
48
- ## 📕 Releases & Versioning
49
-
50
- As `langchain-core` contains the base abstractions and runtime for the whole LangChain ecosystem, we will communicate any breaking changes with advance notice and version bumps. The exception for this is anything in `langchain_core.beta`. The reason for `langchain_core.beta` is that given the rate of change of the field, being able to move quickly is still a priority, and this module is our attempt to do so.
51
-
52
- Minor version increases will occur for:
56
+ ## 📖 Documentation
53
57
 
54
- - Breaking changes for any public interfaces NOT in `langchain_core.beta`
58
+ For full documentation, see the [API reference](https://reference.langchain.com/python/langchain_core/).
55
59
 
56
- Patch version increases will occur for:
60
+ ## 📕 Releases & Versioning
57
61
 
58
- - Bug fixes
59
- - New features
60
- - Any changes to private interfaces
61
- - Any changes to `langchain_core.beta`
62
+ See our [Releases](https://docs.langchain.com/oss/python/release-policy) and [Versioning](https://docs.langchain.com/oss/python/versioning) policies.
62
63
 
63
64
  ## 💁 Contributing
64
65
 
65
66
  As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
66
67
 
67
- For detailed information on how to contribute, see the [Contributing Guide](https://python.langchain.com/docs/contributing/).
68
+ For detailed information on how to contribute, see the [Contributing Guide](https://docs.langchain.com/oss/python/contributing/overview).
@@ -1,7 +1,14 @@
1
1
  # 🦜🍎️ LangChain Core
2
2
 
3
- [![PyPI - License](https://img.shields.io/pypi/l/langchain-core?style=flat-square)](https://opensource.org/licenses/MIT)
3
+ [![PyPI - Version](https://img.shields.io/pypi/v/langchain-core?label=%20)](https://pypi.org/project/langchain-core/#history)
4
+ [![PyPI - License](https://img.shields.io/pypi/l/langchain-core)](https://opensource.org/licenses/MIT)
4
5
  [![PyPI - Downloads](https://img.shields.io/pepy/dt/langchain-core)](https://pypistats.org/packages/langchain-core)
6
+ [![Twitter](https://img.shields.io/twitter/url/https/twitter.com/langchainai.svg?style=social&label=Follow%20%40LangChainAI)](https://twitter.com/langchainai)
7
+
8
+ Looking for the JS/TS version? Check out [LangChain.js](https://github.com/langchain-ai/langchainjs).
9
+
10
+ To help you ship LangChain apps to production faster, check out [LangSmith](https://smith.langchain.com).
11
+ [LangSmith](https://smith.langchain.com) is a unified developer platform for building, testing, and monitoring LLM applications.
5
12
 
6
13
  ## Quick Install
7
14
 
@@ -9,16 +16,14 @@
9
16
  pip install langchain-core
10
17
  ```
11
18
 
12
- ## What is it?
19
+ ## 🤔 What is this?
13
20
 
14
- LangChain Core contains the base abstractions that power the the LangChain ecosystem.
21
+ LangChain Core contains the base abstractions that power the LangChain ecosystem.
15
22
 
16
23
  These abstractions are designed to be as modular and simple as possible.
17
24
 
18
25
  The benefit of having these abstractions is that any provider can implement the required interface and then easily be used in the rest of the LangChain ecosystem.
19
26
 
20
- For full documentation see the [API reference](https://python.langchain.com/api_reference/core/index.html).
21
-
22
27
  ## ⛰️ Why build on top of LangChain Core?
23
28
 
24
29
  The LangChain ecosystem is built on top of `langchain-core`. Some of the benefits:
@@ -27,23 +32,16 @@ The LangChain ecosystem is built on top of `langchain-core`. Some of the benefit
27
32
  - **Stability**: We are committed to a stable versioning scheme, and will communicate any breaking changes with advance notice and version bumps.
28
33
  - **Battle-tested**: Core components have the largest install base in the LLM ecosystem, and are used in production by many companies.
29
34
 
30
- ## 📕 Releases & Versioning
35
+ ## 📖 Documentation
31
36
 
32
- As `langchain-core` contains the base abstractions and runtime for the whole LangChain ecosystem, we will communicate any breaking changes with advance notice and version bumps. The exception for this is anything in `langchain_core.beta`. The reason for `langchain_core.beta` is that given the rate of change of the field, being able to move quickly is still a priority, and this module is our attempt to do so.
37
+ For full documentation, see the [API reference](https://reference.langchain.com/python/langchain_core/).
33
38
 
34
- Minor version increases will occur for:
35
-
36
- - Breaking changes for any public interfaces NOT in `langchain_core.beta`
37
-
38
- Patch version increases will occur for:
39
+ ## 📕 Releases & Versioning
39
40
 
40
- - Bug fixes
41
- - New features
42
- - Any changes to private interfaces
43
- - Any changes to `langchain_core.beta`
41
+ See our [Releases](https://docs.langchain.com/oss/python/release-policy) and [Versioning](https://docs.langchain.com/oss/python/versioning) policies.
44
42
 
45
43
  ## 💁 Contributing
46
44
 
47
45
  As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
48
46
 
49
- For detailed information on how to contribute, see the [Contributing Guide](https://python.langchain.com/docs/contributing/).
47
+ For detailed information on how to contribute, see the [Contributing Guide](https://docs.langchain.com/oss/python/contributing/overview).
@@ -0,0 +1 @@
1
+ jinja2>=3,<4
@@ -1,4 +1,4 @@
1
- """``langchain-core`` defines the base abstractions for the LangChain ecosystem.
1
+ """`langchain-core` defines the base abstractions for the LangChain ecosystem.
2
2
 
3
3
  The interfaces for core components like chat models, LLMs, vector stores, retrievers,
4
4
  and more are defined here. The universal invocation protocol (Runnables) along with
@@ -2,11 +2,10 @@
2
2
 
3
3
  This module is only relevant for LangChain developers, not for users.
4
4
 
5
- .. warning::
6
-
7
- This module and its submodules are for internal use only. Do not use them
8
- in your own code. We may change the API at any time with no warning.
5
+ !!! warning
9
6
 
7
+ This module and its submodules are for internal use only. Do not use them in your
8
+ own code. We may change the API at any time with no warning.
10
9
  """
11
10
 
12
11
  from typing import TYPE_CHECKING
@@ -4,18 +4,18 @@ This module was loosely adapted from matplotlibs _api/deprecation.py module:
4
4
 
5
5
  https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/_api/deprecation.py
6
6
 
7
- .. warning::
7
+ !!! warning
8
8
 
9
- This module is for internal use only. Do not use it in your own code.
10
- We may change the API at any time with no warning.
9
+ This module is for internal use only. Do not use it in your own code. We may change
10
+ the API at any time with no warning.
11
11
  """
12
12
 
13
13
  import contextlib
14
14
  import functools
15
15
  import inspect
16
16
  import warnings
17
- from collections.abc import Generator
18
- from typing import Any, Callable, TypeVar, Union, cast
17
+ from collections.abc import Callable, Generator
18
+ from typing import Any, TypeVar, cast
19
19
 
20
20
  from langchain_core._api.internal import is_caller_internal
21
21
 
@@ -27,7 +27,7 @@ class LangChainBetaWarning(DeprecationWarning):
27
27
  # PUBLIC API
28
28
 
29
29
 
30
- T = TypeVar("T", bound=Union[Callable[..., Any], type])
30
+ T = TypeVar("T", bound=Callable[..., Any] | type)
31
31
 
32
32
 
33
33
  def beta(
@@ -40,40 +40,37 @@ def beta(
40
40
  """Decorator to mark a function, a class, or a property as beta.
41
41
 
42
42
  When marking a classmethod, a staticmethod, or a property, the
43
- ``@beta`` decorator should go *under* ``@classmethod`` and
44
- ``@staticmethod`` (i.e., `beta` should directly decorate the
45
- underlying callable), but *over* ``@property``.
43
+ `@beta` decorator should go *under* `@classmethod` and
44
+ `@staticmethod` (i.e., `beta` should directly decorate the
45
+ underlying callable), but *over* `@property`.
46
46
 
47
- When marking a class ``C`` intended to be used as a base class in a
48
- multiple inheritance hierarchy, ``C`` *must* define an ``__init__`` method
49
- (if ``C`` instead inherited its ``__init__`` from its own base class, then
50
- ``@beta`` would mess up ``__init__`` inheritance when installing its
51
- own (annotation-emitting) ``C.__init__``).
47
+ When marking a class `C` intended to be used as a base class in a
48
+ multiple inheritance hierarchy, `C` *must* define an `__init__` method
49
+ (if `C` instead inherited its `__init__` from its own base class, then
50
+ `@beta` would mess up `__init__` inheritance when installing its
51
+ own (annotation-emitting) `C.__init__`).
52
52
 
53
53
  Args:
54
- message : str, optional
54
+ message:
55
55
  Override the default beta message. The %(since)s,
56
56
  %(name)s, %(alternative)s, %(obj_type)s, %(addendum)s,
57
57
  and %(removal)s format specifiers will be replaced by the
58
58
  values of the respective arguments passed to this function.
59
- name : str, optional
59
+ name:
60
60
  The name of the beta object.
61
- obj_type : str, optional
61
+ obj_type:
62
62
  The object type being beta.
63
- addendum : str, optional
63
+ addendum:
64
64
  Additional text appended directly to the final message.
65
65
 
66
66
  Returns:
67
67
  A decorator which can be used to mark functions or classes as beta.
68
68
 
69
- Examples:
70
-
71
- .. code-block:: python
72
-
73
- @beta
74
- def the_function_to_annotate():
75
- pass
76
-
69
+ ```python
70
+ @beta
71
+ def the_function_to_annotate():
72
+ pass
73
+ ```
77
74
  """
78
75
 
79
76
  def beta(