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 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

This change also introduces GraphResolverContext, an async context manager that wraps the existing GraphResolver 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 GraphResolverContext(entrypoint="my_agent") as resolver_callable:
    # Pass the callable directly to the runtime
    runtime = LangGraphRuntime(context, resolver_callable)
    result = await runtime.execute()

Development Package

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

  # Any version from PR
  "uipath-langchain>=0.0.132.dev1001900000,<0.0.132.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 4 times, most recently from 9aec949 to a55a4e3 Compare September 23, 2025 11:49
@cristipufu cristipufu force-pushed the fix/decouple_runtime_from_config branch from a55a4e3 to 572f777 Compare September 23, 2025 12:03
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.

1 participant