File tree 3 files changed +21
-10
lines changed
tests/unit/vertex_langchain
vertexai/reasoning_engines
3 files changed +21
-10
lines changed Original file line number Diff line number Diff line change 140
140
141
141
reasoning_engine_extra_require = [
142
142
"cloudpickle >= 2.2.1, < 3.0" ,
143
- "pydantic < 3" ,
143
+ "pydantic >= 2.6.3, < 3" ,
144
144
]
145
145
146
146
rapid_evaluation_extra_require = [
154
154
"langchain-google-vertexai < 0.2" ,
155
155
]
156
156
157
- langchain_testing_extra_require = langchain_extra_require + [
158
- "pytest-xdist" ,
159
- ]
157
+ langchain_testing_extra_require = list (
158
+ set (
159
+ langchain_extra_require
160
+ + reasoning_engine_extra_require
161
+ + ["absl-py" , "pytest-xdist" ]
162
+ )
163
+ )
160
164
161
165
full_extra_require = list (
162
166
set (
174
178
+ autologging_extra_require
175
179
+ preview_extra_require
176
180
+ ray_extra_require
177
- + reasoning_engine_extra_require
178
181
+ rapid_evaluation_extra_require
179
182
)
180
183
)
File renamed without changes.
Original file line number Diff line number Diff line change 24
24
from google .protobuf import struct_pb2
25
25
from google .protobuf import json_format
26
26
27
+ try :
28
+ # For LangChain templates, they might not import langchain_core and get
29
+ # PydanticUserError: `query` is not fully defined; you should define
30
+ # `RunnableConfig`, then call `query.model_rebuild()`.
31
+ import langchain_core .runnables .config
32
+ RunnableConfig = langchain_core .runnables .config .RunnableConfig
33
+ except ImportError :
34
+ RunnableConfig = Any
35
+
27
36
JsonDict = Dict [str , Any ]
28
37
29
38
@@ -214,11 +223,10 @@ def _import_cloudpickle_or_raise() -> types.ModuleType:
214
223
def _import_pydantic_or_raise () -> types .ModuleType :
215
224
"""Tries to import the pydantic module."""
216
225
try :
217
- # For compatibility across Pydantic V1 and V2
218
- try :
219
- from pydantic import v1 as pydantic
220
- except ImportError :
221
- import pydantic
226
+ import pydantic
227
+ _ = pydantic .Field
228
+ except AttributeError :
229
+ from pydantic import v1 as pydantic
222
230
except ImportError as e :
223
231
raise ImportError (
224
232
"pydantic is not installed. Please call "
You can’t perform that action at this time.
0 commit comments