uipath-langchain 0.0.112__py3-none-any.whl → 0.0.113__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 uipath-langchain might be problematic. Click here for more details.

@@ -2,7 +2,7 @@ import asyncio
2
2
  import json
3
3
  import os
4
4
  import uuid
5
- from typing import Any, Dict
5
+ from typing import Any, Callable, Dict, overload
6
6
 
7
7
  from langgraph.graph.state import CompiledStateGraph
8
8
  from uipath._cli._utils._console import ConsoleLogger
@@ -94,8 +94,14 @@ def generate_schema_from_graph(graph: CompiledStateGraph) -> Dict[str, Any]:
94
94
  return schema
95
95
 
96
96
 
97
- async def langgraph_init_middleware_async(entrypoint: str) -> MiddlewareResult:
97
+ async def langgraph_init_middleware_async(
98
+ entrypoint: str,
99
+ options: dict[str, Any] | None = None,
100
+ write_config: Callable[[Any], str] | None = None,
101
+ ) -> MiddlewareResult:
98
102
  """Middleware to check for langgraph.json and create uipath.json with schemas"""
103
+ options = options or {}
104
+
99
105
  config = LangGraphConfig()
100
106
  if not config.exists:
101
107
  return MiddlewareResult(
@@ -125,8 +131,9 @@ async def langgraph_init_middleware_async(entrypoint: str) -> MiddlewareResult:
125
131
  mermaids[graph.name] = compiled_graph.get_graph(xray=1).draw_mermaid()
126
132
 
127
133
  try:
134
+ should_infer_bindings = options.get("infer_bindings", True)
128
135
  # Make sure the file path exists
129
- if os.path.exists(graph.file_path):
136
+ if os.path.exists(graph.file_path) and should_infer_bindings:
130
137
  file_bindings = generate_bindings_json(graph.file_path)
131
138
 
132
139
  # Merge bindings
@@ -163,10 +170,13 @@ async def langgraph_init_middleware_async(entrypoint: str) -> MiddlewareResult:
163
170
 
164
171
  uipath_config = {"entryPoints": entrypoints, "bindings": all_bindings}
165
172
 
166
- # Save the uipath.json file
167
- config_path = "uipath.json"
168
- with open(config_path, "w") as f:
169
- json.dump(uipath_config, f, indent=2)
173
+ if write_config:
174
+ config_path = write_config(uipath_config)
175
+ else:
176
+ # Save the uipath.json file
177
+ config_path = "uipath.json"
178
+ with open(config_path, "w") as f:
179
+ json.dump(uipath_config, f, indent=4)
170
180
 
171
181
  for graph_name, mermaid_content in mermaids.items():
172
182
  mermaid_file_path = f"{graph_name}.mermaid"
@@ -193,6 +203,26 @@ async def langgraph_init_middleware_async(entrypoint: str) -> MiddlewareResult:
193
203
  )
194
204
 
195
205
 
196
- def langgraph_init_middleware(entrypoint: str) -> MiddlewareResult:
206
+ @overload
207
+ def langgraph_init_middleware(
208
+ entrypoint: str,
209
+ ) -> MiddlewareResult: ...
210
+
211
+
212
+ @overload
213
+ def langgraph_init_middleware(
214
+ entrypoint: str,
215
+ options: dict[str, Any],
216
+ write_config: Callable[[Any], str],
217
+ ) -> MiddlewareResult: ...
218
+
219
+
220
+ def langgraph_init_middleware(
221
+ entrypoint: str,
222
+ options: dict[str, Any] | None = None,
223
+ write_config: Callable[[Any], str] | None = None,
224
+ ) -> MiddlewareResult:
197
225
  """Middleware to check for langgraph.json and create uipath.json with schemas"""
198
- return asyncio.run(langgraph_init_middleware_async(entrypoint))
226
+ return asyncio.run(
227
+ langgraph_init_middleware_async(entrypoint, options, write_config)
228
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath-langchain
3
- Version: 0.0.112
3
+ Version: 0.0.113
4
4
  Summary: UiPath Langchain
5
5
  Project-URL: Homepage, https://uipath.com
6
6
  Project-URL: Repository, https://github.com/UiPath/uipath-langchain-python
@@ -24,7 +24,7 @@ Requires-Dist: langgraph>=0.2.70
24
24
  Requires-Dist: openai>=1.65.5
25
25
  Requires-Dist: pydantic-settings>=2.6.0
26
26
  Requires-Dist: python-dotenv>=1.0.1
27
- Requires-Dist: uipath<2.1.0,>=2.0.65
27
+ Requires-Dist: uipath<2.1.0,>=2.0.71
28
28
  Provides-Extra: langchain
29
29
  Description-Content-Type: text/markdown
30
30
 
@@ -1,7 +1,7 @@
1
1
  uipath_langchain/__init__.py,sha256=VBrvQn7d3nuOdN7zEnV2_S-uhmkjgEIlXiFVeZxZakQ,80
2
2
  uipath_langchain/middlewares.py,sha256=tre7o9DFMgWk1DJiEEUmT6_wiP-PPkWtKmG0iOyvr9c,509
3
3
  uipath_langchain/_cli/__init__.py,sha256=juqd9PbXs4yg45zMJ7BHAOPQjb7sgEbWE9InBtGZhfo,24
4
- uipath_langchain/_cli/cli_init.py,sha256=B5BVUA7pDvKyRRGEx5mgmeE5SJvLPM3cnLGt6a9iixY,7417
4
+ uipath_langchain/_cli/cli_init.py,sha256=aGG0YVsR4_nDgdor4kaNS8oKe263ZOIN27sHfNiCk0c,8177
5
5
  uipath_langchain/_cli/cli_new.py,sha256=dL8-Rri6u67ZZdbb4nT38A5xD_Q3fVnG0UK9VSeKaqg,2563
6
6
  uipath_langchain/_cli/cli_run.py,sha256=rGuYp9AEJdhHclOCFPX100Mo0kaDYt6e6pIKBgbS6ek,3023
7
7
  uipath_langchain/_cli/_runtime/_context.py,sha256=wr4aNn06ReIXmetEZ6b6AnpAt64p13anQ2trZ5Bzgio,807
@@ -29,8 +29,8 @@ uipath_langchain/tracers/_instrument_traceable.py,sha256=0e841zVzcPWjOGtmBx0GeHb
29
29
  uipath_langchain/tracers/_utils.py,sha256=JOT1tKMdvqjMDtj2WbmbOWMeMlTXBWavxWpogX7KlRA,1543
30
30
  uipath_langchain/vectorstores/__init__.py,sha256=w8qs1P548ud1aIcVA_QhBgf_jZDrRMK5Lono78yA8cs,114
31
31
  uipath_langchain/vectorstores/context_grounding_vectorstore.py,sha256=TncIXG-YsUlO0R5ZYzWsM-Dj1SVCZbzmo2LraVxXelc,9559
32
- uipath_langchain-0.0.112.dist-info/METADATA,sha256=MSb7h7hBN5BjhDchfFQYu2X4_OTt2hki8Zr5a-t0TDg,4166
33
- uipath_langchain-0.0.112.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
- uipath_langchain-0.0.112.dist-info/entry_points.txt,sha256=FUtzqGOEntlJKMJIXhQUfT7ZTbQmGhke1iCmDWZaQZI,81
35
- uipath_langchain-0.0.112.dist-info/licenses/LICENSE,sha256=JDpt-uotAkHFmxpwxi6gwx6HQ25e-lG4U_Gzcvgp7JY,1063
36
- uipath_langchain-0.0.112.dist-info/RECORD,,
32
+ uipath_langchain-0.0.113.dist-info/METADATA,sha256=J4-uKSI-h324cuctyP9p5qTa0qeHjnyloHHQhyInTxs,4166
33
+ uipath_langchain-0.0.113.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
+ uipath_langchain-0.0.113.dist-info/entry_points.txt,sha256=FUtzqGOEntlJKMJIXhQUfT7ZTbQmGhke1iCmDWZaQZI,81
35
+ uipath_langchain-0.0.113.dist-info/licenses/LICENSE,sha256=JDpt-uotAkHFmxpwxi6gwx6HQ25e-lG4U_Gzcvgp7JY,1063
36
+ uipath_langchain-0.0.113.dist-info/RECORD,,