langchain-core 1.1.0__tar.gz → 1.2.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 (368) hide show
  1. {langchain_core-1.1.0 → langchain_core-1.2.0}/PKG-INFO +2 -1
  2. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/callbacks/manager.py +14 -14
  3. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/callbacks/usage.py +1 -1
  4. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/indexing/api.py +2 -0
  5. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/language_models/__init__.py +7 -5
  6. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/language_models/_utils.py +1 -0
  7. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/language_models/chat_models.py +59 -58
  8. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/language_models/llms.py +5 -3
  9. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/load/load.py +14 -1
  10. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/ai.py +12 -4
  11. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/base.py +6 -6
  12. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/block_translators/anthropic.py +11 -0
  13. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/block_translators/google_genai.py +25 -10
  14. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/content.py +1 -1
  15. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/tool.py +28 -27
  16. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/utils.py +45 -18
  17. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/output_parsers/pydantic.py +1 -1
  18. langchain_core-1.2.0/langchain_core/output_parsers/string.py +63 -0
  19. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/prompts/chat.py +22 -17
  20. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/prompts/string.py +2 -59
  21. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/prompts/structured.py +7 -1
  22. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/base.py +174 -160
  23. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/branch.py +1 -1
  24. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/config.py +25 -20
  25. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/fallbacks.py +1 -2
  26. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/passthrough.py +2 -2
  27. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tools/base.py +23 -4
  28. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tools/convert.py +16 -0
  29. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tools/retriever.py +29 -58
  30. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/event_stream.py +9 -4
  31. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/aiter.py +3 -1
  32. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/function_calling.py +7 -2
  33. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/json_schema.py +29 -21
  34. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/pydantic.py +7 -7
  35. langchain_core-1.2.0/langchain_core/utils/uuid.py +54 -0
  36. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/vectorstores/base.py +26 -18
  37. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/version.py +1 -1
  38. {langchain_core-1.1.0 → langchain_core-1.2.0}/pyproject.toml +2 -1
  39. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/benchmarks/test_async_callbacks.py +1 -1
  40. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/benchmarks/test_imports.py +1 -1
  41. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/messages/block_translators/test_anthropic.py +22 -0
  42. langchain_core-1.2.0/tests/unit_tests/messages/block_translators/test_google_genai.py +218 -0
  43. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/messages/test_utils.py +21 -8
  44. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/__snapshots__/test_chat.ambr +60 -52
  45. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/test_chat.py +0 -65
  46. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/test_structured.py +8 -2
  47. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/__snapshots__/test_graph.ambr +28 -24
  48. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr +224 -192
  49. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/test_tracing_interops.py +11 -7
  50. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/test_tools.py +225 -0
  51. langchain_core-1.2.0/tests/unit_tests/utils/test_uuid_utils.py +37 -0
  52. langchain_core-1.2.0/uv.lock +3556 -0
  53. langchain_core-1.1.0/langchain_core/output_parsers/string.py +0 -37
  54. langchain_core-1.1.0/uv.lock +0 -3395
  55. {langchain_core-1.1.0 → langchain_core-1.2.0}/.gitignore +0 -0
  56. {langchain_core-1.1.0 → langchain_core-1.2.0}/Makefile +0 -0
  57. {langchain_core-1.1.0 → langchain_core-1.2.0}/README.md +0 -0
  58. {langchain_core-1.1.0 → langchain_core-1.2.0}/extended_testing_deps.txt +0 -0
  59. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/__init__.py +0 -0
  60. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/_api/__init__.py +0 -0
  61. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/_api/beta_decorator.py +0 -0
  62. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/_api/deprecation.py +0 -0
  63. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/_api/internal.py +0 -0
  64. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/_api/path.py +0 -0
  65. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/_import_utils.py +0 -0
  66. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/agents.py +0 -0
  67. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/caches.py +0 -0
  68. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/callbacks/__init__.py +0 -0
  69. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/callbacks/base.py +0 -0
  70. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/callbacks/file.py +0 -0
  71. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/callbacks/stdout.py +0 -0
  72. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/callbacks/streaming_stdout.py +0 -0
  73. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/chat_history.py +0 -0
  74. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/chat_loaders.py +0 -0
  75. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/chat_sessions.py +0 -0
  76. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/document_loaders/__init__.py +0 -0
  77. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/document_loaders/base.py +0 -0
  78. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/document_loaders/blob_loaders.py +0 -0
  79. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/document_loaders/langsmith.py +0 -0
  80. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/documents/__init__.py +0 -0
  81. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/documents/base.py +0 -0
  82. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/documents/compressor.py +0 -0
  83. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/documents/transformers.py +0 -0
  84. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/embeddings/__init__.py +0 -0
  85. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/embeddings/embeddings.py +0 -0
  86. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/embeddings/fake.py +0 -0
  87. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/env.py +0 -0
  88. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/example_selectors/__init__.py +0 -0
  89. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/example_selectors/base.py +0 -0
  90. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/example_selectors/length_based.py +0 -0
  91. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/example_selectors/semantic_similarity.py +0 -0
  92. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/exceptions.py +0 -0
  93. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/globals.py +0 -0
  94. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/indexing/__init__.py +0 -0
  95. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/indexing/base.py +0 -0
  96. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/indexing/in_memory.py +0 -0
  97. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/language_models/base.py +0 -0
  98. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/language_models/fake.py +0 -0
  99. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/language_models/fake_chat_models.py +0 -0
  100. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/language_models/model_profile.py +0 -0
  101. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/load/__init__.py +0 -0
  102. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/load/dump.py +0 -0
  103. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/load/mapping.py +0 -0
  104. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/load/serializable.py +0 -0
  105. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/__init__.py +0 -0
  106. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/block_translators/__init__.py +0 -0
  107. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/block_translators/bedrock.py +0 -0
  108. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/block_translators/bedrock_converse.py +0 -0
  109. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/block_translators/google_vertexai.py +0 -0
  110. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/block_translators/groq.py +0 -0
  111. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/block_translators/langchain_v0.py +0 -0
  112. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/block_translators/openai.py +0 -0
  113. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/chat.py +0 -0
  114. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/function.py +0 -0
  115. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/human.py +0 -0
  116. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/modifier.py +0 -0
  117. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/messages/system.py +0 -0
  118. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/output_parsers/__init__.py +0 -0
  119. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/output_parsers/base.py +0 -0
  120. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/output_parsers/format_instructions.py +0 -0
  121. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/output_parsers/json.py +0 -0
  122. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/output_parsers/list.py +0 -0
  123. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/output_parsers/openai_functions.py +0 -0
  124. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/output_parsers/openai_tools.py +0 -0
  125. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/output_parsers/transform.py +0 -0
  126. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/output_parsers/xml.py +0 -0
  127. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/outputs/__init__.py +0 -0
  128. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/outputs/chat_generation.py +0 -0
  129. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/outputs/chat_result.py +0 -0
  130. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/outputs/generation.py +0 -0
  131. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/outputs/llm_result.py +0 -0
  132. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/outputs/run_info.py +0 -0
  133. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/prompt_values.py +0 -0
  134. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/prompts/__init__.py +0 -0
  135. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/prompts/base.py +0 -0
  136. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/prompts/dict.py +0 -0
  137. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/prompts/few_shot.py +0 -0
  138. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/prompts/few_shot_with_templates.py +0 -0
  139. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/prompts/image.py +0 -0
  140. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/prompts/loading.py +0 -0
  141. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/prompts/message.py +0 -0
  142. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/prompts/prompt.py +0 -0
  143. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/py.typed +0 -0
  144. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/rate_limiters.py +0 -0
  145. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/retrievers.py +0 -0
  146. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/__init__.py +0 -0
  147. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/configurable.py +0 -0
  148. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/graph.py +0 -0
  149. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/graph_ascii.py +0 -0
  150. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/graph_mermaid.py +0 -0
  151. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/graph_png.py +0 -0
  152. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/history.py +0 -0
  153. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/retry.py +0 -0
  154. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/router.py +0 -0
  155. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/schema.py +0 -0
  156. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/runnables/utils.py +0 -0
  157. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/stores.py +0 -0
  158. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/structured_query.py +0 -0
  159. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/sys_info.py +0 -0
  160. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tools/__init__.py +0 -0
  161. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tools/render.py +0 -0
  162. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tools/simple.py +0 -0
  163. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tools/structured.py +0 -0
  164. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/__init__.py +0 -0
  165. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/_streaming.py +0 -0
  166. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/base.py +0 -0
  167. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/context.py +0 -0
  168. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/core.py +0 -0
  169. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/evaluation.py +0 -0
  170. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/langchain.py +0 -0
  171. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/log_stream.py +0 -0
  172. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/memory_stream.py +0 -0
  173. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/root_listeners.py +0 -0
  174. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/run_collector.py +0 -0
  175. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/schemas.py +0 -0
  176. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/tracers/stdout.py +0 -0
  177. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/__init__.py +0 -0
  178. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/_merge.py +0 -0
  179. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/env.py +0 -0
  180. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/formatting.py +0 -0
  181. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/html.py +0 -0
  182. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/image.py +0 -0
  183. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/input.py +0 -0
  184. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/interactive_env.py +0 -0
  185. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/iter.py +0 -0
  186. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/json.py +0 -0
  187. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/mustache.py +0 -0
  188. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/strings.py +0 -0
  189. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/usage.py +0 -0
  190. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/utils/utils.py +0 -0
  191. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/vectorstores/__init__.py +0 -0
  192. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/vectorstores/in_memory.py +0 -0
  193. {langchain_core-1.1.0 → langchain_core-1.2.0}/langchain_core/vectorstores/utils.py +0 -0
  194. {langchain_core-1.1.0 → langchain_core-1.2.0}/scripts/check_imports.py +0 -0
  195. {langchain_core-1.1.0 → langchain_core-1.2.0}/scripts/lint_imports.sh +0 -0
  196. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/__init__.py +0 -0
  197. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/benchmarks/__init__.py +0 -0
  198. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/integration_tests/__init__.py +0 -0
  199. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/integration_tests/test_compile.py +0 -0
  200. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/__init__.py +0 -0
  201. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/_api/__init__.py +0 -0
  202. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/_api/test_beta_decorator.py +0 -0
  203. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/_api/test_deprecation.py +0 -0
  204. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/_api/test_imports.py +0 -0
  205. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/_api/test_path.py +0 -0
  206. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/caches/__init__.py +0 -0
  207. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/caches/test_in_memory_cache.py +0 -0
  208. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/callbacks/__init__.py +0 -0
  209. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/callbacks/test_async_callback_manager.py +0 -0
  210. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/callbacks/test_dispatch_custom_event.py +0 -0
  211. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/callbacks/test_imports.py +0 -0
  212. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/callbacks/test_sync_callback_manager.py +0 -0
  213. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/callbacks/test_usage_callback.py +0 -0
  214. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/chat_history/__init__.py +0 -0
  215. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/chat_history/test_chat_history.py +0 -0
  216. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/conftest.py +0 -0
  217. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/data/prompt_file.txt +0 -0
  218. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/data/prompts/prompt_extra_args.json +0 -0
  219. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/data/prompts/prompt_missing_args.json +0 -0
  220. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/data/prompts/simple_prompt.json +0 -0
  221. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/dependencies/__init__.py +0 -0
  222. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/dependencies/test_dependencies.py +0 -0
  223. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/document_loaders/__init__.py +0 -0
  224. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/document_loaders/test_base.py +0 -0
  225. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/document_loaders/test_langsmith.py +0 -0
  226. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/documents/__init__.py +0 -0
  227. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/documents/test_document.py +0 -0
  228. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/documents/test_imports.py +0 -0
  229. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/documents/test_str.py +0 -0
  230. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/embeddings/__init__.py +0 -0
  231. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/embeddings/test_deterministic_embedding.py +0 -0
  232. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/example_selectors/__init__.py +0 -0
  233. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/example_selectors/test_base.py +0 -0
  234. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/example_selectors/test_imports.py +0 -0
  235. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/example_selectors/test_length_based_example_selector.py +0 -0
  236. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/example_selectors/test_similarity.py +0 -0
  237. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/example-non-utf8.csv +0 -0
  238. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/example-non-utf8.txt +0 -0
  239. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/example-utf8.csv +0 -0
  240. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/example-utf8.txt +0 -0
  241. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/example_prompt.json +0 -0
  242. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/examples.json +0 -0
  243. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/examples.yaml +0 -0
  244. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/few_shot_prompt.json +0 -0
  245. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/few_shot_prompt.yaml +0 -0
  246. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/few_shot_prompt_example_prompt.json +0 -0
  247. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/few_shot_prompt_examples_in.json +0 -0
  248. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/few_shot_prompt_yaml_examples.yaml +0 -0
  249. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/jinja_injection_prompt.json +0 -0
  250. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/jinja_injection_prompt.yaml +0 -0
  251. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/prompt_with_output_parser.json +0 -0
  252. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/simple_prompt.json +0 -0
  253. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/simple_prompt.yaml +0 -0
  254. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/simple_prompt_with_template_file.json +0 -0
  255. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/examples/simple_template.txt +0 -0
  256. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/fake/__init__.py +0 -0
  257. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/fake/callbacks.py +0 -0
  258. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/fake/test_fake_chat_model.py +0 -0
  259. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/indexing/__init__.py +0 -0
  260. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/indexing/test_hashed_document.py +0 -0
  261. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/indexing/test_in_memory_indexer.py +0 -0
  262. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/indexing/test_in_memory_record_manager.py +0 -0
  263. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/indexing/test_indexing.py +0 -0
  264. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/indexing/test_public_api.py +0 -0
  265. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/language_models/__init__.py +0 -0
  266. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/language_models/chat_models/__init__.py +0 -0
  267. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/language_models/chat_models/test_base.py +0 -0
  268. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/language_models/chat_models/test_benchmark.py +0 -0
  269. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/language_models/chat_models/test_cache.py +0 -0
  270. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/language_models/chat_models/test_rate_limiting.py +0 -0
  271. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/language_models/llms/__init__.py +0 -0
  272. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/language_models/llms/test_base.py +0 -0
  273. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/language_models/llms/test_cache.py +0 -0
  274. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/language_models/test_imports.py +0 -0
  275. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/load/__init__.py +0 -0
  276. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/load/test_imports.py +0 -0
  277. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/load/test_serializable.py +0 -0
  278. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/messages/__init__.py +0 -0
  279. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/messages/block_translators/__init__.py +0 -0
  280. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/messages/block_translators/test_bedrock.py +0 -0
  281. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/messages/block_translators/test_bedrock_converse.py +0 -0
  282. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/messages/block_translators/test_groq.py +0 -0
  283. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/messages/block_translators/test_langchain_v0.py +0 -0
  284. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/messages/block_translators/test_openai.py +0 -0
  285. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/messages/block_translators/test_registration.py +0 -0
  286. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/messages/test_ai.py +0 -0
  287. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/messages/test_imports.py +0 -0
  288. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/output_parsers/__init__.py +0 -0
  289. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/output_parsers/test_base_parsers.py +0 -0
  290. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/output_parsers/test_imports.py +0 -0
  291. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/output_parsers/test_json.py +0 -0
  292. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/output_parsers/test_list_parser.py +0 -0
  293. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/output_parsers/test_openai_functions.py +0 -0
  294. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/output_parsers/test_openai_tools.py +0 -0
  295. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/output_parsers/test_pydantic_parser.py +0 -0
  296. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/output_parsers/test_xml_parser.py +0 -0
  297. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/outputs/__init__.py +0 -0
  298. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/outputs/test_chat_generation.py +0 -0
  299. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/outputs/test_imports.py +0 -0
  300. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompt_file.txt +0 -0
  301. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/__init__.py +0 -0
  302. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/__snapshots__/test_prompt.ambr +0 -0
  303. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/prompt_extra_args.json +0 -0
  304. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/prompt_missing_args.json +0 -0
  305. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/simple_prompt.json +0 -0
  306. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/test_dict.py +0 -0
  307. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/test_few_shot.py +0 -0
  308. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/test_few_shot_with_templates.py +0 -0
  309. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/test_image.py +0 -0
  310. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/test_imports.py +0 -0
  311. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/test_loading.py +0 -0
  312. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/test_prompt.py +0 -0
  313. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/test_string.py +0 -0
  314. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/prompts/test_utils.py +0 -0
  315. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/pydantic_utils.py +0 -0
  316. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/rate_limiters/__init__.py +0 -0
  317. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/rate_limiters/test_in_memory_rate_limiter.py +0 -0
  318. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/__init__.py +0 -0
  319. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr +0 -0
  320. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/test_concurrency.py +0 -0
  321. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/test_config.py +0 -0
  322. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/test_configurable.py +0 -0
  323. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/test_fallbacks.py +0 -0
  324. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/test_graph.py +0 -0
  325. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/test_history.py +0 -0
  326. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/test_imports.py +0 -0
  327. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/test_runnable.py +0 -0
  328. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/test_runnable_events_v1.py +0 -0
  329. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/test_runnable_events_v2.py +0 -0
  330. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/runnables/test_utils.py +0 -0
  331. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/stores/__init__.py +0 -0
  332. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/stores/test_in_memory.py +0 -0
  333. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/stubs.py +0 -0
  334. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/test_globals.py +0 -0
  335. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/test_imports.py +0 -0
  336. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/test_messages.py +0 -0
  337. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/test_outputs.py +0 -0
  338. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/test_prompt_values.py +0 -0
  339. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/test_pydantic_imports.py +0 -0
  340. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/test_pydantic_serde.py +0 -0
  341. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/test_retrievers.py +0 -0
  342. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/test_setup.py +0 -0
  343. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/test_sys_info.py +0 -0
  344. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/tracers/__init__.py +0 -0
  345. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/tracers/test_async_base_tracer.py +0 -0
  346. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/tracers/test_base_tracer.py +0 -0
  347. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/tracers/test_imports.py +0 -0
  348. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/tracers/test_langchain.py +0 -0
  349. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/tracers/test_memory_stream.py +0 -0
  350. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/tracers/test_run_collector.py +0 -0
  351. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/tracers/test_schemas.py +0 -0
  352. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/utils/__init__.py +0 -0
  353. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/utils/test_aiter.py +0 -0
  354. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/utils/test_env.py +0 -0
  355. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/utils/test_function_calling.py +0 -0
  356. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/utils/test_html.py +0 -0
  357. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/utils/test_imports.py +0 -0
  358. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/utils/test_iter.py +0 -0
  359. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/utils/test_json_schema.py +0 -0
  360. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/utils/test_pydantic.py +0 -0
  361. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/utils/test_rm_titles.py +0 -0
  362. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/utils/test_strings.py +0 -0
  363. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/utils/test_usage.py +0 -0
  364. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/utils/test_utils.py +0 -0
  365. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/vectorstores/__init__.py +0 -0
  366. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/vectorstores/test_in_memory.py +0 -0
  367. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/vectorstores/test_utils.py +0 -0
  368. {langchain_core-1.1.0 → langchain_core-1.2.0}/tests/unit_tests/vectorstores/test_vectorstore.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langchain-core
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: Building applications with LLMs through composability
5
5
  Project-URL: Homepage, https://docs.langchain.com/
6
6
  Project-URL: Documentation, https://reference.langchain.com/python/langchain_core/
@@ -18,6 +18,7 @@ Requires-Dist: pydantic<3.0.0,>=2.7.4
18
18
  Requires-Dist: pyyaml<7.0.0,>=5.3.0
19
19
  Requires-Dist: tenacity!=8.4.0,<10.0.0,>=8.1.0
20
20
  Requires-Dist: typing-extensions<5.0.0,>=4.7.0
21
+ Requires-Dist: uuid-utils<1.0,>=0.12.0
21
22
  Description-Content-Type: text/markdown
22
23
 
23
24
  # 🦜🍎️ LangChain Core
@@ -6,7 +6,6 @@ import asyncio
6
6
  import atexit
7
7
  import functools
8
8
  import logging
9
- import uuid
10
9
  from abc import ABC, abstractmethod
11
10
  from collections.abc import Callable
12
11
  from concurrent.futures import ThreadPoolExecutor
@@ -41,6 +40,7 @@ from langchain_core.tracers.context import (
41
40
  from langchain_core.tracers.langchain import LangChainTracer
42
41
  from langchain_core.tracers.stdout import ConsoleCallbackHandler
43
42
  from langchain_core.utils.env import env_var_is_set
43
+ from langchain_core.utils.uuid import uuid7
44
44
 
45
45
  if TYPE_CHECKING:
46
46
  from collections.abc import AsyncGenerator, Coroutine, Generator, Sequence
@@ -504,7 +504,7 @@ class BaseRunManager(RunManagerMixin):
504
504
 
505
505
  """
506
506
  return cls(
507
- run_id=uuid.uuid4(),
507
+ run_id=uuid7(),
508
508
  handlers=[],
509
509
  inheritable_handlers=[],
510
510
  tags=[],
@@ -1330,7 +1330,7 @@ class CallbackManager(BaseCallbackManager):
1330
1330
  managers = []
1331
1331
  for i, prompt in enumerate(prompts):
1332
1332
  # Can't have duplicate runs with the same run ID (if provided)
1333
- run_id_ = run_id if i == 0 and run_id is not None else uuid.uuid4()
1333
+ run_id_ = run_id if i == 0 and run_id is not None else uuid7()
1334
1334
  handle_event(
1335
1335
  self.handlers,
1336
1336
  "on_llm_start",
@@ -1384,7 +1384,7 @@ class CallbackManager(BaseCallbackManager):
1384
1384
  run_id_ = run_id
1385
1385
  run_id = None
1386
1386
  else:
1387
- run_id_ = uuid.uuid4()
1387
+ run_id_ = uuid7()
1388
1388
  handle_event(
1389
1389
  self.handlers,
1390
1390
  "on_chat_model_start",
@@ -1433,7 +1433,7 @@ class CallbackManager(BaseCallbackManager):
1433
1433
 
1434
1434
  """
1435
1435
  if run_id is None:
1436
- run_id = uuid.uuid4()
1436
+ run_id = uuid7()
1437
1437
  handle_event(
1438
1438
  self.handlers,
1439
1439
  "on_chain_start",
@@ -1488,7 +1488,7 @@ class CallbackManager(BaseCallbackManager):
1488
1488
 
1489
1489
  """
1490
1490
  if run_id is None:
1491
- run_id = uuid.uuid4()
1491
+ run_id = uuid7()
1492
1492
 
1493
1493
  handle_event(
1494
1494
  self.handlers,
@@ -1537,7 +1537,7 @@ class CallbackManager(BaseCallbackManager):
1537
1537
  The callback manager for the retriever run.
1538
1538
  """
1539
1539
  if run_id is None:
1540
- run_id = uuid.uuid4()
1540
+ run_id = uuid7()
1541
1541
 
1542
1542
  handle_event(
1543
1543
  self.handlers,
@@ -1594,7 +1594,7 @@ class CallbackManager(BaseCallbackManager):
1594
1594
  )
1595
1595
  raise ValueError(msg)
1596
1596
  if run_id is None:
1597
- run_id = uuid.uuid4()
1597
+ run_id = uuid7()
1598
1598
 
1599
1599
  handle_event(
1600
1600
  self.handlers,
@@ -1816,7 +1816,7 @@ class AsyncCallbackManager(BaseCallbackManager):
1816
1816
  run_id_ = run_id
1817
1817
  run_id = None
1818
1818
  else:
1819
- run_id_ = uuid.uuid4()
1819
+ run_id_ = uuid7()
1820
1820
 
1821
1821
  if inline_handlers:
1822
1822
  inline_tasks.append(
@@ -1900,7 +1900,7 @@ class AsyncCallbackManager(BaseCallbackManager):
1900
1900
  run_id_ = run_id
1901
1901
  run_id = None
1902
1902
  else:
1903
- run_id_ = uuid.uuid4()
1903
+ run_id_ = uuid7()
1904
1904
 
1905
1905
  for handler in self.handlers:
1906
1906
  task = ahandle_event(
@@ -1962,7 +1962,7 @@ class AsyncCallbackManager(BaseCallbackManager):
1962
1962
  The async callback manager for the chain run.
1963
1963
  """
1964
1964
  if run_id is None:
1965
- run_id = uuid.uuid4()
1965
+ run_id = uuid7()
1966
1966
 
1967
1967
  await ahandle_event(
1968
1968
  self.handlers,
@@ -2010,7 +2010,7 @@ class AsyncCallbackManager(BaseCallbackManager):
2010
2010
  The async callback manager for the tool run.
2011
2011
  """
2012
2012
  if run_id is None:
2013
- run_id = uuid.uuid4()
2013
+ run_id = uuid7()
2014
2014
 
2015
2015
  await ahandle_event(
2016
2016
  self.handlers,
@@ -2060,7 +2060,7 @@ class AsyncCallbackManager(BaseCallbackManager):
2060
2060
  if not self.handlers:
2061
2061
  return
2062
2062
  if run_id is None:
2063
- run_id = uuid.uuid4()
2063
+ run_id = uuid7()
2064
2064
 
2065
2065
  if kwargs:
2066
2066
  msg = (
@@ -2102,7 +2102,7 @@ class AsyncCallbackManager(BaseCallbackManager):
2102
2102
  The async callback manager for the retriever run.
2103
2103
  """
2104
2104
  if run_id is None:
2105
- run_id = uuid.uuid4()
2105
+ run_id = uuid7()
2106
2106
 
2107
2107
  await ahandle_event(
2108
2108
  self.handlers,
@@ -95,7 +95,7 @@ def get_usage_metadata_callback(
95
95
  """Get usage metadata callback.
96
96
 
97
97
  Get context manager for tracking usage metadata across chat model calls using
98
- `AIMessage.usage_metadata`.
98
+ [`AIMessage.usage_metadata`][langchain.messages.AIMessage.usage_metadata].
99
99
 
100
100
  Args:
101
101
  name: The name of the context variable.
@@ -302,6 +302,7 @@ def index(
302
302
  are not able to specify the uid of the document.
303
303
 
304
304
  !!! warning "Behavior changed in `langchain-core` 0.3.25"
305
+
305
306
  Added `scoped_full` cleanup mode.
306
307
 
307
308
  !!! warning
@@ -640,6 +641,7 @@ async def aindex(
640
641
  are not able to specify the uid of the document.
641
642
 
642
643
  !!! warning "Behavior changed in `langchain-core` 0.3.25"
644
+
643
645
  Added `scoped_full` cleanup mode.
644
646
 
645
647
  !!! warning
@@ -1,7 +1,7 @@
1
- """Language models.
1
+ """Core language model abstractions.
2
2
 
3
3
  LangChain has two main classes to work with language models: chat models and
4
- "old-fashioned" LLMs.
4
+ "old-fashioned" LLMs (string-in, string-out).
5
5
 
6
6
  **Chat models**
7
7
 
@@ -11,14 +11,16 @@ as outputs (as opposed to using plain text).
11
11
  Chat models support the assignment of distinct roles to conversation messages, helping
12
12
  to distinguish messages from the AI, users, and instructions such as system messages.
13
13
 
14
- The key abstraction for chat models is `BaseChatModel`. Implementations should inherit
15
- from this class.
14
+ The key abstraction for chat models is
15
+ [`BaseChatModel`][langchain_core.language_models.BaseChatModel]. Implementations should
16
+ inherit from this class.
16
17
 
17
18
  See existing [chat model integrations](https://docs.langchain.com/oss/python/integrations/chat).
18
19
 
19
- **LLMs**
20
+ **LLMs (legacy)**
20
21
 
21
22
  Language models that takes a string as input and returns a string.
23
+
22
24
  These are traditionally older models (newer models generally are chat models).
23
25
 
24
26
  Although the underlying models are string in, string out, the LangChain wrappers also
@@ -140,6 +140,7 @@ def _normalize_messages(
140
140
  - LangChain v0 standard content blocks for backward compatibility
141
141
 
142
142
  !!! warning "Behavior changed in `langchain-core` 1.0.0"
143
+
143
144
  In previous versions, this function returned messages in LangChain v0 format.
144
145
  Now, it returns messages in LangChain v1 format, which upgraded chat models now
145
146
  expect to receive when passing back in message history. For backward
@@ -333,7 +333,7 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
333
333
  [`langchain-openai`](https://pypi.org/project/langchain-openai)) can also use this
334
334
  field to roll out new content formats in a backward-compatible way.
335
335
 
336
- !!! version-added "Added in `langchain-core` 1.0"
336
+ !!! version-added "Added in `langchain-core` 1.0.0"
337
337
 
338
338
  """
339
339
 
@@ -349,7 +349,7 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
349
349
  Example profile data includes context window sizes, supported modalities, or support
350
350
  for tool calling, structured output, and other features.
351
351
 
352
- !!! version-added "Added in `langchain-core` 1.1"
352
+ !!! version-added "Added in `langchain-core` 1.1.0"
353
353
  """
354
354
 
355
355
  model_config = ConfigDict(
@@ -1578,88 +1578,89 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
1578
1578
  depends on the `schema` as described above.
1579
1579
  - `'parsing_error'`: `BaseException | None`
1580
1580
 
1581
- Example: Pydantic schema (`include_raw=False`):
1581
+ ???+ example "Pydantic schema (`include_raw=False`)"
1582
1582
 
1583
- ```python
1584
- from pydantic import BaseModel
1583
+ ```python
1584
+ from pydantic import BaseModel
1585
1585
 
1586
1586
 
1587
- class AnswerWithJustification(BaseModel):
1588
- '''An answer to the user question along with justification for the answer.'''
1587
+ class AnswerWithJustification(BaseModel):
1588
+ '''An answer to the user question along with justification for the answer.'''
1589
1589
 
1590
- answer: str
1591
- justification: str
1590
+ answer: str
1591
+ justification: str
1592
1592
 
1593
1593
 
1594
- model = ChatModel(model="model-name", temperature=0)
1595
- structured_model = model.with_structured_output(AnswerWithJustification)
1594
+ model = ChatModel(model="model-name", temperature=0)
1595
+ structured_model = model.with_structured_output(AnswerWithJustification)
1596
1596
 
1597
- structured_model.invoke(
1598
- "What weighs more a pound of bricks or a pound of feathers"
1599
- )
1597
+ structured_model.invoke(
1598
+ "What weighs more a pound of bricks or a pound of feathers"
1599
+ )
1600
1600
 
1601
- # -> AnswerWithJustification(
1602
- # answer='They weigh the same',
1603
- # justification='Both a pound of bricks and a pound of feathers weigh one pound. The weight is the same, but the volume or density of the objects may differ.'
1604
- # )
1605
- ```
1601
+ # -> AnswerWithJustification(
1602
+ # answer='They weigh the same',
1603
+ # justification='Both a pound of bricks and a pound of feathers weigh one pound. The weight is the same, but the volume or density of the objects may differ.'
1604
+ # )
1605
+ ```
1606
1606
 
1607
- Example: Pydantic schema (`include_raw=True`):
1607
+ ??? example "Pydantic schema (`include_raw=True`)"
1608
1608
 
1609
- ```python
1610
- from pydantic import BaseModel
1609
+ ```python
1610
+ from pydantic import BaseModel
1611
1611
 
1612
1612
 
1613
- class AnswerWithJustification(BaseModel):
1614
- '''An answer to the user question along with justification for the answer.'''
1613
+ class AnswerWithJustification(BaseModel):
1614
+ '''An answer to the user question along with justification for the answer.'''
1615
1615
 
1616
- answer: str
1617
- justification: str
1616
+ answer: str
1617
+ justification: str
1618
1618
 
1619
1619
 
1620
- model = ChatModel(model="model-name", temperature=0)
1621
- structured_model = model.with_structured_output(
1622
- AnswerWithJustification, include_raw=True
1623
- )
1620
+ model = ChatModel(model="model-name", temperature=0)
1621
+ structured_model = model.with_structured_output(
1622
+ AnswerWithJustification, include_raw=True
1623
+ )
1624
1624
 
1625
- structured_model.invoke(
1626
- "What weighs more a pound of bricks or a pound of feathers"
1627
- )
1628
- # -> {
1629
- # 'raw': AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_Ao02pnFYXD6GN1yzc0uXPsvF', 'function': {'arguments': '{"answer":"They weigh the same.","justification":"Both a pound of bricks and a pound of feathers weigh one pound. The weight is the same, but the volume or density of the objects may differ."}', 'name': 'AnswerWithJustification'}, 'type': 'function'}]}),
1630
- # 'parsed': AnswerWithJustification(answer='They weigh the same.', justification='Both a pound of bricks and a pound of feathers weigh one pound. The weight is the same, but the volume or density of the objects may differ.'),
1631
- # 'parsing_error': None
1632
- # }
1633
- ```
1625
+ structured_model.invoke(
1626
+ "What weighs more a pound of bricks or a pound of feathers"
1627
+ )
1628
+ # -> {
1629
+ # 'raw': AIMessage(content='', additional_kwargs={'tool_calls': [{'id': 'call_Ao02pnFYXD6GN1yzc0uXPsvF', 'function': {'arguments': '{"answer":"They weigh the same.","justification":"Both a pound of bricks and a pound of feathers weigh one pound. The weight is the same, but the volume or density of the objects may differ."}', 'name': 'AnswerWithJustification'}, 'type': 'function'}]}),
1630
+ # 'parsed': AnswerWithJustification(answer='They weigh the same.', justification='Both a pound of bricks and a pound of feathers weigh one pound. The weight is the same, but the volume or density of the objects may differ.'),
1631
+ # 'parsing_error': None
1632
+ # }
1633
+ ```
1634
1634
 
1635
- Example: `dict` schema (`include_raw=False`):
1635
+ ??? example "Dictionary schema (`include_raw=False`)"
1636
1636
 
1637
- ```python
1638
- from pydantic import BaseModel
1639
- from langchain_core.utils.function_calling import convert_to_openai_tool
1637
+ ```python
1638
+ from pydantic import BaseModel
1639
+ from langchain_core.utils.function_calling import convert_to_openai_tool
1640
1640
 
1641
1641
 
1642
- class AnswerWithJustification(BaseModel):
1643
- '''An answer to the user question along with justification for the answer.'''
1642
+ class AnswerWithJustification(BaseModel):
1643
+ '''An answer to the user question along with justification for the answer.'''
1644
1644
 
1645
- answer: str
1646
- justification: str
1645
+ answer: str
1646
+ justification: str
1647
1647
 
1648
1648
 
1649
- dict_schema = convert_to_openai_tool(AnswerWithJustification)
1650
- model = ChatModel(model="model-name", temperature=0)
1651
- structured_model = model.with_structured_output(dict_schema)
1649
+ dict_schema = convert_to_openai_tool(AnswerWithJustification)
1650
+ model = ChatModel(model="model-name", temperature=0)
1651
+ structured_model = model.with_structured_output(dict_schema)
1652
1652
 
1653
- structured_model.invoke(
1654
- "What weighs more a pound of bricks or a pound of feathers"
1655
- )
1656
- # -> {
1657
- # 'answer': 'They weigh the same',
1658
- # 'justification': 'Both a pound of bricks and a pound of feathers weigh one pound. The weight is the same, but the volume and density of the two substances differ.'
1659
- # }
1660
- ```
1653
+ structured_model.invoke(
1654
+ "What weighs more a pound of bricks or a pound of feathers"
1655
+ )
1656
+ # -> {
1657
+ # 'answer': 'They weigh the same',
1658
+ # 'justification': 'Both a pound of bricks and a pound of feathers weigh one pound. The weight is the same, but the volume and density of the two substances differ.'
1659
+ # }
1660
+ ```
1661
1661
 
1662
1662
  !!! warning "Behavior changed in `langchain-core` 0.2.26"
1663
+
1663
1664
  Added support for `TypedDict` class.
1664
1665
 
1665
1666
  """ # noqa: E501
@@ -61,6 +61,8 @@ if TYPE_CHECKING:
61
61
 
62
62
  logger = logging.getLogger(__name__)
63
63
 
64
+ _background_tasks: set[asyncio.Task] = set()
65
+
64
66
 
65
67
  @functools.lru_cache
66
68
  def _log_error_once(msg: str) -> None:
@@ -100,9 +102,9 @@ def create_base_retry_decorator(
100
102
  asyncio.run(coro)
101
103
  else:
102
104
  if loop.is_running():
103
- # TODO: Fix RUF006 - this task should have a reference
104
- # and be awaited somewhere
105
- loop.create_task(coro) # noqa: RUF006
105
+ task = loop.create_task(coro)
106
+ _background_tasks.add(task)
107
+ task.add_done_callback(_background_tasks.discard)
106
108
  else:
107
109
  asyncio.run(coro)
108
110
  except Exception as e:
@@ -1,4 +1,9 @@
1
- """Load LangChain objects from JSON strings or objects."""
1
+ """Load LangChain objects from JSON strings or objects.
2
+
3
+ !!! warning
4
+ `load` and `loads` are vulnerable to remote code execution. Never use with untrusted
5
+ input.
6
+ """
2
7
 
3
8
  import importlib
4
9
  import json
@@ -193,6 +198,10 @@ def loads(
193
198
  ) -> Any:
194
199
  """Revive a LangChain class from a JSON string.
195
200
 
201
+ !!! warning
202
+ This function is vulnerable to remote code execution. Never use with untrusted
203
+ input.
204
+
196
205
  Equivalent to `load(json.loads(text))`.
197
206
 
198
207
  Args:
@@ -236,6 +245,10 @@ def load(
236
245
  ) -> Any:
237
246
  """Revive a LangChain class from a JSON object.
238
247
 
248
+ !!! warning
249
+ This function is vulnerable to remote code execution. Never use with untrusted
250
+ input.
251
+
239
252
  Use this if you already have a parsed JSON object,
240
253
  eg. from `json.load` or `orjson.loads`.
241
254
 
@@ -51,22 +51,22 @@ class InputTokenDetails(TypedDict, total=False):
51
51
  May also hold extra provider-specific keys.
52
52
 
53
53
  !!! version-added "Added in `langchain-core` 0.3.9"
54
-
55
54
  """
56
55
 
57
56
  audio: int
58
57
  """Audio input tokens."""
58
+
59
59
  cache_creation: int
60
60
  """Input tokens that were cached and there was a cache miss.
61
61
 
62
62
  Since there was a cache miss, the cache was created from these tokens.
63
63
  """
64
+
64
65
  cache_read: int
65
66
  """Input tokens that were cached and there was a cache hit.
66
67
 
67
68
  Since there was a cache hit, the tokens were read from the cache. More precisely,
68
69
  the model state given these tokens was read from the cache.
69
-
70
70
  """
71
71
 
72
72
 
@@ -91,12 +91,12 @@ class OutputTokenDetails(TypedDict, total=False):
91
91
 
92
92
  audio: int
93
93
  """Audio output tokens."""
94
+
94
95
  reasoning: int
95
96
  """Reasoning output tokens.
96
97
 
97
98
  Tokens generated by the model in a chain of thought process (i.e. by OpenAI's o1
98
99
  models) that are not returned as part of model output.
99
-
100
100
  """
101
101
 
102
102
 
@@ -124,9 +124,11 @@ class UsageMetadata(TypedDict):
124
124
  ```
125
125
 
126
126
  !!! warning "Behavior changed in `langchain-core` 0.3.9"
127
+
127
128
  Added `input_token_details` and `output_token_details`.
128
129
 
129
130
  !!! note "LangSmith SDK"
131
+
130
132
  The LangSmith SDK also has a `UsageMetadata` class. While the two share fields,
131
133
  LangSmith's `UsageMetadata` has additional fields to capture cost information
132
134
  used by the LangSmith platform.
@@ -134,15 +136,19 @@ class UsageMetadata(TypedDict):
134
136
 
135
137
  input_tokens: int
136
138
  """Count of input (or prompt) tokens. Sum of all input token types."""
139
+
137
140
  output_tokens: int
138
141
  """Count of output (or completion) tokens. Sum of all output token types."""
142
+
139
143
  total_tokens: int
140
144
  """Total token count. Sum of `input_tokens` + `output_tokens`."""
145
+
141
146
  input_token_details: NotRequired[InputTokenDetails]
142
147
  """Breakdown of input token counts.
143
148
 
144
149
  Does *not* need to sum to full input token count. Does *not* need to have all keys.
145
150
  """
151
+
146
152
  output_token_details: NotRequired[OutputTokenDetails]
147
153
  """Breakdown of output token counts.
148
154
 
@@ -162,8 +168,10 @@ class AIMessage(BaseMessage):
162
168
 
163
169
  tool_calls: list[ToolCall] = []
164
170
  """If present, tool calls associated with the message."""
171
+
165
172
  invalid_tool_calls: list[InvalidToolCall] = []
166
173
  """If present, tool calls with parsing errors associated with the message."""
174
+
167
175
  usage_metadata: UsageMetadata | None = None
168
176
  """If present, usage metadata for a message, such as token counts.
169
177
 
@@ -555,7 +563,7 @@ class AIMessageChunk(AIMessage, BaseMessageChunk):
555
563
 
556
564
  @model_validator(mode="after")
557
565
  def init_server_tool_calls(self) -> Self:
558
- """Parse `server_tool_call_chunks`."""
566
+ """Parse `server_tool_call_chunks` from [`ServerToolCallChunk`][langchain.messages.ServerToolCallChunk] objects.""" # noqa: E501
559
567
  if (
560
568
  self.chunk_position == "last"
561
569
  and self.response_metadata.get("output_version") == "v1"
@@ -391,12 +391,12 @@ class BaseMessageChunk(BaseMessage):
391
391
  Raises:
392
392
  TypeError: If the other object is not a message chunk.
393
393
 
394
- For example,
395
-
396
- `AIMessageChunk(content="Hello") + AIMessageChunk(content=" World")`
397
-
398
- will give `AIMessageChunk(content="Hello World")`
399
-
394
+ Example:
395
+ ```txt
396
+ AIMessageChunk(content="Hello", ...)
397
+ + AIMessageChunk(content=" World", ...)
398
+ = AIMessageChunk(content="Hello World", ...)
399
+ ```
400
400
  """
401
401
  if isinstance(other, BaseMessageChunk):
402
402
  # If both are (subclasses of) BaseMessageChunk,
@@ -248,8 +248,14 @@ def _convert_to_v1_from_anthropic(message: AIMessage) -> list[types.ContentBlock
248
248
  tool_call_chunk: types.ToolCallChunk = (
249
249
  message.tool_call_chunks[0].copy() # type: ignore[assignment]
250
250
  )
251
+ if "caller" in block:
252
+ if "extras" not in tool_call_chunk:
253
+ tool_call_chunk["extras"] = {}
254
+ tool_call_chunk["extras"]["caller"] = block["caller"]
255
+
251
256
  if "type" not in tool_call_chunk:
252
257
  tool_call_chunk["type"] = "tool_call_chunk"
258
+
253
259
  yield tool_call_chunk
254
260
  else:
255
261
  tool_call_block: types.ToolCall | None = None
@@ -282,6 +288,11 @@ def _convert_to_v1_from_anthropic(message: AIMessage) -> list[types.ContentBlock
282
288
  }
283
289
  if "index" in block:
284
290
  tool_call_block["index"] = block["index"]
291
+ if "caller" in block:
292
+ if "extras" not in tool_call_block:
293
+ tool_call_block["extras"] = {}
294
+ tool_call_block["extras"]["caller"] = block["caller"]
295
+
285
296
  yield tool_call_block
286
297
 
287
298
  elif block_type == "input_json_delta" and isinstance(
@@ -76,21 +76,36 @@ def translate_grounding_metadata_to_citations(
76
76
  for chunk_index in chunk_indices:
77
77
  if chunk_index < len(grounding_chunks):
78
78
  chunk = grounding_chunks[chunk_index]
79
- web_info = chunk.get("web", {})
79
+
80
+ # Handle web and maps grounding
81
+ web_info = chunk.get("web") or {}
82
+ maps_info = chunk.get("maps") or {}
83
+
84
+ # Extract citation info depending on source
85
+ url = maps_info.get("uri") or web_info.get("uri")
86
+ title = maps_info.get("title") or web_info.get("title")
87
+
88
+ # Note: confidence_scores is a legacy field from Gemini 2.0 and earlier
89
+ # that indicated confidence (0.0-1.0) for each grounding chunk.
90
+ #
91
+ # In Gemini 2.5+, this field is always None/empty and should be ignored.
92
+ extras_metadata = {
93
+ "web_search_queries": web_search_queries,
94
+ "grounding_chunk_index": chunk_index,
95
+ "confidence_scores": support.get("confidence_scores") or [],
96
+ }
97
+
98
+ # Add maps-specific metadata if present
99
+ if maps_info.get("placeId"):
100
+ extras_metadata["place_id"] = maps_info["placeId"]
80
101
 
81
102
  citation = create_citation(
82
- url=web_info.get("uri"),
83
- title=web_info.get("title"),
103
+ url=url,
104
+ title=title,
84
105
  start_index=start_index,
85
106
  end_index=end_index,
86
107
  cited_text=cited_text,
87
- extras={
88
- "google_ai_metadata": {
89
- "web_search_queries": web_search_queries,
90
- "grounding_chunk_index": chunk_index,
91
- "confidence_scores": support.get("confidence_scores", []),
92
- }
93
- },
108
+ google_ai_metadata=extras_metadata,
94
109
  )
95
110
  citations.append(citation)
96
111
 
@@ -654,7 +654,7 @@ class PlainTextContentBlock(TypedDict):
654
654
 
655
655
  !!! note
656
656
  Title and context are optional fields that may be passed to the model. See
657
- Anthropic [example](https://docs.claude.com/en/docs/build-with-claude/citations#citable-vs-non-citable-content).
657
+ Anthropic [example](https://platform.claude.com/docs/en/build-with-claude/citations#citable-vs-non-citable-content).
658
658
 
659
659
  !!! note "Factory function"
660
660
  `create_plaintext_block` may also be used as a factory to create a