langchain 1.0.0a12__py3-none-any.whl → 1.0.0a13__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.
Potentially problematic release.
This version of langchain might be problematic. Click here for more details.
- langchain/__init__.py +1 -1
- langchain/agents/factory.py +498 -167
- langchain/agents/middleware/__init__.py +9 -3
- langchain/agents/middleware/context_editing.py +15 -14
- langchain/agents/middleware/human_in_the_loop.py +213 -170
- langchain/agents/middleware/model_call_limit.py +2 -2
- langchain/agents/middleware/model_fallback.py +46 -36
- langchain/agents/middleware/pii.py +19 -19
- langchain/agents/middleware/planning.py +16 -11
- langchain/agents/middleware/prompt_caching.py +14 -11
- langchain/agents/middleware/summarization.py +1 -1
- langchain/agents/middleware/tool_call_limit.py +5 -5
- langchain/agents/middleware/tool_emulator.py +200 -0
- langchain/agents/middleware/tool_selection.py +25 -21
- langchain/agents/middleware/types.py +484 -225
- langchain/chat_models/base.py +85 -90
- langchain/embeddings/base.py +20 -20
- langchain/embeddings/cache.py +21 -21
- langchain/messages/__init__.py +2 -0
- langchain/storage/encoder_backed.py +22 -23
- langchain/tools/tool_node.py +388 -80
- {langchain-1.0.0a12.dist-info → langchain-1.0.0a13.dist-info}/METADATA +8 -5
- langchain-1.0.0a13.dist-info/RECORD +36 -0
- langchain/_internal/__init__.py +0 -0
- langchain/_internal/_documents.py +0 -35
- langchain/_internal/_lazy_import.py +0 -35
- langchain/_internal/_prompts.py +0 -158
- langchain/_internal/_typing.py +0 -70
- langchain/_internal/_utils.py +0 -7
- langchain/agents/_internal/__init__.py +0 -1
- langchain/agents/_internal/_typing.py +0 -13
- langchain-1.0.0a12.dist-info/RECORD +0 -43
- {langchain-1.0.0a12.dist-info → langchain-1.0.0a13.dist-info}/WHEEL +0 -0
- {langchain-1.0.0a12.dist-info → langchain-1.0.0a13.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langchain
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.0a13
|
|
4
4
|
Summary: Building applications with LLMs through composability
|
|
5
|
-
Project-URL:
|
|
6
|
-
Project-URL:
|
|
7
|
-
Project-URL:
|
|
5
|
+
Project-URL: homepage, https://docs.langchain.com/
|
|
6
|
+
Project-URL: repository, https://github.com/langchain-ai/langchain/tree/master/libs/langchain
|
|
7
|
+
Project-URL: changelog, https://github.com/langchain-ai/langchain/releases?q=tag%3A%22langchain%3D%3D1%22
|
|
8
|
+
Project-URL: twitter, https://x.com/LangChainAI
|
|
9
|
+
Project-URL: slack, https://www.langchain.com/join-community
|
|
10
|
+
Project-URL: reddit, https://www.reddit.com/r/LangChain/
|
|
8
11
|
License: MIT
|
|
9
12
|
License-File: LICENSE
|
|
10
13
|
Requires-Python: <4.0.0,>=3.10.0
|
|
11
|
-
Requires-Dist: langchain-core<2.0.0,>=1.0.
|
|
14
|
+
Requires-Dist: langchain-core<2.0.0,>=1.0.0a7
|
|
12
15
|
Requires-Dist: langgraph<2.0.0,>=1.0.0a4
|
|
13
16
|
Requires-Dist: pydantic<3.0.0,>=2.7.4
|
|
14
17
|
Provides-Extra: anthropic
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
langchain/__init__.py,sha256=rED92FbyWFRmks07cFlRTuz5ZtaPKxYq6BcsxW5KhrE,64
|
|
2
|
+
langchain/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
langchain/agents/__init__.py,sha256=x85V7MqddVSrraoirGHplPMzEz9Lha-vL9fKjXCS7lA,258
|
|
4
|
+
langchain/agents/factory.py,sha256=WcuuMvL0g3QbzL--weJC8SFDabEaCuXOdF_tLA6DwAw,57539
|
|
5
|
+
langchain/agents/structured_output.py,sha256=msf-ClqDnMfJ-oGHqjwEyth860tMnx58GLTvqJijqg8,13686
|
|
6
|
+
langchain/agents/middleware/__init__.py,sha256=FDwjEGYtxPgyFa9iiLAWT5M2W8c-NDYfGz6_y8cEqPI,1568
|
|
7
|
+
langchain/agents/middleware/context_editing.py,sha256=6ca6Qed-F59JD1rAlrIuxlrBbDVIKQmCpfvZaIFbBy8,7691
|
|
8
|
+
langchain/agents/middleware/human_in_the_loop.py,sha256=Bs4_Hgjuy9l0-AMUHvU9wlr_rL2Z1rUwL_VcfFLhhUM,12666
|
|
9
|
+
langchain/agents/middleware/model_call_limit.py,sha256=H3lJL2cLv3u0uF0kJsRagFt1rBmHHgn5SFsfnmcyQdA,6703
|
|
10
|
+
langchain/agents/middleware/model_fallback.py,sha256=pdKRSO9JD6MdMYHFl7IK4yj6LEwQfyzfTJiBE8uJ2pE,3118
|
|
11
|
+
langchain/agents/middleware/pii.py,sha256=6KOrK152nbV8ag68459JspXCCmM35N2LJ0PrDW5GLhU,24830
|
|
12
|
+
langchain/agents/middleware/planning.py,sha256=59Q6-4aALytjssIZ5a4hZkx5THxIG-RTeUHuDP1LGDA,9319
|
|
13
|
+
langchain/agents/middleware/prompt_caching.py,sha256=cMvIJ_dpSsn4_cqCvZBBKjtw5GpcVkc8Lgf_VEPzM1w,3225
|
|
14
|
+
langchain/agents/middleware/summarization.py,sha256=H1VxRkkbauw4p4sMMKyc_uZGbJhtqoVvOF7y_5JBXTc,10329
|
|
15
|
+
langchain/agents/middleware/tool_call_limit.py,sha256=6cWviwPRzaf7UUcp9zlXwk6RJBBoWVaVSBc1NaVT2fI,9729
|
|
16
|
+
langchain/agents/middleware/tool_emulator.py,sha256=5qJFPfTSiVukNclDeUo7_c7-PjGEVWyefbPC-zpYSlI,7115
|
|
17
|
+
langchain/agents/middleware/tool_selection.py,sha256=6RYdgkg6aSNx1w-YxRyL2Hct7UPnMRgGg6YVZVtW5TU,11638
|
|
18
|
+
langchain/agents/middleware/types.py,sha256=_dTVkDSXDhtuvfBOqO74WSFVTdIMAfuIC-gWu2_vh8w,47064
|
|
19
|
+
langchain/chat_models/__init__.py,sha256=PTq9qskQEbqXYAcUUxUXDsugOcwISgFhv4w40JgkbgU,181
|
|
20
|
+
langchain/chat_models/base.py,sha256=HPlD0QaLOGXRJAY1Qq6ojr1WcteBlgVO--_GoSqpxXE,34560
|
|
21
|
+
langchain/documents/__init__.py,sha256=DjuBCy1TQbem4Vz8SsCcGAbZeFwW5KgGPvDrA8e9oGA,94
|
|
22
|
+
langchain/embeddings/__init__.py,sha256=sJZEfZ4ovEFU5JJnoVNCJIjtSCLT1w9r9uFw1hieRZ8,269
|
|
23
|
+
langchain/embeddings/base.py,sha256=o77Z1TrXoUZN1SdYY9nZCNehm7cZzC-TNqc5NIzWtww,7327
|
|
24
|
+
langchain/embeddings/cache.py,sha256=znf9DBhrmSpqb64ugwqEqQQaU-7X62HYWxSL9L1fn8g,14267
|
|
25
|
+
langchain/messages/__init__.py,sha256=rXBO7H-OOL1uknFjNdaRi8p1ryRVMMGdJLjSY8y1iGY,557
|
|
26
|
+
langchain/rate_limiters/__init__.py,sha256=5490xUNhet37N2nX6kbJlDgf8u1DX-C1Cs_r7etXn8A,351
|
|
27
|
+
langchain/storage/__init__.py,sha256=cvxc63N2nluqyVc7d9MeAj5mmO2iYl3GhcxMCpmqjUk,533
|
|
28
|
+
langchain/storage/encoder_backed.py,sha256=z3CS_4kxt7IFv2q8TEfSjMr_EeBp25cloVBINu2KCpE,4179
|
|
29
|
+
langchain/storage/exceptions.py,sha256=Fl_8tON3KmByBKwXtno5WSj0-c2RiZxnhw3gv5aS2T8,114
|
|
30
|
+
langchain/storage/in_memory.py,sha256=ozrmu0EtaJJVSAzK_u7nzxWpr9OOscWkANHSg-qIVYQ,369
|
|
31
|
+
langchain/tools/__init__.py,sha256=tWlUqT7jrnf1ouhMctuUkaYBWEuOPD3JQX4Y8uTHk5w,405
|
|
32
|
+
langchain/tools/tool_node.py,sha256=ICsI7x0zkT3nJOCK3TGAEYgho9b8U_lAUsffbdB18Kc,57048
|
|
33
|
+
langchain-1.0.0a13.dist-info/METADATA,sha256=usSvQLeqH64jSkqTl15cqX4RGhj5q3sQpcQeP0uir6E,6118
|
|
34
|
+
langchain-1.0.0a13.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
35
|
+
langchain-1.0.0a13.dist-info/licenses/LICENSE,sha256=TsZ-TKbmch26hJssqCJhWXyGph7iFLvyFBYAa3stBHg,1067
|
|
36
|
+
langchain-1.0.0a13.dist-info/RECORD,,
|
langchain/_internal/__init__.py
DELETED
|
File without changes
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"""Internal document utilities."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from typing import TYPE_CHECKING
|
|
6
|
-
|
|
7
|
-
if TYPE_CHECKING:
|
|
8
|
-
from langchain_core.documents import Document
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def format_document_xml(doc: Document) -> str:
|
|
12
|
-
"""Format a document as XML-like structure for LLM consumption.
|
|
13
|
-
|
|
14
|
-
Args:
|
|
15
|
-
doc: Document to format
|
|
16
|
-
|
|
17
|
-
Returns:
|
|
18
|
-
Document wrapped in XML tags:
|
|
19
|
-
<document>
|
|
20
|
-
<id>...</id>
|
|
21
|
-
<content>...</content>
|
|
22
|
-
<metadata>...</metadata>
|
|
23
|
-
</document>
|
|
24
|
-
|
|
25
|
-
!!! note
|
|
26
|
-
Does not generate valid XML or escape special characters. Intended for
|
|
27
|
-
semi-structured LLM input only.
|
|
28
|
-
|
|
29
|
-
"""
|
|
30
|
-
id_str = f"<id>{doc.id}</id>" if doc.id is not None else "<id></id>"
|
|
31
|
-
metadata_str = ""
|
|
32
|
-
if doc.metadata:
|
|
33
|
-
metadata_items = [f"{k}: {v!s}" for k, v in doc.metadata.items()]
|
|
34
|
-
metadata_str = f"<metadata>{', '.join(metadata_items)}</metadata>"
|
|
35
|
-
return f"<document>{id_str}<content>{doc.page_content}</content>{metadata_str}</document>"
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"""Lazy import utilities."""
|
|
2
|
-
|
|
3
|
-
from importlib import import_module
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
def import_attr(
|
|
7
|
-
attr_name: str,
|
|
8
|
-
module_name: str | None,
|
|
9
|
-
package: str | None,
|
|
10
|
-
) -> object:
|
|
11
|
-
"""Import an attribute from a module located in a package.
|
|
12
|
-
|
|
13
|
-
This utility function is used in custom __getattr__ methods within __init__.py
|
|
14
|
-
files to dynamically import attributes.
|
|
15
|
-
|
|
16
|
-
Args:
|
|
17
|
-
attr_name: The name of the attribute to import.
|
|
18
|
-
module_name: The name of the module to import from. If None, the attribute
|
|
19
|
-
is imported from the package itself.
|
|
20
|
-
package: The name of the package where the module is located.
|
|
21
|
-
"""
|
|
22
|
-
if module_name == "__module__" or module_name is None:
|
|
23
|
-
try:
|
|
24
|
-
result = import_module(f".{attr_name}", package=package)
|
|
25
|
-
except ModuleNotFoundError:
|
|
26
|
-
msg = f"module '{package!r}' has no attribute {attr_name!r}"
|
|
27
|
-
raise AttributeError(msg) from None
|
|
28
|
-
else:
|
|
29
|
-
try:
|
|
30
|
-
module = import_module(f".{module_name}", package=package)
|
|
31
|
-
except ModuleNotFoundError as err:
|
|
32
|
-
msg = f"module '{package!r}.{module_name!r}' not found ({err})"
|
|
33
|
-
raise ImportError(msg) from None
|
|
34
|
-
result = getattr(module, attr_name)
|
|
35
|
-
return result
|
langchain/_internal/_prompts.py
DELETED
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
"""Internal prompt resolution utilities.
|
|
2
|
-
|
|
3
|
-
This module provides utilities for resolving different types of prompt specifications
|
|
4
|
-
into standardized message formats for language models. It supports both synchronous
|
|
5
|
-
and asynchronous prompt resolution with automatic detection of callable types.
|
|
6
|
-
|
|
7
|
-
The module is designed to handle common prompt patterns across LangChain components,
|
|
8
|
-
particularly for summarization chains and other document processing workflows.
|
|
9
|
-
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
from __future__ import annotations
|
|
13
|
-
|
|
14
|
-
import inspect
|
|
15
|
-
from typing import TYPE_CHECKING
|
|
16
|
-
|
|
17
|
-
if TYPE_CHECKING:
|
|
18
|
-
from collections.abc import Awaitable, Callable
|
|
19
|
-
|
|
20
|
-
from langchain_core.messages import MessageLikeRepresentation
|
|
21
|
-
from langgraph.runtime import Runtime
|
|
22
|
-
|
|
23
|
-
from langchain._internal._typing import ContextT, StateT
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
def resolve_prompt(
|
|
27
|
-
prompt: str | None | Callable[[StateT, Runtime[ContextT]], list[MessageLikeRepresentation]],
|
|
28
|
-
state: StateT,
|
|
29
|
-
runtime: Runtime[ContextT],
|
|
30
|
-
default_user_content: str,
|
|
31
|
-
default_system_content: str,
|
|
32
|
-
) -> list[MessageLikeRepresentation]:
|
|
33
|
-
"""Resolve a prompt specification into a list of messages.
|
|
34
|
-
|
|
35
|
-
Handles prompt resolution across different strategies. Supports callable functions,
|
|
36
|
-
string system messages, and None for default behavior.
|
|
37
|
-
|
|
38
|
-
Args:
|
|
39
|
-
prompt: The prompt specification to resolve. Can be:
|
|
40
|
-
- Callable: Function taking (state, runtime) returning message list.
|
|
41
|
-
- str: A system message string.
|
|
42
|
-
- None: Use the provided default system message.
|
|
43
|
-
state: Current state, passed to callable prompts.
|
|
44
|
-
runtime: LangGraph runtime instance, passed to callable prompts.
|
|
45
|
-
default_user_content: User content to include (e.g., document text).
|
|
46
|
-
default_system_content: Default system message when prompt is None.
|
|
47
|
-
|
|
48
|
-
Returns:
|
|
49
|
-
List of message dictionaries for language models, typically containing
|
|
50
|
-
a system message and user message with content.
|
|
51
|
-
|
|
52
|
-
Raises:
|
|
53
|
-
TypeError: If prompt type is not str, None, or callable.
|
|
54
|
-
|
|
55
|
-
Example:
|
|
56
|
-
```python
|
|
57
|
-
def custom_prompt(state, runtime):
|
|
58
|
-
return [{"role": "system", "content": "Custom"}]
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
messages = resolve_prompt(custom_prompt, state, runtime, "content", "default")
|
|
62
|
-
messages = resolve_prompt("Custom system", state, runtime, "content", "default")
|
|
63
|
-
messages = resolve_prompt(None, state, runtime, "content", "Default")
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
!!! note
|
|
67
|
-
Callable prompts have full control over message structure and content parameter
|
|
68
|
-
is ignored. String/None prompts create standard system + user structure.
|
|
69
|
-
|
|
70
|
-
"""
|
|
71
|
-
if callable(prompt):
|
|
72
|
-
return prompt(state, runtime)
|
|
73
|
-
if isinstance(prompt, str):
|
|
74
|
-
system_msg = prompt
|
|
75
|
-
elif prompt is None:
|
|
76
|
-
system_msg = default_system_content
|
|
77
|
-
else:
|
|
78
|
-
msg = f"Invalid prompt type: {type(prompt)}. Expected str, None, or callable."
|
|
79
|
-
raise TypeError(msg)
|
|
80
|
-
|
|
81
|
-
return [
|
|
82
|
-
{"role": "system", "content": system_msg},
|
|
83
|
-
{"role": "user", "content": default_user_content},
|
|
84
|
-
]
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
async def aresolve_prompt(
|
|
88
|
-
prompt: str
|
|
89
|
-
| None
|
|
90
|
-
| Callable[[StateT, Runtime[ContextT]], list[MessageLikeRepresentation]]
|
|
91
|
-
| Callable[[StateT, Runtime[ContextT]], Awaitable[list[MessageLikeRepresentation]]],
|
|
92
|
-
state: StateT,
|
|
93
|
-
runtime: Runtime[ContextT],
|
|
94
|
-
default_user_content: str,
|
|
95
|
-
default_system_content: str,
|
|
96
|
-
) -> list[MessageLikeRepresentation]:
|
|
97
|
-
"""Async version of resolve_prompt supporting both sync and async callables.
|
|
98
|
-
|
|
99
|
-
Handles prompt resolution across different strategies. Supports sync/async callable
|
|
100
|
-
functions, string system messages, and None for default behavior.
|
|
101
|
-
|
|
102
|
-
Args:
|
|
103
|
-
prompt: The prompt specification to resolve. Can be:
|
|
104
|
-
- Callable (sync): Function taking (state, runtime) returning message list.
|
|
105
|
-
- Callable (async): Async function taking (state, runtime) returning
|
|
106
|
-
awaitable message list.
|
|
107
|
-
- str: A system message string.
|
|
108
|
-
- None: Use the provided default system message.
|
|
109
|
-
state: Current state, passed to callable prompts.
|
|
110
|
-
runtime: LangGraph runtime instance, passed to callable prompts.
|
|
111
|
-
default_user_content: User content to include (e.g., document text).
|
|
112
|
-
default_system_content: Default system message when prompt is None.
|
|
113
|
-
|
|
114
|
-
Returns:
|
|
115
|
-
List of message dictionaries for language models, typically containing
|
|
116
|
-
a system message and user message with content.
|
|
117
|
-
|
|
118
|
-
Raises:
|
|
119
|
-
TypeError: If prompt type is not str, None, or callable.
|
|
120
|
-
|
|
121
|
-
Example:
|
|
122
|
-
```python
|
|
123
|
-
async def async_prompt(state, runtime):
|
|
124
|
-
return [{"role": "system", "content": "Async"}]
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
def sync_prompt(state, runtime):
|
|
128
|
-
return [{"role": "system", "content": "Sync"}]
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
messages = await aresolve_prompt(async_prompt, state, runtime, "content", "default")
|
|
132
|
-
messages = await aresolve_prompt(sync_prompt, state, runtime, "content", "default")
|
|
133
|
-
messages = await aresolve_prompt("Custom", state, runtime, "content", "default")
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
!!! note
|
|
137
|
-
Callable prompts have full control over message structure and content parameter
|
|
138
|
-
is ignored. Automatically detects and handles async callables.
|
|
139
|
-
|
|
140
|
-
"""
|
|
141
|
-
if callable(prompt):
|
|
142
|
-
result = prompt(state, runtime)
|
|
143
|
-
# Check if the result is awaitable (async function)
|
|
144
|
-
if inspect.isawaitable(result):
|
|
145
|
-
return await result
|
|
146
|
-
return result
|
|
147
|
-
if isinstance(prompt, str):
|
|
148
|
-
system_msg = prompt
|
|
149
|
-
elif prompt is None:
|
|
150
|
-
system_msg = default_system_content
|
|
151
|
-
else:
|
|
152
|
-
msg = f"Invalid prompt type: {type(prompt)}. Expected str, None, or callable."
|
|
153
|
-
raise TypeError(msg)
|
|
154
|
-
|
|
155
|
-
return [
|
|
156
|
-
{"role": "system", "content": system_msg},
|
|
157
|
-
{"role": "user", "content": default_user_content},
|
|
158
|
-
]
|
langchain/_internal/_typing.py
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"""Private typing utilities for langchain."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from typing import TYPE_CHECKING, Any, ClassVar, Protocol, TypeAlias, TypeVar
|
|
6
|
-
|
|
7
|
-
from langgraph.graph._node import StateNode
|
|
8
|
-
from pydantic import BaseModel
|
|
9
|
-
|
|
10
|
-
if TYPE_CHECKING:
|
|
11
|
-
from dataclasses import Field
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class TypedDictLikeV1(Protocol):
|
|
15
|
-
"""Protocol to represent types that behave like ``TypedDict``s.
|
|
16
|
-
|
|
17
|
-
Version 1: using ``ClassVar`` for keys.
|
|
18
|
-
|
|
19
|
-
"""
|
|
20
|
-
|
|
21
|
-
__required_keys__: ClassVar[frozenset[str]]
|
|
22
|
-
__optional_keys__: ClassVar[frozenset[str]]
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
class TypedDictLikeV2(Protocol):
|
|
26
|
-
"""Protocol to represent types that behave like ``TypedDict``s.
|
|
27
|
-
|
|
28
|
-
Version 2: not using ``ClassVar`` for keys.
|
|
29
|
-
|
|
30
|
-
"""
|
|
31
|
-
|
|
32
|
-
__required_keys__: frozenset[str]
|
|
33
|
-
__optional_keys__: frozenset[str]
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
class DataclassLike(Protocol):
|
|
37
|
-
"""Protocol to represent types that behave like dataclasses.
|
|
38
|
-
|
|
39
|
-
Inspired by the private ``_DataclassT`` from dataclasses that uses a similar
|
|
40
|
-
protocol as a bound.
|
|
41
|
-
|
|
42
|
-
"""
|
|
43
|
-
|
|
44
|
-
__dataclass_fields__: ClassVar[dict[str, Field[Any]]]
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
StateLike: TypeAlias = TypedDictLikeV1 | TypedDictLikeV2 | DataclassLike | BaseModel
|
|
48
|
-
"""Type alias for state-like types.
|
|
49
|
-
|
|
50
|
-
It can either be a ``TypedDict``, ``dataclass``, or Pydantic ``BaseModel``.
|
|
51
|
-
|
|
52
|
-
!!! note
|
|
53
|
-
We cannot use either ``TypedDict`` or ``dataclass`` directly due to limitations in
|
|
54
|
-
type checking.
|
|
55
|
-
|
|
56
|
-
"""
|
|
57
|
-
|
|
58
|
-
StateT = TypeVar("StateT", bound=StateLike)
|
|
59
|
-
"""Type variable used to represent the state in a graph."""
|
|
60
|
-
|
|
61
|
-
ContextT = TypeVar("ContextT", bound=StateLike | None)
|
|
62
|
-
"""Type variable for context types."""
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
__all__ = [
|
|
66
|
-
"ContextT",
|
|
67
|
-
"StateLike",
|
|
68
|
-
"StateNode",
|
|
69
|
-
"StateT",
|
|
70
|
-
]
|
langchain/_internal/_utils.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"""Internal utilities for agents."""
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"""Typing utilities for agents."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
|
|
5
|
-
from collections.abc import Awaitable, Callable
|
|
6
|
-
from typing import TypeVar
|
|
7
|
-
|
|
8
|
-
from typing_extensions import ParamSpec
|
|
9
|
-
|
|
10
|
-
P = ParamSpec("P")
|
|
11
|
-
R = TypeVar("R")
|
|
12
|
-
|
|
13
|
-
SyncOrAsync = Callable[P, R | Awaitable[R]]
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
langchain/__init__.py,sha256=r-dYWvMexpt3NwZEBukjX-wFF7i2fNMhSOW4Lry-rnQ,64
|
|
2
|
-
langchain/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
langchain/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
langchain/_internal/_documents.py,sha256=uQcKc1cslujQzmP1yiyN6Z371BsOkkrZ4bVidsVvgs0,1044
|
|
5
|
-
langchain/_internal/_lazy_import.py,sha256=S_iSAxGvW7lVcUQYgi45KG8XhWZzkORsZ_olPMZPlqU,1258
|
|
6
|
-
langchain/_internal/_prompts.py,sha256=Ldu09Vj04yO9IHssbYps19sw_7uYOm_biXTF8hN6I9M,5910
|
|
7
|
-
langchain/_internal/_typing.py,sha256=T3Nl8oi_SSZ1YMIxNwZm_6TJsiRAiYYAm-dSznGog84,1656
|
|
8
|
-
langchain/_internal/_utils.py,sha256=lG8X9muiRAWtQjRPudq-1x-wHbk0J3spu_rYZckVdYs,251
|
|
9
|
-
langchain/agents/__init__.py,sha256=x85V7MqddVSrraoirGHplPMzEz9Lha-vL9fKjXCS7lA,258
|
|
10
|
-
langchain/agents/factory.py,sha256=n7TFqCy3iqxFnAcHeFaPKd-RPOCw10q3CmkfC_JJnBA,46906
|
|
11
|
-
langchain/agents/structured_output.py,sha256=msf-ClqDnMfJ-oGHqjwEyth860tMnx58GLTvqJijqg8,13686
|
|
12
|
-
langchain/agents/_internal/__init__.py,sha256=5nNBeaeQIvv9IOQjY4_aNW8pffWzMXQgi0b6Nx-WghM,37
|
|
13
|
-
langchain/agents/_internal/_typing.py,sha256=JoWa-KL5uLNeq6yrm56wnIvhDeFnCt2fTzgUcj5zWy4,270
|
|
14
|
-
langchain/agents/middleware/__init__.py,sha256=noyjY-BLoLD7Qw7exk6IikqgKadrvOUr9T_839fOIgs,1455
|
|
15
|
-
langchain/agents/middleware/context_editing.py,sha256=VjInHbeSpkmwlwjN2x2xL9CQu11KodpEDGNo3xHrChw,7752
|
|
16
|
-
langchain/agents/middleware/human_in_the_loop.py,sha256=nsEvBQzJZdtmeOXzqc7VZ_3OAh9DvIdGm9KQIrxhWfo,12004
|
|
17
|
-
langchain/agents/middleware/model_call_limit.py,sha256=Dm_cHeH1Kkci8XdCb44Vtlaft2f1oH7DU2MexZXm4ew,6699
|
|
18
|
-
langchain/agents/middleware/model_fallback.py,sha256=Zc0ZSwwoH9tRBBC-V2Zicjc157yD1eDXybzzLCHq6D4,3390
|
|
19
|
-
langchain/agents/middleware/pii.py,sha256=7uh7Zkr_hjrX2xn9SW1B-Pb3eJQKHHAXK828y0rF9zw,24871
|
|
20
|
-
langchain/agents/middleware/planning.py,sha256=UF4YCSC4rWOuXidmZ7GyH_aKmiN0M7_GL7J0YTqPmf8,9287
|
|
21
|
-
langchain/agents/middleware/prompt_caching.py,sha256=QRIH-2GH2fTJW_slLDCTUJA5pL-prQa9Qil4XZq1YaI,3191
|
|
22
|
-
langchain/agents/middleware/summarization.py,sha256=-Jwr6QD0TKCZbnqzQ5CmgKAI-3eEtm615Trw5lq5E7k,10327
|
|
23
|
-
langchain/agents/middleware/tool_call_limit.py,sha256=M9sa5Fpmf9t-n-cxtdJjFWSBh3FiyypeI09cXDAn2u0,9719
|
|
24
|
-
langchain/agents/middleware/tool_selection.py,sha256=leuQlO7C7pVXWzwLpkKqynPUeICnbCHsdkx9m2Jx4cM,11534
|
|
25
|
-
langchain/agents/middleware/types.py,sha256=SnzoZoAg0z6ZFkDuSCnnoFFcE7nBrU7khLnHSeZGpcs,39042
|
|
26
|
-
langchain/chat_models/__init__.py,sha256=PTq9qskQEbqXYAcUUxUXDsugOcwISgFhv4w40JgkbgU,181
|
|
27
|
-
langchain/chat_models/base.py,sha256=sUXo0oSPupVBIOhHIGoKs-XG3-30u2I213S3_4XDzoQ,34917
|
|
28
|
-
langchain/documents/__init__.py,sha256=DjuBCy1TQbem4Vz8SsCcGAbZeFwW5KgGPvDrA8e9oGA,94
|
|
29
|
-
langchain/embeddings/__init__.py,sha256=sJZEfZ4ovEFU5JJnoVNCJIjtSCLT1w9r9uFw1hieRZ8,269
|
|
30
|
-
langchain/embeddings/base.py,sha256=AM75UjkcYU0gJ6-Xtgf67QBq5fA3k_sz0kVaxiQjR7M,7386
|
|
31
|
-
langchain/embeddings/cache.py,sha256=vHuwhHkzeQMDF6F_rcGk3RolMde7TVyd-ladeFiC-TM,14334
|
|
32
|
-
langchain/messages/__init__.py,sha256=5WgGeiPVK9YIFjx-5m4hVxvg_eo7SC7NqUlwJci18W0,517
|
|
33
|
-
langchain/rate_limiters/__init__.py,sha256=5490xUNhet37N2nX6kbJlDgf8u1DX-C1Cs_r7etXn8A,351
|
|
34
|
-
langchain/storage/__init__.py,sha256=cvxc63N2nluqyVc7d9MeAj5mmO2iYl3GhcxMCpmqjUk,533
|
|
35
|
-
langchain/storage/encoder_backed.py,sha256=4h_4ZgP_B9p1lwVMNdBgpEIC7UDAp--ncp9wm4exmF0,4266
|
|
36
|
-
langchain/storage/exceptions.py,sha256=Fl_8tON3KmByBKwXtno5WSj0-c2RiZxnhw3gv5aS2T8,114
|
|
37
|
-
langchain/storage/in_memory.py,sha256=ozrmu0EtaJJVSAzK_u7nzxWpr9OOscWkANHSg-qIVYQ,369
|
|
38
|
-
langchain/tools/__init__.py,sha256=tWlUqT7jrnf1ouhMctuUkaYBWEuOPD3JQX4Y8uTHk5w,405
|
|
39
|
-
langchain/tools/tool_node.py,sha256=wDJr_LTCN295GrjZi1iKvu_xYj05nbeanqo78jNJaDU,46514
|
|
40
|
-
langchain-1.0.0a12.dist-info/METADATA,sha256=oKxFoU8_xPZNRc1jm3Y3YLlxdiQ5TbQ_hSDbaol10Ps,5987
|
|
41
|
-
langchain-1.0.0a12.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
42
|
-
langchain-1.0.0a12.dist-info/licenses/LICENSE,sha256=TsZ-TKbmch26hJssqCJhWXyGph7iFLvyFBYAa3stBHg,1067
|
|
43
|
-
langchain-1.0.0a12.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|