uipath-langchain 0.0.112__py3-none-any.whl → 0.0.114__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.

@@ -5,13 +5,13 @@ from langgraph.graph import START, StateGraph, END
5
5
  from pydantic import BaseModel
6
6
  import os
7
7
 
8
- class GraphInput(BaseModel):
8
+ class GraphState(BaseModel):
9
9
  topic: str
10
10
 
11
11
  class GraphOutput(BaseModel):
12
12
  report: str
13
13
 
14
- async def generate_report(state: GraphInput) -> GraphOutput:
14
+ async def generate_report(state: GraphState) -> GraphOutput:
15
15
  if os.getenv("ANTHROPIC_API_KEY"):
16
16
  llm_model = ChatAnthropic(model="claude-3-5-sonnet-latest")
17
17
  elif os.getenv("OPENAI_API_KEY"):
@@ -23,7 +23,7 @@ async def generate_report(state: GraphInput) -> GraphOutput:
23
23
  output = await llm_model.ainvoke([SystemMessage(system_prompt), HumanMessage(state.topic)])
24
24
  return GraphOutput(report=output.content)
25
25
 
26
- builder = StateGraph(input=GraphInput, output=GraphOutput)
26
+ builder = StateGraph(GraphState, output=GraphOutput)
27
27
 
28
28
  builder.add_node("generate_report", generate_report)
29
29
 
@@ -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.114
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
@@ -10,7 +10,7 @@ uipath_langchain/_cli/_runtime/_input.py,sha256=vZ8vfVxvPSaPWmIPghvNx1VRKzbalHsK
10
10
  uipath_langchain/_cli/_runtime/_output.py,sha256=yJOZPWv2FRUJWv1NRs9JmpB4QMTDXu8jrxoaKrfJvzw,9078
11
11
  uipath_langchain/_cli/_runtime/_runtime.py,sha256=SjOZkal6c1ZeZNFzW23DoAnF6LNQ2nN0dISSu2cSFhQ,13881
12
12
  uipath_langchain/_cli/_templates/langgraph.json.template,sha256=eeh391Gta_hoRgaNaZ58nW1LNvCVXA7hlAH6l7Veous,107
13
- uipath_langchain/_cli/_templates/main.py.template,sha256=9JEyPxwc4Ce8Dfd2UAgHgpwkkjuXwWXOQZ-65P53QuM,1195
13
+ uipath_langchain/_cli/_templates/main.py.template,sha256=nMJQIYPlRk90iANfNVpkJ2EQX20Dxsyq92-BucEz_UM,1189
14
14
  uipath_langchain/_cli/_utils/_graph.py,sha256=P7m03i6kcLda8XVpVtppcM8GOrSW62zWcv3rCR1H5zs,7086
15
15
  uipath_langchain/_utils/__init__.py,sha256=WoY66enCygRXTh6v5B1UrRcFCnQYuPJ8oqDkwomXzLc,194
16
16
  uipath_langchain/_utils/_request_mixin.py,sha256=t_1HWBxqEl-wsSk9ubmIM-8vs9BlNy4ZVBxtDxktn6U,18489
@@ -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.114.dist-info/METADATA,sha256=BTxHYf-8_z61F3QMH8WQFXiaqbQtMJpgYB7x8BiZKZQ,4166
33
+ uipath_langchain-0.0.114.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
34
+ uipath_langchain-0.0.114.dist-info/entry_points.txt,sha256=FUtzqGOEntlJKMJIXhQUfT7ZTbQmGhke1iCmDWZaQZI,81
35
+ uipath_langchain-0.0.114.dist-info/licenses/LICENSE,sha256=JDpt-uotAkHFmxpwxi6gwx6HQ25e-lG4U_Gzcvgp7JY,1063
36
+ uipath_langchain-0.0.114.dist-info/RECORD,,