Skip to content

Conversation

cristipufu
Copy link
Member

@cristipufu cristipufu commented Sep 23, 2025

Description

This PR decouples the runtime from graph configuration by introducing a new LangGraphScriptRuntime class and a LangGraphJsonResolver to handle graph loading. The changes separate concerns by removing graph configuration logic from the runtime and moving it to a dedicated resolver pattern.

  • Introduces LangGraphScriptRuntime as a specialized runtime for script-based execution
  • Creates LangGraphJsonResolver to handle graph loading and configuration validation
  • Removes graph configuration dependencies from the base runtime and context classes

This change also introduces LangGraphJsonResolverContext, an async context manager that wraps the existing LangGraphJsonResolver and returns a callable compatible with LangGraphRuntime. It ensures that the underlying graph is loaded only once, improving performance and efficiency when executing multiple runtimes with the same entrypoint.

async with LangGraphJsonResolverContext(entrypoint="my_agent") as resolver:
    # Pass the callable directly to the runtime
    runtime = LangGraphRuntime(context, resolver)
    result = await runtime.execute()

Development Package

  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath-langchain==0.0.138.dev1001900658",

  # Any version from PR
  "uipath-langchain>=0.0.138.dev1001900000,<0.0.138.dev1001910000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath-langchain = { index = "testpypi" }

@cristipufu cristipufu self-assigned this Sep 23, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR decouples the runtime from graph configuration by introducing a new LangGraphScriptRuntime class and a GraphResolver to handle graph loading. The changes separate concerns by removing graph configuration logic from the runtime and moving it to a dedicated resolver pattern.

  • Introduces LangGraphScriptRuntime as a specialized runtime for script-based execution
  • Creates GraphResolver to handle graph loading and configuration validation
  • Removes graph configuration dependencies from the base runtime and context classes

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
cli_run.py Updates imports and instantiation to use LangGraphScriptRuntime
cli_eval.py Updates import to use LangGraphScriptRuntime
cli_dev.py Updates import to use LangGraphScriptRuntime
_runtime.py Refactors base runtime to accept graph resolver, moves validation logic out
_graph_resolver.py New file containing graph loading and validation logic
_context.py Removes graph configuration fields from runtime context

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@cristipufu cristipufu force-pushed the fix/decouple_runtime_from_config branch 5 times, most recently from a55a4e3 to 572f777 Compare September 23, 2025 12:03
@cristipufu cristipufu force-pushed the fix/decouple_runtime_from_config branch 2 times, most recently from 7e2d818 to 6559824 Compare October 8, 2025 15:55
@cristipufu cristipufu force-pushed the fix/decouple_runtime_from_config branch from 6559824 to e4c326b Compare October 9, 2025 13:03
@cristipufu cristipufu merged commit 892804f into main Oct 9, 2025
32 checks passed
@cristipufu cristipufu deleted the fix/decouple_runtime_from_config branch October 9, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants