Skip to content

Commit 76e18ff

Browse files
authored
Merge pull request #385 from UiPath/fix/update_factory_kwargs
fix: update factory methods with kwargs
2 parents 6589850 + 40759d4 commit 76e18ff

File tree

3 files changed

+21
-17
lines changed

3 files changed

+21
-17
lines changed

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[project]
22
name = "uipath-langchain"
3-
version = "0.2.4"
3+
version = "0.3.0"
44
description = "Python SDK that enables developers to build and deploy LangGraph agents to the UiPath Cloud Platform"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
77
dependencies = [
8-
"uipath>=2.3.0, <2.4.0",
9-
"uipath-runtime>=0.3.3, <0.4.0",
8+
"uipath>=2.4.0, <2.5.0",
9+
"uipath-runtime>=0.4.0, <0.5.0",
1010
"langgraph>=1.0.0, <2.0.0",
1111
"langchain-core>=1.2.5, <2.0.0",
1212
"aiosqlite==0.21.0",

src/uipath_langchain/runtime/factory.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _load_config(self) -> LangGraphConfig:
9292
return self._config
9393

9494
async def _load_graph(
95-
self, entrypoint: str
95+
self, entrypoint: str, **kwargs
9696
) -> StateGraph[Any, Any, Any] | CompiledStateGraph[Any, Any, Any, Any]:
9797
"""
9898
Load a graph for the given entrypoint.
@@ -181,7 +181,7 @@ async def _compile_graph(
181181
return builder.compile(checkpointer=memory)
182182

183183
async def _resolve_and_compile_graph(
184-
self, entrypoint: str, memory: AsyncSqliteSaver
184+
self, entrypoint: str, memory: AsyncSqliteSaver, **kwargs
185185
) -> CompiledStateGraph[Any, Any, Any, Any]:
186186
"""
187187
Resolve a graph from configuration and compile it.
@@ -201,7 +201,7 @@ async def _resolve_and_compile_graph(
201201
if entrypoint in self._graph_cache:
202202
return self._graph_cache[entrypoint]
203203

204-
loaded_graph = await self._load_graph(entrypoint)
204+
loaded_graph = await self._load_graph(entrypoint, **kwargs)
205205

206206
compiled_graph = await self._compile_graph(loaded_graph, memory)
207207

@@ -249,6 +249,7 @@ async def _create_runtime_instance(
249249
compiled_graph: CompiledStateGraph[Any, Any, Any, Any],
250250
runtime_id: str,
251251
entrypoint: str,
252+
**kwargs,
252253
) -> UiPathRuntimeProtocol:
253254
"""
254255
Create a runtime instance from a compiled graph.
@@ -279,7 +280,7 @@ async def _create_runtime_instance(
279280
)
280281

281282
async def new_runtime(
282-
self, entrypoint: str, runtime_id: str
283+
self, entrypoint: str, runtime_id: str, **kwargs
283284
) -> UiPathRuntimeProtocol:
284285
"""
285286
Create a new LangGraph runtime instance.
@@ -294,12 +295,15 @@ async def new_runtime(
294295
# Get shared memory instance
295296
memory = await self._get_memory()
296297

297-
compiled_graph = await self._resolve_and_compile_graph(entrypoint, memory)
298+
compiled_graph = await self._resolve_and_compile_graph(
299+
entrypoint, memory, **kwargs
300+
)
298301

299302
return await self._create_runtime_instance(
300303
compiled_graph=compiled_graph,
301304
runtime_id=runtime_id,
302305
entrypoint=entrypoint,
306+
**kwargs,
303307
)
304308

305309
async def dispose(self) -> None:

uv.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)