langchain-core 0.3.74__tar.gz → 0.3.76__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. langchain_core-0.3.76/PKG-INFO +77 -0
  2. langchain_core-0.3.76/README.md +59 -0
  3. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/_api/beta_decorator.py +18 -41
  4. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/_api/deprecation.py +20 -7
  5. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/_api/path.py +19 -2
  6. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/_import_utils.py +7 -0
  7. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/agents.py +10 -6
  8. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/beta/runnables/context.py +2 -3
  9. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/callbacks/base.py +11 -4
  10. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/callbacks/file.py +13 -2
  11. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/callbacks/manager.py +129 -78
  12. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/callbacks/usage.py +4 -2
  13. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/chat_history.py +10 -12
  14. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/document_loaders/base.py +34 -9
  15. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/document_loaders/langsmith.py +3 -0
  16. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/documents/base.py +36 -11
  17. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/documents/compressor.py +9 -6
  18. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/documents/transformers.py +4 -2
  19. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/embeddings/fake.py +8 -5
  20. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/env.py +2 -3
  21. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/example_selectors/base.py +12 -0
  22. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/exceptions.py +7 -0
  23. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/globals.py +17 -28
  24. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/indexing/api.py +56 -44
  25. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/indexing/base.py +7 -10
  26. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/indexing/in_memory.py +23 -3
  27. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/language_models/__init__.py +3 -2
  28. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/language_models/base.py +64 -39
  29. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/language_models/chat_models.py +130 -42
  30. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/language_models/fake_chat_models.py +10 -11
  31. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/language_models/llms.py +49 -17
  32. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/load/dump.py +5 -7
  33. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/load/load.py +15 -1
  34. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/load/serializable.py +38 -43
  35. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/memory.py +7 -3
  36. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/messages/ai.py +36 -16
  37. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/messages/base.py +13 -6
  38. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/messages/content_blocks.py +23 -2
  39. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/messages/human.py +2 -6
  40. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/messages/modifier.py +1 -1
  41. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/messages/system.py +2 -6
  42. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/messages/tool.py +36 -16
  43. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/messages/utils.py +198 -87
  44. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/output_parsers/base.py +5 -2
  45. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/output_parsers/json.py +4 -4
  46. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/output_parsers/list.py +7 -22
  47. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/output_parsers/openai_functions.py +3 -0
  48. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/output_parsers/openai_tools.py +8 -1
  49. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/output_parsers/pydantic.py +4 -0
  50. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/output_parsers/string.py +5 -1
  51. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/output_parsers/transform.py +2 -2
  52. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/output_parsers/xml.py +23 -22
  53. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/outputs/chat_generation.py +18 -7
  54. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/outputs/generation.py +14 -3
  55. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/outputs/llm_result.py +8 -1
  56. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompt_values.py +10 -4
  57. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompts/base.py +4 -9
  58. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompts/chat.py +88 -61
  59. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompts/dict.py +16 -8
  60. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompts/few_shot.py +9 -11
  61. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompts/few_shot_with_templates.py +5 -1
  62. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompts/image.py +12 -5
  63. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompts/message.py +5 -6
  64. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompts/pipeline.py +13 -8
  65. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompts/prompt.py +22 -8
  66. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompts/string.py +18 -10
  67. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompts/structured.py +7 -2
  68. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/rate_limiters.py +2 -2
  69. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/retrievers.py +7 -6
  70. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/base.py +842 -567
  71. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/branch.py +15 -20
  72. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/config.py +11 -17
  73. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/configurable.py +34 -19
  74. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/fallbacks.py +24 -17
  75. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/graph.py +47 -40
  76. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/graph_ascii.py +40 -17
  77. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/graph_mermaid.py +27 -15
  78. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/graph_png.py +27 -31
  79. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/history.py +56 -59
  80. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/passthrough.py +47 -24
  81. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/retry.py +10 -6
  82. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/router.py +10 -9
  83. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/schema.py +2 -0
  84. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/utils.py +51 -89
  85. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/stores.py +13 -25
  86. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/structured_query.py +3 -7
  87. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/sys_info.py +9 -8
  88. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tools/base.py +30 -23
  89. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tools/convert.py +24 -13
  90. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tools/simple.py +35 -3
  91. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tools/structured.py +26 -3
  92. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/_streaming.py +6 -7
  93. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/base.py +2 -2
  94. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/context.py +5 -1
  95. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/core.py +109 -39
  96. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/evaluation.py +22 -26
  97. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/event_stream.py +41 -28
  98. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/langchain.py +12 -3
  99. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/langchain_v1.py +10 -2
  100. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/log_stream.py +57 -18
  101. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/root_listeners.py +4 -20
  102. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/run_collector.py +6 -16
  103. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/schemas.py +5 -1
  104. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/aiter.py +14 -6
  105. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/env.py +3 -0
  106. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/function_calling.py +49 -30
  107. langchain_core-0.3.76/langchain_core/utils/interactive_env.py +12 -0
  108. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/iter.py +11 -3
  109. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/json.py +5 -2
  110. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/json_schema.py +15 -5
  111. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/loading.py +5 -1
  112. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/mustache.py +24 -15
  113. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/pydantic.py +32 -4
  114. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/utils.py +24 -8
  115. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/vectorstores/base.py +7 -20
  116. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/vectorstores/in_memory.py +18 -12
  117. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/vectorstores/utils.py +18 -12
  118. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/version.py +1 -1
  119. {langchain_core-0.3.74 → langchain_core-0.3.76}/pyproject.toml +21 -8
  120. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/_api/test_beta_decorator.py +18 -7
  121. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/conftest.py +1 -2
  122. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/document_loaders/test_base.py +2 -0
  123. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/example_selectors/test_base.py +3 -0
  124. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/indexing/test_in_memory_indexer.py +3 -0
  125. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/indexing/test_indexing.py +8 -12
  126. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/language_models/chat_models/test_cache.py +1 -4
  127. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/language_models/chat_models/test_rate_limiting.py +1 -2
  128. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/load/test_serializable.py +94 -5
  129. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_openai_tools.py +3 -4
  130. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_pydantic_parser.py +8 -8
  131. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/__snapshots__/test_chat.ambr +24 -46
  132. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_chat.py +14 -10
  133. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_loading.py +2 -2
  134. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_prompt.py +55 -7
  135. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_structured.py +4 -2
  136. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/__snapshots__/test_graph.ambr +12 -23
  137. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr +96 -184
  138. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_concurrency.py +1 -2
  139. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_configurable.py +5 -5
  140. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_context.py +1 -1
  141. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_fallbacks.py +8 -8
  142. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_graph.py +1 -3
  143. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_history.py +6 -9
  144. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_imports.py +1 -1
  145. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_runnable.py +17 -41
  146. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_runnable_events_v2.py +1 -5
  147. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_tracing_interops.py +8 -3
  148. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/stores/test_in_memory.py +5 -0
  149. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/test_globals.py +4 -5
  150. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/test_imports.py +3 -2
  151. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/test_messages.py +36 -49
  152. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/test_tools.py +81 -24
  153. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/utils/test_env.py +1 -1
  154. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/utils/test_html.py +11 -11
  155. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/utils/test_pydantic.py +7 -23
  156. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/utils/test_strings.py +1 -1
  157. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/utils/test_usage.py +2 -2
  158. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/utils/test_utils.py +7 -12
  159. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/vectorstores/test_in_memory.py +34 -0
  160. langchain_core-0.3.74/PKG-INFO +0 -108
  161. langchain_core-0.3.74/README.md +0 -90
  162. langchain_core-0.3.74/langchain_core/utils/interactive_env.py +0 -8
  163. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/__init__.py +0 -0
  164. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/_api/__init__.py +0 -0
  165. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/_api/internal.py +0 -0
  166. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/beta/__init__.py +0 -0
  167. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/beta/runnables/__init__.py +0 -0
  168. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/caches.py +0 -0
  169. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/callbacks/__init__.py +0 -0
  170. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/callbacks/stdout.py +0 -0
  171. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/callbacks/streaming_stdout.py +0 -0
  172. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/chat_loaders.py +0 -0
  173. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/chat_sessions.py +0 -0
  174. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/document_loaders/__init__.py +0 -0
  175. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/document_loaders/blob_loaders.py +0 -0
  176. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/documents/__init__.py +0 -0
  177. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/embeddings/__init__.py +0 -0
  178. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/embeddings/embeddings.py +0 -0
  179. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/example_selectors/__init__.py +0 -0
  180. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/example_selectors/length_based.py +0 -0
  181. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/example_selectors/semantic_similarity.py +0 -0
  182. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/indexing/__init__.py +0 -0
  183. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/language_models/_utils.py +0 -0
  184. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/language_models/fake.py +0 -0
  185. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/load/__init__.py +0 -0
  186. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/load/mapping.py +0 -0
  187. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/messages/__init__.py +0 -0
  188. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/messages/chat.py +0 -0
  189. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/messages/function.py +0 -0
  190. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/output_parsers/__init__.py +0 -0
  191. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/output_parsers/format_instructions.py +0 -0
  192. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/outputs/__init__.py +0 -0
  193. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/outputs/chat_result.py +0 -0
  194. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/outputs/run_info.py +0 -0
  195. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompts/__init__.py +0 -0
  196. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/prompts/loading.py +0 -0
  197. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/py.typed +0 -0
  198. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/pydantic_v1/__init__.py +0 -0
  199. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/pydantic_v1/dataclasses.py +0 -0
  200. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/pydantic_v1/main.py +0 -0
  201. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/runnables/__init__.py +0 -0
  202. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tools/__init__.py +0 -0
  203. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tools/render.py +0 -0
  204. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tools/retriever.py +0 -0
  205. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/__init__.py +0 -0
  206. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/memory_stream.py +0 -0
  207. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/tracers/stdout.py +0 -0
  208. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/__init__.py +0 -0
  209. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/_merge.py +0 -0
  210. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/formatting.py +0 -0
  211. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/html.py +0 -0
  212. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/image.py +0 -0
  213. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/input.py +0 -0
  214. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/strings.py +0 -0
  215. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/utils/usage.py +0 -0
  216. {langchain_core-0.3.74 → langchain_core-0.3.76}/langchain_core/vectorstores/__init__.py +0 -0
  217. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/__init__.py +0 -0
  218. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/benchmarks/__init__.py +0 -0
  219. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/benchmarks/test_async_callbacks.py +0 -0
  220. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/benchmarks/test_imports.py +0 -0
  221. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/integration_tests/__init__.py +0 -0
  222. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/integration_tests/test_compile.py +0 -0
  223. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/__init__.py +0 -0
  224. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/_api/__init__.py +0 -0
  225. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/_api/test_deprecation.py +0 -0
  226. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/_api/test_imports.py +0 -0
  227. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/_api/test_path.py +0 -0
  228. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/caches/__init__.py +0 -0
  229. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/caches/test_in_memory_cache.py +0 -0
  230. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/callbacks/__init__.py +0 -0
  231. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/callbacks/test_async_callback_manager.py +0 -0
  232. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/callbacks/test_dispatch_custom_event.py +0 -0
  233. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/callbacks/test_imports.py +0 -0
  234. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/callbacks/test_sync_callback_manager.py +0 -0
  235. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/callbacks/test_usage_callback.py +0 -0
  236. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/chat_history/__init__.py +0 -0
  237. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/chat_history/test_chat_history.py +0 -0
  238. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/data/prompt_file.txt +0 -0
  239. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/data/prompts/prompt_extra_args.json +0 -0
  240. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/data/prompts/prompt_missing_args.json +0 -0
  241. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/data/prompts/simple_prompt.json +0 -0
  242. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/dependencies/__init__.py +0 -0
  243. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/dependencies/test_dependencies.py +0 -0
  244. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/document_loaders/__init__.py +0 -0
  245. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/document_loaders/test_langsmith.py +0 -0
  246. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/documents/__init__.py +0 -0
  247. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/documents/test_document.py +0 -0
  248. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/documents/test_imports.py +0 -0
  249. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/documents/test_str.py +0 -0
  250. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/embeddings/__init__.py +0 -0
  251. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/embeddings/test_deterministic_embedding.py +0 -0
  252. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/example_selectors/__init__.py +0 -0
  253. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/example_selectors/test_imports.py +0 -0
  254. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/example_selectors/test_length_based_example_selector.py +0 -0
  255. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/example_selectors/test_similarity.py +0 -0
  256. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/example-non-utf8.csv +0 -0
  257. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/example-non-utf8.txt +0 -0
  258. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/example-utf8.csv +0 -0
  259. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/example-utf8.txt +0 -0
  260. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/example_prompt.json +0 -0
  261. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/examples.json +0 -0
  262. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/examples.yaml +0 -0
  263. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/few_shot_prompt.json +0 -0
  264. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/few_shot_prompt.yaml +0 -0
  265. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/few_shot_prompt_example_prompt.json +0 -0
  266. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/few_shot_prompt_examples_in.json +0 -0
  267. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/few_shot_prompt_yaml_examples.yaml +0 -0
  268. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/jinja_injection_prompt.json +0 -0
  269. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/jinja_injection_prompt.yaml +0 -0
  270. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/prompt_with_output_parser.json +0 -0
  271. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/simple_prompt.json +0 -0
  272. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/simple_prompt.yaml +0 -0
  273. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/simple_prompt_with_template_file.json +0 -0
  274. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/examples/simple_template.txt +0 -0
  275. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/fake/__init__.py +0 -0
  276. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/fake/callbacks.py +0 -0
  277. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/fake/test_fake_chat_model.py +0 -0
  278. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/indexing/__init__.py +0 -0
  279. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/indexing/test_hashed_document.py +0 -0
  280. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/indexing/test_in_memory_record_manager.py +0 -0
  281. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/indexing/test_public_api.py +0 -0
  282. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/language_models/__init__.py +0 -0
  283. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/language_models/chat_models/__init__.py +0 -0
  284. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/language_models/chat_models/test_base.py +0 -0
  285. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/language_models/chat_models/test_benchmark.py +0 -0
  286. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/language_models/llms/__init__.py +0 -0
  287. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/language_models/llms/test_base.py +0 -0
  288. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/language_models/llms/test_cache.py +0 -0
  289. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/language_models/test_imports.py +0 -0
  290. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/load/__init__.py +0 -0
  291. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/load/test_imports.py +0 -0
  292. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/messages/__init__.py +0 -0
  293. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/messages/test_ai.py +0 -0
  294. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/messages/test_imports.py +0 -0
  295. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/messages/test_utils.py +0 -0
  296. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/__init__.py +0 -0
  297. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_base_parsers.py +0 -0
  298. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_imports.py +0 -0
  299. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_json.py +0 -0
  300. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_list_parser.py +0 -0
  301. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_openai_functions.py +0 -0
  302. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/output_parsers/test_xml_parser.py +0 -0
  303. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/outputs/__init__.py +0 -0
  304. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/outputs/test_chat_generation.py +0 -0
  305. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/outputs/test_imports.py +0 -0
  306. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompt_file.txt +0 -0
  307. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/__init__.py +0 -0
  308. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/__snapshots__/test_prompt.ambr +0 -0
  309. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/prompt_extra_args.json +0 -0
  310. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/prompt_missing_args.json +0 -0
  311. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/simple_prompt.json +0 -0
  312. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_dict.py +0 -0
  313. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_few_shot.py +0 -0
  314. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_few_shot_with_templates.py +0 -0
  315. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_image.py +0 -0
  316. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_imports.py +0 -0
  317. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_pipeline_prompt.py +0 -0
  318. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/prompts/test_utils.py +0 -0
  319. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/pydantic_utils.py +0 -0
  320. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/rate_limiters/__init__.py +0 -0
  321. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/rate_limiters/test_in_memory_rate_limiter.py +0 -0
  322. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/__init__.py +0 -0
  323. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr +0 -0
  324. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_config.py +0 -0
  325. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_runnable_events_v1.py +0 -0
  326. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/runnables/test_utils.py +0 -0
  327. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/stores/__init__.py +0 -0
  328. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/stubs.py +0 -0
  329. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/test_outputs.py +0 -0
  330. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/test_prompt_values.py +0 -0
  331. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/test_pydantic_imports.py +0 -0
  332. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/test_pydantic_serde.py +0 -0
  333. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/test_retrievers.py +0 -0
  334. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/test_setup.py +0 -0
  335. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/test_sys_info.py +0 -0
  336. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/tracers/__init__.py +0 -0
  337. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_async_base_tracer.py +0 -0
  338. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_base_tracer.py +0 -0
  339. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_imports.py +0 -0
  340. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_langchain.py +0 -0
  341. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_memory_stream.py +0 -0
  342. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_run_collector.py +0 -0
  343. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/tracers/test_schemas.py +0 -0
  344. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/utils/__init__.py +0 -0
  345. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/utils/test_aiter.py +0 -0
  346. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/utils/test_function_calling.py +0 -0
  347. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/utils/test_imports.py +0 -0
  348. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/utils/test_iter.py +0 -0
  349. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/utils/test_json_schema.py +0 -0
  350. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/utils/test_rm_titles.py +0 -0
  351. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/vectorstores/__init__.py +0 -0
  352. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/vectorstores/test_utils.py +0 -0
  353. {langchain_core-0.3.74 → langchain_core-0.3.76}/tests/unit_tests/vectorstores/test_vectorstore.py +0 -0
@@ -0,0 +1,77 @@
1
+ Metadata-Version: 2.1
2
+ Name: langchain-core
3
+ Version: 0.3.76
4
+ Summary: Building applications with LLMs through composability
5
+ License: MIT
6
+ Project-URL: Source Code, https://github.com/langchain-ai/langchain/tree/master/libs/core
7
+ Project-URL: Release Notes, https://github.com/langchain-ai/langchain/releases?q=tag%3A%22langchain-core%3D%3D0%22&expanded=true
8
+ Project-URL: repository, https://github.com/langchain-ai/langchain
9
+ Requires-Python: >=3.9
10
+ Requires-Dist: langsmith>=0.3.45
11
+ Requires-Dist: tenacity!=8.4.0,<10.0.0,>=8.1.0
12
+ Requires-Dist: jsonpatch<2.0,>=1.33
13
+ Requires-Dist: PyYAML>=5.3
14
+ Requires-Dist: typing-extensions>=4.7
15
+ Requires-Dist: packaging>=23.2
16
+ Requires-Dist: pydantic>=2.7.4
17
+ Description-Content-Type: text/markdown
18
+
19
+ # 🦜🍎️ LangChain Core
20
+
21
+ [![PyPI - License](https://img.shields.io/pypi/l/langchain-core?style=flat-square)](https://opensource.org/licenses/MIT)
22
+ [![PyPI - Downloads](https://img.shields.io/pepy/dt/langchain-core)](https://pypistats.org/packages/langchain-core)
23
+
24
+ ## Quick Install
25
+
26
+ ```bash
27
+ pip install langchain-core
28
+ ```
29
+
30
+ ## What is it?
31
+
32
+ LangChain Core contains the base abstractions that power the the LangChain ecosystem.
33
+
34
+ These abstractions are designed to be as modular and simple as possible.
35
+
36
+ The benefit of having these abstractions is that any provider can implement the required interface and then easily be used in the rest of the LangChain ecosystem.
37
+
38
+ For full documentation see the [API reference](https://python.langchain.com/api_reference/core/index.html).
39
+
40
+ ## ⛰️ Why build on top of LangChain Core?
41
+
42
+ The LangChain ecosystem is built on top of `langchain-core`. Some of the benefits:
43
+
44
+ - **Modularity**: We've designed Core around abstractions that are independent of each other, and not tied to any specific model provider.
45
+ - **Stability**: We are committed to a stable versioning scheme, and will communicate any breaking changes with advance notice and version bumps.
46
+ - **Battle-tested**: Core components have the largest install base in the LLM ecosystem, and are used in production by many companies.
47
+
48
+ ## 1️⃣ Core Interface: Runnables
49
+
50
+ The concept of a `Runnable` is central to LangChain Core – it is the interface that most LangChain Core components implement, giving them
51
+
52
+ - A common invocation interface (`invoke()`, `batch()`, `stream()`, etc.)
53
+ - Built-in utilities for retries, fallbacks, schemas and runtime configurability
54
+ - Easy deployment with [LangGraph](https://github.com/langchain-ai/langgraph)
55
+
56
+ For more check out the [`Runnable` docs](https://python.langchain.com/docs/concepts/runnables/). Examples of components that implement the interface include: Chat Models, Tools, Retrievers, and Output Parsers.
57
+
58
+ ## 📕 Releases & Versioning
59
+
60
+ As `langchain-core` contains the base abstractions and runtime for the whole LangChain ecosystem, we will communicate any breaking changes with advance notice and version bumps. The exception for this is anything in `langchain_core.beta`. The reason for `langchain_core.beta` is that given the rate of change of the field, being able to move quickly is still a priority, and this module is our attempt to do so.
61
+
62
+ Minor version increases will occur for:
63
+
64
+ - Breaking changes for any public interfaces NOT in `langchain_core.beta`
65
+
66
+ Patch version increases will occur for:
67
+
68
+ - Bug fixes
69
+ - New features
70
+ - Any changes to private interfaces
71
+ - Any changes to `langchain_core.beta`
72
+
73
+ ## 💁 Contributing
74
+
75
+ As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
76
+
77
+ For detailed information on how to contribute, see the [Contributing Guide](https://python.langchain.com/docs/contributing/).
@@ -0,0 +1,59 @@
1
+ # 🦜🍎️ LangChain Core
2
+
3
+ [![PyPI - License](https://img.shields.io/pypi/l/langchain-core?style=flat-square)](https://opensource.org/licenses/MIT)
4
+ [![PyPI - Downloads](https://img.shields.io/pepy/dt/langchain-core)](https://pypistats.org/packages/langchain-core)
5
+
6
+ ## Quick Install
7
+
8
+ ```bash
9
+ pip install langchain-core
10
+ ```
11
+
12
+ ## What is it?
13
+
14
+ LangChain Core contains the base abstractions that power the the LangChain ecosystem.
15
+
16
+ These abstractions are designed to be as modular and simple as possible.
17
+
18
+ The benefit of having these abstractions is that any provider can implement the required interface and then easily be used in the rest of the LangChain ecosystem.
19
+
20
+ For full documentation see the [API reference](https://python.langchain.com/api_reference/core/index.html).
21
+
22
+ ## ⛰️ Why build on top of LangChain Core?
23
+
24
+ The LangChain ecosystem is built on top of `langchain-core`. Some of the benefits:
25
+
26
+ - **Modularity**: We've designed Core around abstractions that are independent of each other, and not tied to any specific model provider.
27
+ - **Stability**: We are committed to a stable versioning scheme, and will communicate any breaking changes with advance notice and version bumps.
28
+ - **Battle-tested**: Core components have the largest install base in the LLM ecosystem, and are used in production by many companies.
29
+
30
+ ## 1️⃣ Core Interface: Runnables
31
+
32
+ The concept of a `Runnable` is central to LangChain Core – it is the interface that most LangChain Core components implement, giving them
33
+
34
+ - A common invocation interface (`invoke()`, `batch()`, `stream()`, etc.)
35
+ - Built-in utilities for retries, fallbacks, schemas and runtime configurability
36
+ - Easy deployment with [LangGraph](https://github.com/langchain-ai/langgraph)
37
+
38
+ For more check out the [`Runnable` docs](https://python.langchain.com/docs/concepts/runnables/). Examples of components that implement the interface include: Chat Models, Tools, Retrievers, and Output Parsers.
39
+
40
+ ## 📕 Releases & Versioning
41
+
42
+ As `langchain-core` contains the base abstractions and runtime for the whole LangChain ecosystem, we will communicate any breaking changes with advance notice and version bumps. The exception for this is anything in `langchain_core.beta`. The reason for `langchain_core.beta` is that given the rate of change of the field, being able to move quickly is still a priority, and this module is our attempt to do so.
43
+
44
+ Minor version increases will occur for:
45
+
46
+ - Breaking changes for any public interfaces NOT in `langchain_core.beta`
47
+
48
+ Patch version increases will occur for:
49
+
50
+ - Bug fixes
51
+ - New features
52
+ - Any changes to private interfaces
53
+ - Any changes to `langchain_core.beta`
54
+
55
+ ## 💁 Contributing
56
+
57
+ As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.
58
+
59
+ For detailed information on how to contribute, see the [Contributing Guide](https://python.langchain.com/docs/contributing/).
@@ -63,6 +63,9 @@ def beta(
63
63
  addendum : str, optional
64
64
  Additional text appended directly to the final message.
65
65
 
66
+ Returns:
67
+ A decorator which can be used to mark functions or classes as beta.
68
+
66
69
  Examples:
67
70
 
68
71
  .. code-block:: python
@@ -144,59 +147,33 @@ def beta(
144
147
  obj.__init__ = functools.wraps(obj.__init__)( # type: ignore[misc]
145
148
  warn_if_direct_instance
146
149
  )
147
- return cast("T", obj)
150
+ return obj
148
151
 
149
152
  elif isinstance(obj, property):
150
- # note(erick): this block doesn't seem to be used?
151
153
  if not _obj_type:
152
154
  _obj_type = "attribute"
153
155
  wrapped = None
154
156
  _name = _name or obj.fget.__qualname__
155
157
  old_doc = obj.__doc__
156
158
 
157
- class _BetaProperty(property):
158
- """A beta property."""
159
-
160
- def __init__(
161
- self,
162
- fget: Union[Callable[[Any], Any], None] = None,
163
- fset: Union[Callable[[Any, Any], None], None] = None,
164
- fdel: Union[Callable[[Any], None], None] = None,
165
- doc: Union[str, None] = None,
166
- ) -> None:
167
- super().__init__(fget, fset, fdel, doc)
168
- self.__orig_fget = fget
169
- self.__orig_fset = fset
170
- self.__orig_fdel = fdel
171
-
172
- def __get__(
173
- self, instance: Any, owner: Union[type, None] = None
174
- ) -> Any:
175
- if instance is not None or owner is not None:
176
- emit_warning()
177
- return self.fget(instance)
178
-
179
- def __set__(self, instance: Any, value: Any) -> None:
180
- if instance is not None:
181
- emit_warning()
182
- return self.fset(instance, value)
159
+ def _fget(instance: Any) -> Any:
160
+ if instance is not None:
161
+ emit_warning()
162
+ return obj.fget(instance)
183
163
 
184
- def __delete__(self, instance: Any) -> None:
185
- if instance is not None:
186
- emit_warning()
187
- return self.fdel(instance)
164
+ def _fset(instance: Any, value: Any) -> None:
165
+ if instance is not None:
166
+ emit_warning()
167
+ obj.fset(instance, value)
188
168
 
189
- def __set_name__(self, owner: Union[type, None], set_name: str) -> None:
190
- nonlocal _name
191
- if _name == "<lambda>":
192
- _name = set_name
169
+ def _fdel(instance: Any) -> None:
170
+ if instance is not None:
171
+ emit_warning()
172
+ obj.fdel(instance)
193
173
 
194
- def finalize(wrapper: Callable[..., Any], new_doc: str) -> Any: # noqa: ARG001
174
+ def finalize(_wrapper: Callable[..., Any], new_doc: str) -> Any:
195
175
  """Finalize the property."""
196
- return _BetaProperty(
197
- fget=obj.fget, fset=obj.fset, fdel=obj.fdel, doc=new_doc
198
- )
199
-
176
+ return property(fget=_fget, fset=_fset, fdel=_fdel, doc=new_doc)
200
177
  else:
201
178
  _name = _name or obj.__qualname__
202
179
  if not _obj_type:
@@ -129,11 +129,14 @@ def deprecated(
129
129
  package: str, optional
130
130
  The package of the deprecated object.
131
131
 
132
+ Returns:
133
+ A decorator to mark a function or class as deprecated.
134
+
132
135
  Examples:
133
136
 
134
137
  .. code-block:: python
135
138
 
136
- @deprecated('1.4.0')
139
+ @deprecated("1.4.0")
137
140
  def the_function_to_deprecate():
138
141
  pass
139
142
 
@@ -225,7 +228,7 @@ def deprecated(
225
228
  obj.__init__ = functools.wraps(obj.__init__)( # type: ignore[misc]
226
229
  warn_if_direct_instance
227
230
  )
228
- return cast("T", obj)
231
+ return obj
229
232
 
230
233
  elif isinstance(obj, FieldInfoV1):
231
234
  wrapped = None
@@ -358,7 +361,8 @@ def deprecated(
358
361
  # Modify the docstring to include a deprecation notice.
359
362
  if (
360
363
  _alternative
361
- and _alternative.split(".")[-1].lower() == _alternative.split(".")[-1]
364
+ and _alternative.rsplit(".", maxsplit=1)[-1].lower()
365
+ == _alternative.rsplit(".", maxsplit=1)[-1]
362
366
  ):
363
367
  _alternative = f":meth:`~{_alternative}`"
364
368
  elif _alternative:
@@ -366,8 +370,8 @@ def deprecated(
366
370
 
367
371
  if (
368
372
  _alternative_import
369
- and _alternative_import.split(".")[-1].lower()
370
- == _alternative_import.split(".")[-1]
373
+ and _alternative_import.rsplit(".", maxsplit=1)[-1].lower()
374
+ == _alternative_import.rsplit(".", maxsplit=1)[-1]
371
375
  ):
372
376
  _alternative_import = f":meth:`~{_alternative_import}`"
373
377
  elif _alternative_import:
@@ -471,7 +475,7 @@ def warn_deprecated(
471
475
  if not message:
472
476
  message = ""
473
477
  package_ = (
474
- package or name.split(".")[0].replace("_", "-")
478
+ package or name.split(".", maxsplit=1)[0].replace("_", "-")
475
479
  if "." in name
476
480
  else "LangChain"
477
481
  )
@@ -490,7 +494,7 @@ def warn_deprecated(
490
494
  message += f" and will be removed {removal}"
491
495
 
492
496
  if alternative_import:
493
- alt_package = alternative_import.split(".")[0].replace("_", "-")
497
+ alt_package = alternative_import.split(".", maxsplit=1)[0].replace("_", "-")
494
498
  if alt_package == package_:
495
499
  message += f". Use {alternative_import} instead."
496
500
  else:
@@ -544,6 +548,15 @@ def rename_parameter(
544
548
  is passed to *func*, a DeprecationWarning is emitted, and its value is
545
549
  used, even if *new* is also passed by keyword.
546
550
 
551
+ Args:
552
+ since: The version in which the parameter was renamed.
553
+ removal: The version in which the old parameter will be removed.
554
+ old: The old parameter name.
555
+ new: The new parameter name.
556
+
557
+ Returns:
558
+ A decorator indicating that a parameter was renamed.
559
+
547
560
  Example:
548
561
 
549
562
  .. code-block:: python
@@ -12,7 +12,15 @@ SEPARATOR = os.sep
12
12
  def get_relative_path(
13
13
  file: Union[Path, str], *, relative_to: Path = PACKAGE_DIR
14
14
  ) -> str:
15
- """Get the path of the file as a relative path to the package directory."""
15
+ """Get the path of the file as a relative path to the package directory.
16
+
17
+ Args:
18
+ file: The file path to convert.
19
+ relative_to: The base path to make the file path relative to.
20
+
21
+ Returns:
22
+ The relative path as a string.
23
+ """
16
24
  if isinstance(file, str):
17
25
  file = Path(file)
18
26
  return str(file.relative_to(relative_to))
@@ -24,7 +32,16 @@ def as_import_path(
24
32
  suffix: Optional[str] = None,
25
33
  relative_to: Path = PACKAGE_DIR,
26
34
  ) -> str:
27
- """Path of the file as a LangChain import exclude langchain top namespace."""
35
+ """Path of the file as a LangChain import exclude langchain top namespace.
36
+
37
+ Args:
38
+ file: The file path to convert.
39
+ suffix: An optional suffix to append to the import path.
40
+ relative_to: The base path to make the file path relative to.
41
+
42
+ Returns:
43
+ The import path as a string.
44
+ """
28
45
  if isinstance(file, str):
29
46
  file = Path(file)
30
47
  path = get_relative_path(file, relative_to=relative_to)
@@ -17,6 +17,13 @@ def import_attr(
17
17
  module_name: The name of the module to import from. If None, the attribute
18
18
  is imported from the package itself.
19
19
  package: The name of the package where the module is located.
20
+
21
+ Raises:
22
+ ImportError: If the module cannot be found.
23
+ AttributeError: If the attribute does not exist in the module or package.
24
+
25
+ Returns:
26
+ The imported attribute.
20
27
  """
21
28
  if module_name == "__module__" or module_name is None:
22
29
  try:
@@ -14,13 +14,15 @@ Agents use language models to choose a sequence of actions to take.
14
14
 
15
15
  A basic agent works in the following manner:
16
16
 
17
- 1. Given a prompt an agent uses an LLM to request an action to take (e.g., a tool to run).
17
+ 1. Given a prompt an agent uses an LLM to request an action to take
18
+ (e.g., a tool to run).
18
19
  2. The agent executes the action (e.g., runs the tool), and receives an observation.
19
- 3. The agent returns the observation to the LLM, which can then be used to generate the next action.
20
+ 3. The agent returns the observation to the LLM, which can then be used to generate
21
+ the next action.
20
22
  4. When the agent reaches a stopping condition, it returns a final return value.
21
23
 
22
24
  The schemas for the agents themselves are defined in langchain.agents.agent.
23
- """ # noqa: E501
25
+ """
24
26
 
25
27
  from __future__ import annotations
26
28
 
@@ -84,7 +86,8 @@ class AgentAction(Serializable):
84
86
  def get_lc_namespace(cls) -> list[str]:
85
87
  """Get the namespace of the langchain object.
86
88
 
87
- Default is ["langchain", "schema", "agent"].
89
+ Returns:
90
+ ``["langchain", "schema", "agent"]``
88
91
  """
89
92
  return ["langchain", "schema", "agent"]
90
93
 
@@ -153,14 +156,15 @@ class AgentFinish(Serializable):
153
156
 
154
157
  @classmethod
155
158
  def is_lc_serializable(cls) -> bool:
156
- """Return whether or not the class is serializable."""
159
+ """Return True as this class is serializable."""
157
160
  return True
158
161
 
159
162
  @classmethod
160
163
  def get_lc_namespace(cls) -> list[str]:
161
164
  """Get the namespace of the langchain object.
162
165
 
163
- Default namespace is ["langchain", "schema", "agent"].
166
+ Returns:
167
+ ``["langchain", "schema", "agent"]``
164
168
  """
165
169
  return ["langchain", "schema", "agent"]
166
170
 
@@ -253,7 +253,7 @@ class ContextSet(RunnableSerializable):
253
253
  """
254
254
  if key is not None:
255
255
  kwargs[key] = value
256
- super().__init__( # type: ignore[call-arg]
256
+ super().__init__(
257
257
  keys={
258
258
  k: _coerce_set_value(v) if v is not None else None
259
259
  for k, v in kwargs.items()
@@ -344,8 +344,7 @@ class Context:
344
344
  chain = (
345
345
  Context.setter("input")
346
346
  | {
347
- "context": RunnablePassthrough()
348
- | Context.setter("context"),
347
+ "context": RunnablePassthrough() | Context.setter("context"),
349
348
  "question": RunnablePassthrough(),
350
349
  }
351
350
  | PromptTemplate.from_template("{context} {question}")
@@ -922,7 +922,7 @@ class BaseCallbackManager(CallbackManagerMixin):
922
922
  self.inheritable_metadata = inheritable_metadata or {}
923
923
 
924
924
  def copy(self) -> Self:
925
- """Copy the callback manager."""
925
+ """Return a copy of the callback manager."""
926
926
  return self.__class__(
927
927
  handlers=self.handlers.copy(),
928
928
  inheritable_handlers=self.inheritable_handlers.copy(),
@@ -947,11 +947,18 @@ class BaseCallbackManager(CallbackManagerMixin):
947
947
 
948
948
  .. code-block:: python
949
949
 
950
- from langchain_core.callbacks.manager import CallbackManager, trace_as_chain_group
950
+ from langchain_core.callbacks.manager import (
951
+ CallbackManager,
952
+ trace_as_chain_group,
953
+ )
951
954
  from langchain_core.callbacks.stdout import StdOutCallbackHandler
952
955
 
953
- manager = CallbackManager(handlers=[StdOutCallbackHandler()], tags=["tag2"])
954
- with trace_as_chain_group("My Group Name", tags=["tag1"]) as group_manager:
956
+ manager = CallbackManager(
957
+ handlers=[StdOutCallbackHandler()], tags=["tag2"]
958
+ )
959
+ with trace_as_chain_group(
960
+ "My Group Name", tags=["tag1"]
961
+ ) as group_manager:
955
962
  merged_manager = group_manager.merge(manager)
956
963
  print(merged_manager.handlers)
957
964
  # [
@@ -49,7 +49,7 @@ class FileCallbackHandler(BaseCallbackHandler):
49
49
  mode: The file open mode. Defaults to ``'a'`` (append).
50
50
  color: Default color for text output. Defaults to ``None``.
51
51
 
52
- Note:
52
+ .. note::
53
53
  When not used as a context manager, a deprecation warning will be issued
54
54
  on first use. The file will be opened immediately in ``__init__`` and closed
55
55
  in ``__del__`` or when ``close()`` is called explicitly.
@@ -65,6 +65,7 @@ class FileCallbackHandler(BaseCallbackHandler):
65
65
  filename: Path to the output file.
66
66
  mode: File open mode (e.g., ``'w'``, ``'a'``, ``'x'``). Defaults to ``'a'``.
67
67
  color: Default text color for output. Defaults to ``None``.
68
+
68
69
  """
69
70
  self.filename = filename
70
71
  self.mode = mode
@@ -82,9 +83,10 @@ class FileCallbackHandler(BaseCallbackHandler):
82
83
  Returns:
83
84
  The FileCallbackHandler instance.
84
85
 
85
- Note:
86
+ .. note::
86
87
  The file is already opened in ``__init__``, so this just marks that
87
88
  the handler is being used as a context manager.
89
+
88
90
  """
89
91
  self._file_opened_in_context = True
90
92
  return self
@@ -101,6 +103,7 @@ class FileCallbackHandler(BaseCallbackHandler):
101
103
  exc_type: Exception type if an exception occurred.
102
104
  exc_val: Exception value if an exception occurred.
103
105
  exc_tb: Exception traceback if an exception occurred.
106
+
104
107
  """
105
108
  self.close()
106
109
 
@@ -113,6 +116,7 @@ class FileCallbackHandler(BaseCallbackHandler):
113
116
 
114
117
  This method is safe to call multiple times and will only close
115
118
  the file if it's currently open.
119
+
116
120
  """
117
121
  if hasattr(self, "file") and self.file and not self.file.closed:
118
122
  self.file.close()
@@ -133,6 +137,7 @@ class FileCallbackHandler(BaseCallbackHandler):
133
137
 
134
138
  Raises:
135
139
  RuntimeError: If the file is closed or not available.
140
+
136
141
  """
137
142
  global _GLOBAL_DEPRECATION_WARNED # noqa: PLW0603
138
143
  if not self._file_opened_in_context and not _GLOBAL_DEPRECATION_WARNED:
@@ -163,6 +168,7 @@ class FileCallbackHandler(BaseCallbackHandler):
163
168
  serialized: The serialized chain information.
164
169
  inputs: The inputs to the chain.
165
170
  **kwargs: Additional keyword arguments that may contain ``'name'``.
171
+
166
172
  """
167
173
  name = (
168
174
  kwargs.get("name")
@@ -178,6 +184,7 @@ class FileCallbackHandler(BaseCallbackHandler):
178
184
  Args:
179
185
  outputs: The outputs of the chain.
180
186
  **kwargs: Additional keyword arguments.
187
+
181
188
  """
182
189
  self._write("\n> Finished chain.", end="\n")
183
190
 
@@ -192,6 +199,7 @@ class FileCallbackHandler(BaseCallbackHandler):
192
199
  color: Color override for this specific output. If ``None``, uses
193
200
  ``self.color``.
194
201
  **kwargs: Additional keyword arguments.
202
+
195
203
  """
196
204
  self._write(action.log, color=color or self.color)
197
205
 
@@ -213,6 +221,7 @@ class FileCallbackHandler(BaseCallbackHandler):
213
221
  observation_prefix: Optional prefix to write before the output.
214
222
  llm_prefix: Optional prefix to write after the output.
215
223
  **kwargs: Additional keyword arguments.
224
+
216
225
  """
217
226
  if observation_prefix is not None:
218
227
  self._write(f"\n{observation_prefix}")
@@ -232,6 +241,7 @@ class FileCallbackHandler(BaseCallbackHandler):
232
241
  ``self.color``.
233
242
  end: String appended after the text. Defaults to ``""``.
234
243
  **kwargs: Additional keyword arguments.
244
+
235
245
  """
236
246
  self._write(text, color=color or self.color, end=end)
237
247
 
@@ -246,5 +256,6 @@ class FileCallbackHandler(BaseCallbackHandler):
246
256
  color: Color override for this specific output. If ``None``, uses
247
257
  ``self.color``.
248
258
  **kwargs: Additional keyword arguments.
259
+
249
260
  """
250
261
  self._write(finish.log, color=color or self.color, end="\n")