langchain 1.0.0a10__py3-none-any.whl → 1.0.0a12__py3-none-any.whl

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 (35) hide show
  1. langchain/__init__.py +1 -24
  2. langchain/_internal/_documents.py +1 -1
  3. langchain/_internal/_prompts.py +2 -2
  4. langchain/_internal/_typing.py +1 -1
  5. langchain/agents/__init__.py +2 -3
  6. langchain/agents/factory.py +1126 -0
  7. langchain/agents/middleware/__init__.py +38 -1
  8. langchain/agents/middleware/context_editing.py +245 -0
  9. langchain/agents/middleware/human_in_the_loop.py +61 -12
  10. langchain/agents/middleware/model_call_limit.py +177 -0
  11. langchain/agents/middleware/model_fallback.py +94 -0
  12. langchain/agents/middleware/pii.py +753 -0
  13. langchain/agents/middleware/planning.py +201 -0
  14. langchain/agents/middleware/prompt_caching.py +7 -4
  15. langchain/agents/middleware/summarization.py +2 -1
  16. langchain/agents/middleware/tool_call_limit.py +260 -0
  17. langchain/agents/middleware/tool_selection.py +306 -0
  18. langchain/agents/middleware/types.py +708 -127
  19. langchain/agents/structured_output.py +15 -1
  20. langchain/chat_models/base.py +22 -25
  21. langchain/embeddings/base.py +3 -4
  22. langchain/embeddings/cache.py +0 -1
  23. langchain/messages/__init__.py +29 -0
  24. langchain/rate_limiters/__init__.py +13 -0
  25. langchain/tools/tool_node.py +1 -1
  26. {langchain-1.0.0a10.dist-info → langchain-1.0.0a12.dist-info}/METADATA +29 -35
  27. langchain-1.0.0a12.dist-info/RECORD +43 -0
  28. {langchain-1.0.0a10.dist-info → langchain-1.0.0a12.dist-info}/WHEEL +1 -1
  29. langchain/agents/middleware_agent.py +0 -622
  30. langchain/agents/react_agent.py +0 -1229
  31. langchain/globals.py +0 -18
  32. langchain/text_splitter.py +0 -50
  33. langchain-1.0.0a10.dist-info/RECORD +0 -38
  34. langchain-1.0.0a10.dist-info/entry_points.txt +0 -4
  35. {langchain-1.0.0a10.dist-info → langchain-1.0.0a12.dist-info}/licenses/LICENSE +0 -0
langchain/__init__.py CHANGED
@@ -1,26 +1,3 @@
1
1
  """Main entrypoint into LangChain."""
2
2
 
3
- from typing import Any
4
-
5
- __version__ = "1.0.0a10"
6
-
7
-
8
- def __getattr__(name: str) -> Any: # noqa: ANN401
9
- """Get an attribute from the package.
10
-
11
- TODO: will be removed in a future alpha version.
12
- """
13
- if name == "verbose":
14
- from langchain.globals import _verbose
15
-
16
- return _verbose
17
- if name == "debug":
18
- from langchain.globals import _debug
19
-
20
- return _debug
21
- if name == "llm_cache":
22
- from langchain.globals import _llm_cache
23
-
24
- return _llm_cache
25
- msg = f"Could not find: {name}"
26
- raise AttributeError(msg)
3
+ __version__ = "1.0.0a12"
@@ -22,7 +22,7 @@ def format_document_xml(doc: Document) -> str:
22
22
  <metadata>...</metadata>
23
23
  </document>
24
24
 
25
- .. note::
25
+ !!! note
26
26
  Does not generate valid XML or escape special characters. Intended for
27
27
  semi-structured LLM input only.
28
28
 
@@ -63,7 +63,7 @@ def resolve_prompt(
63
63
  messages = resolve_prompt(None, state, runtime, "content", "Default")
64
64
  ```
65
65
 
66
- .. note::
66
+ !!! note
67
67
  Callable prompts have full control over message structure and content parameter
68
68
  is ignored. String/None prompts create standard system + user structure.
69
69
 
@@ -133,7 +133,7 @@ async def aresolve_prompt(
133
133
  messages = await aresolve_prompt("Custom", state, runtime, "content", "default")
134
134
  ```
135
135
 
136
- .. note::
136
+ !!! note
137
137
  Callable prompts have full control over message structure and content parameter
138
138
  is ignored. Automatically detects and handles async callables.
139
139
 
@@ -49,7 +49,7 @@ StateLike: TypeAlias = TypedDictLikeV1 | TypedDictLikeV2 | DataclassLike | BaseM
49
49
 
50
50
  It can either be a ``TypedDict``, ``dataclass``, or Pydantic ``BaseModel``.
51
51
 
52
- .. note::
52
+ !!! note
53
53
  We cannot use either ``TypedDict`` or ``dataclass`` directly due to limitations in
54
54
  type checking.
55
55
 
@@ -1,10 +1,9 @@
1
1
  """langgraph.prebuilt exposes a higher-level API for creating and executing agents and tools."""
2
2
 
3
- from langchain.agents.react_agent import AgentState, create_agent
4
- from langchain.tools import ToolNode
3
+ from langchain.agents.factory import create_agent
4
+ from langchain.agents.middleware.types import AgentState
5
5
 
6
6
  __all__ = [
7
7
  "AgentState",
8
- "ToolNode",
9
8
  "create_agent",
10
9
  ]