langchain-core 1.0.0a3__tar.gz → 1.0.0a5__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 (366) hide show
  1. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/PKG-INFO +8 -8
  2. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/_api/beta_decorator.py +6 -5
  3. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/_api/deprecation.py +11 -11
  4. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/callbacks/manager.py +2 -2
  5. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/callbacks/usage.py +2 -2
  6. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/document_loaders/langsmith.py +1 -1
  7. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/indexing/api.py +30 -30
  8. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/language_models/chat_models.py +7 -6
  9. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/language_models/fake_chat_models.py +5 -2
  10. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/load/serializable.py +1 -1
  11. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/__init__.py +9 -15
  12. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/ai.py +75 -9
  13. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/base.py +79 -37
  14. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/block_translators/__init__.py +11 -1
  15. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/block_translators/anthropic.py +151 -134
  16. langchain_core-1.0.0a5/langchain_core/messages/block_translators/bedrock.py +94 -0
  17. langchain_core-1.0.0a5/langchain_core/messages/block_translators/bedrock_converse.py +297 -0
  18. langchain_core-1.0.0a5/langchain_core/messages/block_translators/langchain_v0.py +301 -0
  19. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/block_translators/openai.py +224 -42
  20. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/chat.py +4 -1
  21. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/content.py +56 -112
  22. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/function.py +9 -5
  23. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/human.py +6 -2
  24. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/modifier.py +1 -0
  25. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/system.py +9 -2
  26. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/tool.py +31 -14
  27. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/utils.py +89 -83
  28. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/outputs/chat_generation.py +10 -6
  29. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompt_values.py +6 -2
  30. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompts/chat.py +6 -3
  31. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompts/few_shot.py +4 -1
  32. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/base.py +4 -1
  33. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/graph_ascii.py +1 -1
  34. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tools/base.py +1 -2
  35. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tools/convert.py +1 -1
  36. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/aiter.py +1 -1
  37. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/function_calling.py +5 -6
  38. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/iter.py +1 -1
  39. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/vectorstores/in_memory.py +5 -5
  40. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/version.py +1 -1
  41. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/pyproject.toml +29 -30
  42. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/indexing/test_indexing.py +336 -45
  43. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/language_models/chat_models/test_base.py +40 -0
  44. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/messages/block_translators/test_anthropic.py +84 -34
  45. langchain_core-1.0.0a5/tests/unit_tests/messages/block_translators/test_bedrock.py +407 -0
  46. langchain_core-1.0.0a5/tests/unit_tests/messages/block_translators/test_bedrock_converse.py +381 -0
  47. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/messages/block_translators/test_langchain_v0.py +34 -0
  48. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/messages/block_translators/test_openai.py +30 -2
  49. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/messages/test_ai.py +65 -3
  50. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/messages/test_imports.py +3 -5
  51. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/messages/test_utils.py +61 -0
  52. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/__snapshots__/test_chat.ambr +26 -32
  53. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/test_few_shot.py +0 -1
  54. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/test_pipeline_prompt.py +21 -0
  55. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/test_prompt.py +1 -2
  56. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/__snapshots__/test_graph.ambr +13 -16
  57. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/__snapshots__/test_runnable.ambr +104 -128
  58. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/test_graph.py +4 -4
  59. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/stubs.py +5 -4
  60. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/test_imports.py +10 -2
  61. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/test_pydantic_imports.py +5 -1
  62. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/test_tools.py +1 -1
  63. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/utils/test_strings.py +32 -0
  64. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/vectorstores/test_in_memory.py +4 -4
  65. langchain_core-1.0.0a3/langchain_core/messages/block_translators/bedrock.py +0 -47
  66. langchain_core-1.0.0a3/langchain_core/messages/block_translators/bedrock_converse.py +0 -49
  67. langchain_core-1.0.0a3/langchain_core/messages/block_translators/langchain_v0.py +0 -164
  68. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/README.md +0 -0
  69. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/__init__.py +0 -0
  70. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/_api/__init__.py +0 -0
  71. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/_api/internal.py +0 -0
  72. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/_api/path.py +0 -0
  73. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/_import_utils.py +0 -0
  74. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/agents.py +0 -0
  75. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/caches.py +0 -0
  76. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/callbacks/__init__.py +0 -0
  77. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/callbacks/base.py +0 -0
  78. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/callbacks/file.py +0 -0
  79. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/callbacks/stdout.py +0 -0
  80. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/callbacks/streaming_stdout.py +0 -0
  81. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/chat_history.py +0 -0
  82. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/chat_loaders.py +0 -0
  83. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/chat_sessions.py +0 -0
  84. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/document_loaders/__init__.py +0 -0
  85. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/document_loaders/base.py +0 -0
  86. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/document_loaders/blob_loaders.py +0 -0
  87. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/documents/__init__.py +0 -0
  88. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/documents/base.py +0 -0
  89. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/documents/compressor.py +0 -0
  90. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/documents/transformers.py +0 -0
  91. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/embeddings/__init__.py +0 -0
  92. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/embeddings/embeddings.py +0 -0
  93. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/embeddings/fake.py +0 -0
  94. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/env.py +0 -0
  95. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/example_selectors/__init__.py +0 -0
  96. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/example_selectors/base.py +0 -0
  97. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/example_selectors/length_based.py +0 -0
  98. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/example_selectors/semantic_similarity.py +0 -0
  99. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/exceptions.py +0 -0
  100. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/globals.py +0 -0
  101. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/indexing/__init__.py +0 -0
  102. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/indexing/base.py +0 -0
  103. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/indexing/in_memory.py +0 -0
  104. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/language_models/__init__.py +0 -0
  105. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/language_models/_utils.py +0 -0
  106. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/language_models/base.py +0 -0
  107. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/language_models/fake.py +0 -0
  108. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/language_models/llms.py +0 -0
  109. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/load/__init__.py +0 -0
  110. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/load/dump.py +0 -0
  111. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/load/load.py +0 -0
  112. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/load/mapping.py +0 -0
  113. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/memory.py +0 -0
  114. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/block_translators/google_genai.py +0 -0
  115. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/block_translators/google_vertexai.py +0 -0
  116. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/block_translators/groq.py +0 -0
  117. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/messages/block_translators/ollama.py +0 -0
  118. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/output_parsers/__init__.py +0 -0
  119. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/output_parsers/base.py +0 -0
  120. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/output_parsers/format_instructions.py +0 -0
  121. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/output_parsers/json.py +0 -0
  122. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/output_parsers/list.py +0 -0
  123. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/output_parsers/openai_functions.py +0 -0
  124. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/output_parsers/openai_tools.py +0 -0
  125. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/output_parsers/pydantic.py +0 -0
  126. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/output_parsers/string.py +0 -0
  127. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/output_parsers/transform.py +0 -0
  128. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/output_parsers/xml.py +0 -0
  129. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/outputs/__init__.py +0 -0
  130. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/outputs/chat_result.py +0 -0
  131. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/outputs/generation.py +0 -0
  132. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/outputs/llm_result.py +0 -0
  133. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/outputs/run_info.py +0 -0
  134. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompts/__init__.py +0 -0
  135. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompts/base.py +0 -0
  136. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompts/dict.py +0 -0
  137. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompts/few_shot_with_templates.py +0 -0
  138. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompts/image.py +0 -0
  139. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompts/loading.py +0 -0
  140. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompts/message.py +0 -0
  141. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompts/pipeline.py +0 -0
  142. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompts/prompt.py +0 -0
  143. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompts/string.py +0 -0
  144. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/prompts/structured.py +0 -0
  145. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/py.typed +0 -0
  146. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/pydantic_v1/__init__.py +0 -0
  147. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/pydantic_v1/dataclasses.py +0 -0
  148. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/pydantic_v1/main.py +0 -0
  149. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/rate_limiters.py +0 -0
  150. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/retrievers.py +0 -0
  151. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/__init__.py +0 -0
  152. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/branch.py +0 -0
  153. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/config.py +0 -0
  154. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/configurable.py +0 -0
  155. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/fallbacks.py +0 -0
  156. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/graph.py +0 -0
  157. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/graph_mermaid.py +0 -0
  158. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/graph_png.py +0 -0
  159. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/history.py +0 -0
  160. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/passthrough.py +0 -0
  161. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/retry.py +0 -0
  162. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/router.py +0 -0
  163. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/schema.py +0 -0
  164. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/runnables/utils.py +0 -0
  165. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/stores.py +0 -0
  166. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/structured_query.py +0 -0
  167. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/sys_info.py +0 -0
  168. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tools/__init__.py +0 -0
  169. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tools/render.py +0 -0
  170. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tools/retriever.py +0 -0
  171. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tools/simple.py +0 -0
  172. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tools/structured.py +0 -0
  173. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/__init__.py +0 -0
  174. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/_streaming.py +0 -0
  175. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/base.py +0 -0
  176. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/context.py +0 -0
  177. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/core.py +0 -0
  178. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/evaluation.py +0 -0
  179. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/event_stream.py +0 -0
  180. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/langchain.py +0 -0
  181. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/langchain_v1.py +0 -0
  182. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/log_stream.py +0 -0
  183. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/memory_stream.py +0 -0
  184. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/root_listeners.py +0 -0
  185. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/run_collector.py +0 -0
  186. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/schemas.py +0 -0
  187. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/tracers/stdout.py +0 -0
  188. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/__init__.py +0 -0
  189. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/_merge.py +0 -0
  190. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/env.py +0 -0
  191. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/formatting.py +0 -0
  192. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/html.py +0 -0
  193. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/image.py +0 -0
  194. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/input.py +0 -0
  195. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/interactive_env.py +0 -0
  196. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/json.py +0 -0
  197. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/json_schema.py +0 -0
  198. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/loading.py +0 -0
  199. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/mustache.py +0 -0
  200. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/pydantic.py +0 -0
  201. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/strings.py +0 -0
  202. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/usage.py +0 -0
  203. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/utils/utils.py +0 -0
  204. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/vectorstores/__init__.py +0 -0
  205. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/vectorstores/base.py +0 -0
  206. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/langchain_core/vectorstores/utils.py +0 -0
  207. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/__init__.py +0 -0
  208. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/benchmarks/__init__.py +0 -0
  209. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/benchmarks/test_async_callbacks.py +0 -0
  210. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/benchmarks/test_imports.py +0 -0
  211. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/integration_tests/__init__.py +0 -0
  212. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/integration_tests/test_compile.py +0 -0
  213. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/__init__.py +0 -0
  214. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/_api/__init__.py +0 -0
  215. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/_api/test_beta_decorator.py +0 -0
  216. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/_api/test_deprecation.py +0 -0
  217. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/_api/test_imports.py +0 -0
  218. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/_api/test_path.py +0 -0
  219. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/caches/__init__.py +0 -0
  220. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/caches/test_in_memory_cache.py +0 -0
  221. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/callbacks/__init__.py +0 -0
  222. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/callbacks/test_async_callback_manager.py +0 -0
  223. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/callbacks/test_dispatch_custom_event.py +0 -0
  224. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/callbacks/test_imports.py +0 -0
  225. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/callbacks/test_sync_callback_manager.py +0 -0
  226. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/callbacks/test_usage_callback.py +0 -0
  227. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/chat_history/__init__.py +0 -0
  228. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/chat_history/test_chat_history.py +0 -0
  229. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/conftest.py +0 -0
  230. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/data/prompt_file.txt +0 -0
  231. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/data/prompts/prompt_extra_args.json +0 -0
  232. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/data/prompts/prompt_missing_args.json +0 -0
  233. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/data/prompts/simple_prompt.json +0 -0
  234. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/dependencies/__init__.py +0 -0
  235. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/dependencies/test_dependencies.py +0 -0
  236. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/document_loaders/__init__.py +0 -0
  237. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/document_loaders/test_base.py +0 -0
  238. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/document_loaders/test_langsmith.py +0 -0
  239. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/documents/__init__.py +0 -0
  240. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/documents/test_document.py +0 -0
  241. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/documents/test_imports.py +0 -0
  242. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/documents/test_str.py +0 -0
  243. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/embeddings/__init__.py +0 -0
  244. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/embeddings/test_deterministic_embedding.py +0 -0
  245. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/example_selectors/__init__.py +0 -0
  246. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/example_selectors/test_base.py +0 -0
  247. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/example_selectors/test_imports.py +0 -0
  248. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/example_selectors/test_length_based_example_selector.py +0 -0
  249. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/example_selectors/test_similarity.py +0 -0
  250. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/example-non-utf8.csv +0 -0
  251. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/example-non-utf8.txt +0 -0
  252. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/example-utf8.csv +0 -0
  253. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/example-utf8.txt +0 -0
  254. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/example_prompt.json +0 -0
  255. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/examples.json +0 -0
  256. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/examples.yaml +0 -0
  257. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/few_shot_prompt.json +0 -0
  258. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/few_shot_prompt.yaml +0 -0
  259. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/few_shot_prompt_example_prompt.json +0 -0
  260. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/few_shot_prompt_examples_in.json +0 -0
  261. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/few_shot_prompt_yaml_examples.yaml +0 -0
  262. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/jinja_injection_prompt.json +0 -0
  263. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/jinja_injection_prompt.yaml +0 -0
  264. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/prompt_with_output_parser.json +0 -0
  265. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/simple_prompt.json +0 -0
  266. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/simple_prompt.yaml +0 -0
  267. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/simple_prompt_with_template_file.json +0 -0
  268. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/examples/simple_template.txt +0 -0
  269. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/fake/__init__.py +0 -0
  270. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/fake/callbacks.py +0 -0
  271. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/fake/test_fake_chat_model.py +0 -0
  272. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/indexing/__init__.py +0 -0
  273. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/indexing/test_hashed_document.py +0 -0
  274. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/indexing/test_in_memory_indexer.py +0 -0
  275. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/indexing/test_in_memory_record_manager.py +0 -0
  276. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/indexing/test_public_api.py +0 -0
  277. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/language_models/__init__.py +0 -0
  278. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/language_models/chat_models/__init__.py +0 -0
  279. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/language_models/chat_models/test_benchmark.py +0 -0
  280. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/language_models/chat_models/test_cache.py +0 -0
  281. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/language_models/chat_models/test_rate_limiting.py +0 -0
  282. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/language_models/llms/__init__.py +0 -0
  283. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/language_models/llms/test_base.py +0 -0
  284. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/language_models/llms/test_cache.py +0 -0
  285. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/language_models/test_imports.py +0 -0
  286. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/load/__init__.py +0 -0
  287. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/load/test_imports.py +0 -0
  288. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/load/test_serializable.py +0 -0
  289. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/messages/__init__.py +0 -0
  290. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/messages/block_translators/__init__.py +0 -0
  291. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/messages/block_translators/test_registration.py +0 -0
  292. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/output_parsers/__init__.py +0 -0
  293. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/output_parsers/test_base_parsers.py +0 -0
  294. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/output_parsers/test_imports.py +0 -0
  295. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/output_parsers/test_json.py +0 -0
  296. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/output_parsers/test_list_parser.py +0 -0
  297. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/output_parsers/test_openai_functions.py +0 -0
  298. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/output_parsers/test_openai_tools.py +0 -0
  299. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/output_parsers/test_pydantic_parser.py +0 -0
  300. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/output_parsers/test_xml_parser.py +0 -0
  301. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/outputs/__init__.py +0 -0
  302. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/outputs/test_chat_generation.py +0 -0
  303. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/outputs/test_imports.py +0 -0
  304. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompt_file.txt +0 -0
  305. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/__init__.py +0 -0
  306. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/__snapshots__/test_prompt.ambr +0 -0
  307. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/prompt_extra_args.json +0 -0
  308. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/prompt_missing_args.json +0 -0
  309. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/simple_prompt.json +0 -0
  310. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/test_chat.py +0 -0
  311. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/test_dict.py +0 -0
  312. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/test_few_shot_with_templates.py +0 -0
  313. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/test_image.py +0 -0
  314. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/test_imports.py +0 -0
  315. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/test_loading.py +0 -0
  316. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/test_structured.py +0 -0
  317. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/prompts/test_utils.py +0 -0
  318. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/pydantic_utils.py +0 -0
  319. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/rate_limiters/__init__.py +0 -0
  320. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/rate_limiters/test_in_memory_rate_limiter.py +0 -0
  321. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/__init__.py +0 -0
  322. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/__snapshots__/test_fallbacks.ambr +0 -0
  323. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/test_concurrency.py +0 -0
  324. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/test_config.py +0 -0
  325. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/test_configurable.py +0 -0
  326. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/test_fallbacks.py +0 -0
  327. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/test_history.py +0 -0
  328. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/test_imports.py +0 -0
  329. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/test_runnable.py +0 -0
  330. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/test_runnable_events_v1.py +0 -0
  331. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/test_runnable_events_v2.py +0 -0
  332. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/test_tracing_interops.py +0 -0
  333. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/runnables/test_utils.py +0 -0
  334. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/stores/__init__.py +0 -0
  335. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/stores/test_in_memory.py +0 -0
  336. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/test_globals.py +0 -0
  337. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/test_messages.py +0 -0
  338. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/test_outputs.py +0 -0
  339. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/test_prompt_values.py +0 -0
  340. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/test_pydantic_serde.py +0 -0
  341. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/test_retrievers.py +0 -0
  342. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/test_setup.py +0 -0
  343. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/test_sys_info.py +0 -0
  344. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/tracers/__init__.py +0 -0
  345. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/tracers/test_async_base_tracer.py +0 -0
  346. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/tracers/test_base_tracer.py +0 -0
  347. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/tracers/test_imports.py +0 -0
  348. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/tracers/test_langchain.py +0 -0
  349. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/tracers/test_memory_stream.py +0 -0
  350. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/tracers/test_run_collector.py +0 -0
  351. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/tracers/test_schemas.py +0 -0
  352. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/utils/__init__.py +0 -0
  353. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/utils/test_aiter.py +0 -0
  354. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/utils/test_env.py +0 -0
  355. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/utils/test_function_calling.py +0 -0
  356. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/utils/test_html.py +0 -0
  357. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/utils/test_imports.py +0 -0
  358. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/utils/test_iter.py +0 -0
  359. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/utils/test_json_schema.py +0 -0
  360. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/utils/test_pydantic.py +0 -0
  361. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/utils/test_rm_titles.py +0 -0
  362. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/utils/test_usage.py +0 -0
  363. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/utils/test_utils.py +0 -0
  364. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/vectorstores/__init__.py +0 -0
  365. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/vectorstores/test_utils.py +0 -0
  366. {langchain_core-1.0.0a3 → langchain_core-1.0.0a5}/tests/unit_tests/vectorstores/test_vectorstore.py +0 -0
@@ -1,19 +1,19 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langchain-core
3
- Version: 1.0.0a3
3
+ Version: 1.0.0a5
4
4
  Summary: Building applications with LLMs through composability
5
5
  License: MIT
6
6
  Project-URL: Source Code, https://github.com/langchain-ai/langchain/tree/master/libs/core
7
7
  Project-URL: Release Notes, https://github.com/langchain-ai/langchain/releases?q=tag%3A%22langchain-core%3D%3D0%22&expanded=true
8
8
  Project-URL: repository, https://github.com/langchain-ai/langchain
9
- Requires-Python: >=3.10
10
- Requires-Dist: langsmith>=0.3.45
9
+ Requires-Python: <4.0.0,>=3.10.0
10
+ Requires-Dist: langsmith<1.0.0,>=0.3.45
11
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
12
+ Requires-Dist: jsonpatch<2.0.0,>=1.33.0
13
+ Requires-Dist: PyYAML<7.0.0,>=5.3.0
14
+ Requires-Dist: typing-extensions<5.0.0,>=4.7.0
15
+ Requires-Dist: packaging<26.0.0,>=23.2.0
16
+ Requires-Dist: pydantic<3.0.0,>=2.7.4
17
17
  Description-Content-Type: text/markdown
18
18
 
19
19
  # 🦜🍎️ LangChain Core
@@ -174,6 +174,7 @@ def beta(
174
174
  def finalize(_wrapper: Callable[..., Any], new_doc: str) -> Any:
175
175
  """Finalize the property."""
176
176
  return property(fget=_fget, fset=_fset, fdel=_fdel, doc=new_doc)
177
+
177
178
  else:
178
179
  _name = _name or obj.__qualname__
179
180
  if not _obj_type:
@@ -226,17 +227,17 @@ def warn_beta(
226
227
  ) -> None:
227
228
  """Display a standardized beta annotation.
228
229
 
229
- Arguments:
230
- message : str, optional
230
+ Args:
231
+ message:
231
232
  Override the default beta message. The
232
233
  %(name)s, %(obj_type)s, %(addendum)s
233
234
  format specifiers will be replaced by the
234
235
  values of the respective arguments passed to this function.
235
- name : str, optional
236
+ name:
236
237
  The name of the annotated object.
237
- obj_type : str, optional
238
+ obj_type:
238
239
  The object type being annotated.
239
- addendum : str, optional
240
+ addendum:
240
241
  Additional text appended directly to the final message.
241
242
  """
242
243
  if not message:
@@ -431,35 +431,35 @@ def warn_deprecated(
431
431
  ) -> None:
432
432
  """Display a standardized deprecation.
433
433
 
434
- Arguments:
435
- since : str
434
+ Args:
435
+ since:
436
436
  The release at which this API became deprecated.
437
- message : str, optional
437
+ message:
438
438
  Override the default deprecation message. The %(since)s,
439
439
  %(name)s, %(alternative)s, %(obj_type)s, %(addendum)s,
440
440
  and %(removal)s format specifiers will be replaced by the
441
441
  values of the respective arguments passed to this function.
442
- name : str, optional
442
+ name:
443
443
  The name of the deprecated object.
444
- alternative : str, optional
444
+ alternative:
445
445
  An alternative API that the user may use in place of the
446
446
  deprecated API. The deprecation warning will tell the user
447
447
  about this alternative if provided.
448
- alternative_import: str, optional
448
+ alternative_import:
449
449
  An alternative import that the user may use instead.
450
- pending : bool, optional
450
+ pending:
451
451
  If True, uses a PendingDeprecationWarning instead of a
452
452
  DeprecationWarning. Cannot be used together with removal.
453
- obj_type : str, optional
453
+ obj_type:
454
454
  The object type being deprecated.
455
- addendum : str, optional
455
+ addendum:
456
456
  Additional text appended directly to the final message.
457
- removal : str, optional
457
+ removal:
458
458
  The expected removal version. With the default (an empty
459
459
  string), a removal version is automatically computed from
460
460
  since. Set to other Falsy values to not schedule a removal
461
461
  date. Cannot be used together with pending.
462
- package: str, optional
462
+ package:
463
463
  The package of the deprecated object.
464
464
  """
465
465
  if not pending:
@@ -92,7 +92,7 @@ def trace_as_chain_group(
92
92
  metadata (dict[str, Any], optional): The metadata to apply to all runs.
93
93
  Defaults to None.
94
94
 
95
- .. note:
95
+ .. note::
96
96
  Must have ``LANGCHAIN_TRACING_V2`` env var set to true to see the trace in
97
97
  LangSmith.
98
98
 
@@ -179,7 +179,7 @@ async def atrace_as_chain_group(
179
179
  Yields:
180
180
  The async callback manager for the chain group.
181
181
 
182
- .. note:
182
+ .. note::
183
183
  Must have ``LANGCHAIN_TRACING_V2`` env var set to true to see the trace in
184
184
  LangSmith.
185
185
 
@@ -32,7 +32,7 @@ class UsageMetadataCallbackHandler(BaseCallbackHandler):
32
32
  result_2 = llm_2.invoke("Hello", config={"callbacks": [callback]})
33
33
  callback.usage_metadata
34
34
 
35
- .. code-block:: none
35
+ .. code-block::
36
36
 
37
37
  {'gpt-4o-mini-2024-07-18': {'input_tokens': 8,
38
38
  'output_tokens': 10,
@@ -119,7 +119,7 @@ def get_usage_metadata_callback(
119
119
  llm_2.invoke("Hello")
120
120
  print(cb.usage_metadata)
121
121
 
122
- .. code-block:: none
122
+ .. code-block::
123
123
 
124
124
  {'gpt-4o-mini-2024-07-18': {'input_tokens': 8,
125
125
  'output_tokens': 10,
@@ -31,7 +31,7 @@ class LangSmithLoader(BaseLoader):
31
31
  for doc in loader.lazy_load():
32
32
  docs.append(doc)
33
33
 
34
- .. code-block:: pycon
34
+ .. code-block:: python
35
35
 
36
36
  # -> [Document("...", metadata={"inputs": {...}, "outputs": {...}, ...}), ...]
37
37
 
@@ -296,7 +296,11 @@ def index(
296
296
  For the time being, documents are indexed using their hashes, and users
297
297
  are not able to specify the uid of the document.
298
298
 
299
- Important:
299
+ .. versionchanged:: 0.3.25
300
+ Added ``scoped_full`` cleanup mode.
301
+
302
+ .. important::
303
+
300
304
  * In full mode, the loader should be returning
301
305
  the entire dataset, and not just a subset of the dataset.
302
306
  Otherwise, the auto_cleanup will remove documents that it is not
@@ -309,7 +313,7 @@ def index(
309
313
  chunks, and we index them using a batch size of 5, we'll have 3 batches
310
314
  all with the same source id. In general, to avoid doing too much
311
315
  redundant work select as big a batch size as possible.
312
- * The `scoped_full` mode is suitable if determining an appropriate batch size
316
+ * The ``scoped_full`` mode is suitable if determining an appropriate batch size
313
317
  is challenging or if your data loader cannot return the entire dataset at
314
318
  once. This mode keeps track of source IDs in memory, which should be fine
315
319
  for most use cases. If your dataset is large (10M+ docs), you will likely
@@ -378,10 +382,6 @@ def index(
378
382
  TypeError: If ``vectorstore`` is not a VectorStore or a DocumentIndex.
379
383
  AssertionError: If ``source_id`` is None when cleanup mode is incremental.
380
384
  (should be unreachable code).
381
-
382
- .. version_modified:: 0.3.25
383
-
384
- * Added `scoped_full` cleanup mode.
385
385
  """
386
386
  # Behavior is deprecated, but we keep it for backwards compatibility.
387
387
  # # Warn only once per process.
@@ -636,26 +636,30 @@ async def aindex(
636
636
  documents were deleted, which documents should be skipped.
637
637
 
638
638
  For the time being, documents are indexed using their hashes, and users
639
- are not able to specify the uid of the document.
640
-
641
- Important:
642
- * In full mode, the loader should be returning
643
- the entire dataset, and not just a subset of the dataset.
644
- Otherwise, the auto_cleanup will remove documents that it is not
645
- supposed to.
646
- * In incremental mode, if documents associated with a particular
647
- source id appear across different batches, the indexing API
648
- will do some redundant work. This will still result in the
649
- correct end state of the index, but will unfortunately not be
650
- 100% efficient. For example, if a given document is split into 15
651
- chunks, and we index them using a batch size of 5, we'll have 3 batches
652
- all with the same source id. In general, to avoid doing too much
653
- redundant work select as big a batch size as possible.
654
- * The `scoped_full` mode is suitable if determining an appropriate batch size
655
- is challenging or if your data loader cannot return the entire dataset at
656
- once. This mode keeps track of source IDs in memory, which should be fine
657
- for most use cases. If your dataset is large (10M+ docs), you will likely
658
- need to parallelize the indexing process regardless.
639
+ are not able to specify the uid of the document.
640
+
641
+ .. versionchanged:: 0.3.25
642
+ Added ``scoped_full`` cleanup mode.
643
+
644
+ .. important::
645
+
646
+ * In full mode, the loader should be returning
647
+ the entire dataset, and not just a subset of the dataset.
648
+ Otherwise, the auto_cleanup will remove documents that it is not
649
+ supposed to.
650
+ * In incremental mode, if documents associated with a particular
651
+ source id appear across different batches, the indexing API
652
+ will do some redundant work. This will still result in the
653
+ correct end state of the index, but will unfortunately not be
654
+ 100% efficient. For example, if a given document is split into 15
655
+ chunks, and we index them using a batch size of 5, we'll have 3 batches
656
+ all with the same source id. In general, to avoid doing too much
657
+ redundant work select as big a batch size as possible.
658
+ * The ``scoped_full`` mode is suitable if determining an appropriate batch size
659
+ is challenging or if your data loader cannot return the entire dataset at
660
+ once. This mode keeps track of source IDs in memory, which should be fine
661
+ for most use cases. If your dataset is large (10M+ docs), you will likely
662
+ need to parallelize the indexing process regardless.
659
663
 
660
664
  Args:
661
665
  docs_source: Data loader or iterable of documents to index.
@@ -720,10 +724,6 @@ async def aindex(
720
724
  TypeError: If ``vector_store`` is not a VectorStore or DocumentIndex.
721
725
  AssertionError: If ``source_id_key`` is None when cleanup mode is
722
726
  incremental or ``scoped_full`` (should be unreachable).
723
-
724
- .. version_modified:: 0.3.25
725
-
726
- * Added `scoped_full` cleanup mode.
727
727
  """
728
728
  # Behavior is deprecated, but we keep it for backwards compatibility.
729
729
  # # Warn only once per process.
@@ -48,7 +48,6 @@ from langchain_core.messages import (
48
48
  message_chunk_to_message,
49
49
  )
50
50
  from langchain_core.messages.block_translators.openai import (
51
- convert_to_openai_data_block,
52
51
  convert_to_openai_image_block,
53
52
  )
54
53
  from langchain_core.output_parsers.openai_tools import (
@@ -149,16 +148,18 @@ def _format_for_tracing(messages: list[BaseMessage]) -> list[BaseMessage]:
149
148
  block.get("type") == "file"
150
149
  and is_data_content_block(block) # v0 (image/audio/file) or v1
151
150
  and "base64" in block
152
- # Narrows to old Base64ContentBlock or new FileContentBlock
151
+ # Backward compat: convert v1 base64 blocks to v0
153
152
  ):
154
153
  if message_to_trace is message:
155
154
  # Shallow copy
156
155
  message_to_trace = message.model_copy()
157
156
  message_to_trace.content = list(message_to_trace.content)
158
157
 
159
- message_to_trace.content[idx] = convert_to_openai_data_block( # type: ignore[index]
160
- block
161
- )
158
+ message_to_trace.content[idx] = { # type: ignore[index]
159
+ **{k: v for k, v in block.items() if k != "base64"},
160
+ "data": block["base64"],
161
+ "source_type": "base64",
162
+ }
162
163
  elif len(block) == 1 and "type" not in block:
163
164
  # Tracing assumes all content blocks have a "type" key. Here
164
165
  # we add this key if it is missing, and there's an obvious
@@ -518,7 +519,7 @@ class BaseChatModel(BaseLanguageModel[AIMessage], ABC):
518
519
  **kwargs: Any,
519
520
  ) -> Iterator[AIMessageChunk]:
520
521
  if not self._should_stream(async_api=False, **{**kwargs, "stream": True}):
521
- # model doesn't implement streaming, so use default implementation
522
+ # Model doesn't implement streaming, so use default implementation
522
523
  yield cast(
523
524
  "AIMessageChunk",
524
525
  self.invoke(input, config=config, stop=stop, **kwargs),
@@ -19,7 +19,7 @@ from langchain_core.runnables import RunnableConfig
19
19
 
20
20
 
21
21
  class FakeMessagesListChatModel(BaseChatModel):
22
- """Fake ChatModel for testing purposes."""
22
+ """Fake ``ChatModel`` for testing purposes."""
23
23
 
24
24
  responses: list[BaseMessage]
25
25
  """List of responses to **cycle** through in order."""
@@ -222,10 +222,11 @@ class GenericFakeChatModel(BaseChatModel):
222
222
  """Generic fake chat model that can be used to test the chat model interface.
223
223
 
224
224
  * Chat model should be usable in both sync and async tests
225
- * Invokes on_llm_new_token to allow for testing of callback related code for new
225
+ * Invokes ``on_llm_new_token`` to allow for testing of callback related code for new
226
226
  tokens.
227
227
  * Includes logic to break messages into message chunk to facilitate testing of
228
228
  streaming.
229
+
229
230
  """
230
231
 
231
232
  messages: Iterator[Union[AIMessage, str]]
@@ -240,6 +241,7 @@ class GenericFakeChatModel(BaseChatModel):
240
241
  .. warning::
241
242
  Streaming is not implemented yet. We should try to implement it in the future by
242
243
  delegating to invoke and then breaking the resulting output into message chunks.
244
+
243
245
  """
244
246
 
245
247
  @override
@@ -367,6 +369,7 @@ class ParrotFakeChatModel(BaseChatModel):
367
369
  """Generic fake chat model that can be used to test the chat model interface.
368
370
 
369
371
  * Chat model should be usable in both sync and async tests
372
+
370
373
  """
371
374
 
372
375
  @override
@@ -111,7 +111,7 @@ class Serializable(BaseModel, ABC):
111
111
 
112
112
  # Remove default BaseModel init docstring.
113
113
  def __init__(self, *args: Any, **kwargs: Any) -> None:
114
- """""" # noqa: D419
114
+ """""" # noqa: D419 # Intentional blank docstring
115
115
  super().__init__(*args, **kwargs)
116
116
 
117
117
  @classmethod
@@ -41,9 +41,6 @@ if TYPE_CHECKING:
41
41
  Annotation,
42
42
  AudioContentBlock,
43
43
  Citation,
44
- CodeInterpreterCall,
45
- CodeInterpreterOutput,
46
- CodeInterpreterResult,
47
44
  ContentBlock,
48
45
  DataContentBlock,
49
46
  FileContentBlock,
@@ -53,10 +50,11 @@ if TYPE_CHECKING:
53
50
  NonStandardContentBlock,
54
51
  PlainTextContentBlock,
55
52
  ReasoningContentBlock,
53
+ ServerToolCall,
54
+ ServerToolCallChunk,
55
+ ServerToolResult,
56
56
  TextContentBlock,
57
57
  VideoContentBlock,
58
- WebSearchCall,
59
- WebSearchResult,
60
58
  is_data_content_block,
61
59
  )
62
60
  from langchain_core.messages.function import FunctionMessage, FunctionMessageChunk
@@ -96,9 +94,6 @@ __all__ = (
96
94
  "ChatMessage",
97
95
  "ChatMessageChunk",
98
96
  "Citation",
99
- "CodeInterpreterCall",
100
- "CodeInterpreterOutput",
101
- "CodeInterpreterResult",
102
97
  "ContentBlock",
103
98
  "DataContentBlock",
104
99
  "FileContentBlock",
@@ -114,6 +109,9 @@ __all__ = (
114
109
  "PlainTextContentBlock",
115
110
  "ReasoningContentBlock",
116
111
  "RemoveMessage",
112
+ "ServerToolCall",
113
+ "ServerToolCallChunk",
114
+ "ServerToolResult",
117
115
  "SystemMessage",
118
116
  "SystemMessageChunk",
119
117
  "TextContentBlock",
@@ -122,8 +120,6 @@ __all__ = (
122
120
  "ToolMessage",
123
121
  "ToolMessageChunk",
124
122
  "VideoContentBlock",
125
- "WebSearchCall",
126
- "WebSearchResult",
127
123
  "_message_from_dict",
128
124
  "convert_to_messages",
129
125
  "convert_to_openai_data_block",
@@ -156,9 +152,6 @@ _dynamic_imports = {
156
152
  "ContentBlock": "content",
157
153
  "ChatMessage": "chat",
158
154
  "ChatMessageChunk": "chat",
159
- "CodeInterpreterCall": "content",
160
- "CodeInterpreterOutput": "content",
161
- "CodeInterpreterResult": "content",
162
155
  "DataContentBlock": "content",
163
156
  "FileContentBlock": "content",
164
157
  "FunctionMessage": "function",
@@ -170,10 +163,11 @@ _dynamic_imports = {
170
163
  "PlainTextContentBlock": "content",
171
164
  "ReasoningContentBlock": "content",
172
165
  "RemoveMessage": "modifier",
166
+ "ServerToolCall": "content",
167
+ "ServerToolCallChunk": "content",
168
+ "ServerToolResult": "content",
173
169
  "SystemMessage": "system",
174
170
  "SystemMessageChunk": "system",
175
- "WebSearchCall": "content",
176
- "WebSearchResult": "content",
177
171
  "ImageContentBlock": "content",
178
172
  "InvalidToolCall": "tool",
179
173
  "TextContentBlock": "content",
@@ -13,6 +13,7 @@ from langchain_core.messages import content as types
13
13
  from langchain_core.messages.base import (
14
14
  BaseMessage,
15
15
  BaseMessageChunk,
16
+ _extract_reasoning_from_additional_kwargs,
16
17
  merge_content,
17
18
  )
18
19
  from langchain_core.messages.content import InvalidToolCall
@@ -39,7 +40,6 @@ class InputTokenDetails(TypedDict, total=False):
39
40
  Does *not* need to sum to full input token count. Does *not* need to have all keys.
40
41
 
41
42
  Example:
42
-
43
43
  .. code-block:: python
44
44
 
45
45
  {
@@ -66,6 +66,7 @@ class InputTokenDetails(TypedDict, total=False):
66
66
 
67
67
  Since there was a cache hit, the tokens were read from the cache. More precisely,
68
68
  the model state given these tokens was read from the cache.
69
+
69
70
  """
70
71
 
71
72
 
@@ -75,7 +76,6 @@ class OutputTokenDetails(TypedDict, total=False):
75
76
  Does *not* need to sum to full output token count. Does *not* need to have all keys.
76
77
 
77
78
  Example:
78
-
79
79
  .. code-block:: python
80
80
 
81
81
  {
@@ -94,6 +94,7 @@ class OutputTokenDetails(TypedDict, total=False):
94
94
 
95
95
  Tokens generated by the model in a chain of thought process (i.e. by OpenAI's o1
96
96
  models) that are not returned as part of model output.
97
+
97
98
  """
98
99
 
99
100
 
@@ -103,7 +104,6 @@ class UsageMetadata(TypedDict):
103
104
  This is a standard representation of token usage that is consistent across models.
104
105
 
105
106
  Example:
106
-
107
107
  .. code-block:: python
108
108
 
109
109
  {
@@ -142,6 +142,7 @@ class UsageMetadata(TypedDict):
142
142
  """Breakdown of output token counts.
143
143
 
144
144
  Does *not* need to sum to full output token count. Does *not* need to have all keys.
145
+
145
146
  """
146
147
 
147
148
 
@@ -153,6 +154,7 @@ class AIMessage(BaseMessage):
153
154
  This message represents the output of the model and consists of both
154
155
  the raw output as returned by the model together standardized fields
155
156
  (e.g., tool calls, usage metadata) added by the LangChain framework.
157
+
156
158
  """
157
159
 
158
160
  tool_calls: list[ToolCall] = []
@@ -163,6 +165,7 @@ class AIMessage(BaseMessage):
163
165
  """If provided, usage metadata for a message, such as token counts.
164
166
 
165
167
  This is a standard representation of token usage that is consistent across models.
168
+
166
169
  """
167
170
 
168
171
  type: Literal["ai"] = "ai"
@@ -189,7 +192,15 @@ class AIMessage(BaseMessage):
189
192
  content_blocks: Optional[list[types.ContentBlock]] = None,
190
193
  **kwargs: Any,
191
194
  ) -> None:
192
- """Specify ``content`` as positional arg or ``content_blocks`` for typing."""
195
+ """Initialize ``AIMessage``.
196
+
197
+ Specify ``content`` as positional arg or ``content_blocks`` for typing.
198
+
199
+ Args:
200
+ content: The content of the message.
201
+ content_blocks: Typed standard content.
202
+ kwargs: Additional arguments to pass to the parent class.
203
+ """
193
204
  if content_blocks is not None:
194
205
  # If there are tool calls in content_blocks, but not in tool_calls, add them
195
206
  content_tool_calls = [
@@ -215,7 +226,12 @@ class AIMessage(BaseMessage):
215
226
 
216
227
  @property
217
228
  def content_blocks(self) -> list[types.ContentBlock]:
218
- """Return content blocks of the message."""
229
+ """Return content blocks of the message.
230
+
231
+ If the message has a known model provider, use the provider-specific translator
232
+ first before falling back to best-effort parsing. For details, see the property
233
+ on ``BaseMessage``.
234
+ """
219
235
  if self.response_metadata.get("output_version") == "v1":
220
236
  return cast("list[types.ContentBlock]", self.content)
221
237
 
@@ -256,6 +272,15 @@ class AIMessage(BaseMessage):
256
272
  tool_call_block["extras"] = tool_call["extras"] # type: ignore[typeddict-item]
257
273
  blocks.append(tool_call_block)
258
274
 
275
+ # Best-effort reasoning extraction from additional_kwargs
276
+ # Only add reasoning if not already present
277
+ # Insert before all other blocks to keep reasoning at the start
278
+ has_reasoning = any(block.get("type") == "reasoning" for block in blocks)
279
+ if not has_reasoning and (
280
+ reasoning_block := _extract_reasoning_from_additional_kwargs(self)
281
+ ):
282
+ blocks.insert(0, reasoning_block)
283
+
259
284
  return blocks
260
285
 
261
286
  # TODO: remove this logic if possible, reducing breaking nature of changes
@@ -315,6 +340,7 @@ class AIMessage(BaseMessage):
315
340
 
316
341
  Returns:
317
342
  A pretty representation of the message.
343
+
318
344
  """
319
345
  base = super().pretty_repr(html=html)
320
346
  lines = []
@@ -354,7 +380,10 @@ class AIMessageChunk(AIMessage, BaseMessageChunk):
354
380
  # non-chunk variant.
355
381
  type: Literal["AIMessageChunk"] = "AIMessageChunk" # type: ignore[assignment]
356
382
  """The type of the message (used for deserialization).
357
- Defaults to "AIMessageChunk"."""
383
+
384
+ Defaults to ``AIMessageChunk``.
385
+
386
+ """
358
387
 
359
388
  tool_call_chunks: list[ToolCallChunk] = []
360
389
  """If provided, tool call chunks associated with the message."""
@@ -417,6 +446,15 @@ class AIMessageChunk(AIMessage, BaseMessageChunk):
417
446
  tc["index"] = idx
418
447
  blocks.append(tc)
419
448
 
449
+ # Best-effort reasoning extraction from additional_kwargs
450
+ # Only add reasoning if not already present
451
+ # Insert before all other blocks to keep reasoning at the start
452
+ has_reasoning = any(block.get("type") == "reasoning" for block in blocks)
453
+ if not has_reasoning and (
454
+ reasoning_block := _extract_reasoning_from_additional_kwargs(self)
455
+ ):
456
+ blocks.insert(0, reasoning_block)
457
+
420
458
  return blocks
421
459
 
422
460
  @model_validator(mode="after")
@@ -424,7 +462,10 @@ class AIMessageChunk(AIMessage, BaseMessageChunk):
424
462
  """Initialize tool calls from tool call chunks.
425
463
 
426
464
  Returns:
427
- This ``AIMessageChunk``.
465
+ The values with tool calls initialized.
466
+
467
+ Raises:
468
+ ValueError: If the tool call chunks are malformed.
428
469
  """
429
470
  if not self.tool_call_chunks:
430
471
  if self.tool_calls:
@@ -508,6 +549,31 @@ class AIMessageChunk(AIMessage, BaseMessageChunk):
508
549
 
509
550
  return self
510
551
 
552
+ @model_validator(mode="after")
553
+ def init_server_tool_calls(self) -> Self:
554
+ """Parse server_tool_call_chunks."""
555
+ if (
556
+ self.chunk_position == "last"
557
+ and self.response_metadata.get("output_version") == "v1"
558
+ and isinstance(self.content, list)
559
+ ):
560
+ for idx, block in enumerate(self.content):
561
+ if (
562
+ isinstance(block, dict)
563
+ and block.get("type")
564
+ in ("server_tool_call", "server_tool_call_chunk")
565
+ and (args_str := block.get("args"))
566
+ and isinstance(args_str, str)
567
+ ):
568
+ try:
569
+ args = json.loads(args_str)
570
+ if isinstance(args, dict):
571
+ self.content[idx]["type"] = "server_tool_call" # type: ignore[index]
572
+ self.content[idx]["args"] = args # type: ignore[index]
573
+ except json.JSONDecodeError:
574
+ pass
575
+ return self
576
+
511
577
  @overload # type: ignore[override] # summing BaseMessages gives ChatPromptTemplate
512
578
  def __add__(self, other: "AIMessageChunk") -> "AIMessageChunk": ...
513
579
 
@@ -677,9 +743,9 @@ def add_usage(
677
743
  def subtract_usage(
678
744
  left: Optional[UsageMetadata], right: Optional[UsageMetadata]
679
745
  ) -> UsageMetadata:
680
- """Recursively subtract two UsageMetadata objects.
746
+ """Recursively subtract two ``UsageMetadata`` objects.
681
747
 
682
- Token counts cannot be negative so the actual operation is max(left - right, 0).
748
+ Token counts cannot be negative so the actual operation is ``max(left - right, 0)``.
683
749
 
684
750
  Example:
685
751
  .. code-block:: python