Skip to content

Commit c7e9899

Browse files
authored
Merge pull request #282 from UiPath/feat/langchain_v1
feat: update langchain v1
2 parents 8339beb + 24bfc68 commit c7e9899

85 files changed

Lines changed: 1620 additions & 2257 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
runs-on: ${{ matrix.os }}
1717
strategy:
1818
matrix:
19-
python-version: ["3.10", "3.11", "3.12", "3.13"]
19+
python-version: ["3.11", "3.12", "3.13"]
2020
os: [ubuntu-latest, windows-latest]
2121

2222
permissions:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Check out these [sample projects](https://github.com/UiPath/uipath-langchain-pyt
1313

1414
## Requirements
1515

16-
- Python 3.10 or higher
16+
- Python 3.11 or higher
1717
- UiPath Automation Cloud account
1818

1919
## Installation

docs/human_in_the_loop.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ wait state within the LangGraph framework.
66

77
## Models Overview
88

9-
### 1. CreateAction
9+
### 1. CreateTask
1010

11-
The `CreateAction` model is utilized to create an escalation action within the UiPath Action Center as part of an interrupt context. The action will rely on a previously created UiPath app.
11+
The `CreateTask` model is utilized to create an escalation action within the UiPath Action Center as part of an interrupt context. The action will rely on a previously created UiPath app.
1212
After addressing the escalation, the current agent will resume execution.
1313
For more information on UiPath apps, refer to the [UiPath Apps User Guide](https://docs.uipath.com/apps/automation-cloud/latest/user-guide/introduction).
1414

@@ -19,34 +19,33 @@ For more information on UiPath apps, refer to the [UiPath Apps User Guide](https
1919
- **app_key** (Optional[str]): The key of the app.
2020
- **title** (str): The title of the action to create.
2121
- **data** (Optional[Dict[str, Any]]): Values that the action will be populated with.
22-
- **app_version** (Optional[int]): The version of the app (defaults to 1).
2322
- **assignee** (Optional[str]): The username or email of the person assigned to handle the escalation.
2423

2524
#### Example:
2625

2726
```python
28-
from uipath.models import CreateAction
29-
action_output = interrupt(CreateAction(app_name="AppName", app_folder_path="MyFolderPath", title="Escalate Issue", data={"key": "value"}, app_version=1, assignee="user@example.com"))
27+
from uipath.platform.common import CreateTask
28+
task_output = interrupt(CreateTask(app_name="AppName", app_folder_path="MyFolderPath", title="Escalate Issue", data={"key": "value"}, assignee="user@example.com"))
3029
```
3130

32-
For a practical implementation of the `CreateAction` model, refer to the [ticket-classification sample](https://github.com/UiPath/uipath-langchain-python/tree/main/samples/ticket-classification). This sample demonstrates how to create an action with dynamic input.
31+
For a practical implementation of the `CreateTask` model, refer to the [ticket-classification sample](https://github.com/UiPath/uipath-langchain-python/tree/main/samples/ticket-classification). This sample demonstrates how to create an action with dynamic input.
3332

3433
---
3534

36-
### 2. WaitAction
35+
### 2. WaitTask
3736

38-
The `WaitAction` model is used to wait for an action to be handled. This model is intended for scenarios where the action has already been created.
37+
The `WaitTask` model is used to wait for a task to be handled. This model is intended for scenarios where the task has already been created.
3938

4039
#### Attributes:
4140

42-
- **action** (Action): The instance of the action to wait for.
41+
- **task** (Task): The instance of the task to wait for.
4342
- **app_folder_path** (Optional[str]): The folder path of the app.
4443

4544
#### Example:
4645

4746
```python
48-
from uipath.models import WaitAction
49-
action_output = interrupt(WaitAction(action=my_action_instance, app_folder_path="MyFolderPath"))
47+
from uipath.platform.common import WaitTask
48+
task_output = interrupt(WaitTask(task=my_task_instance, app_folder_path="MyFolderPath"))
5049
```
5150

5251
---

docs/quick_start.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This guide provides step-by-step instructions for setting up, creating, publishi
88

99
Before proceeding, ensure you have the following installed:
1010

11-
- Python 3.10 or higher
11+
- Python 3.11 or higher
1212
- `pip` or `uv` package manager
1313
- A UiPath Automation Cloud account with appropriate permissions
1414

@@ -58,12 +58,12 @@ We recommend using `uv` for package management. To create a new project:
5858

5959
```shell
6060
# Initialize a new uv project in the current directory
61-
> uv init . --python 3.10
61+
> uv init . --python 3.11
6262

6363
# Create a new virtual environment
6464
# By default, uv creates a virtual environment in a directory called .venv
6565
> uv venv
66-
Using CPython 3.10.16 interpreter at: [PATH]
66+
Using CPython 3.11.16 interpreter at: [PATH]
6767
Creating virtual environment at: .venv
6868
Activate with: source .venv/bin/activate
6969

pyproject.toml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,28 @@
11
[project]
22
name = "uipath-langchain"
3-
version = "0.0.160"
3+
version = "0.1.0"
44
description = "UiPath Langchain"
55
readme = { file = "README.md", content-type = "text/markdown" }
6-
requires-python = ">=3.10"
6+
requires-python = ">=3.11"
77
dependencies = [
8-
"uipath>=2.1.173,<2.2.0",
9-
"langgraph>=0.5.0, <0.7.0",
10-
"langchain-core>=0.3.34",
11-
"langgraph-checkpoint-sqlite>=2.0.3",
12-
"langchain-community>=0.3.21",
13-
"langchain-openai>=0.3.3",
14-
"langchain>=0.3.4",
8+
"uipath>=2.2.0, <2.3.0",
9+
"langgraph>=1.0.0, <2.0.0",
10+
"langchain-core>=1.0.0, <2.0.0",
11+
"langgraph-checkpoint-sqlite>=3.0.0, <4.0.0",
12+
"langchain-openai>=1.0.0, <2.0.0",
13+
"langchain>=1.0.0, <2.0.0",
1514
"pydantic-settings>=2.6.0",
1615
"python-dotenv>=1.0.1",
1716
"httpx>=0.27.0",
18-
"openai>=1.65.5",
19-
"openinference-instrumentation-langchain>=0.1.50",
17+
"openinference-instrumentation-langchain>=0.1.54",
2018
"jsonschema-pydantic>=0.6",
2119
]
2220
classifiers = [
23-
"Development Status :: 3 - Alpha",
2421
"Intended Audience :: Developers",
2522
"Topic :: Software Development :: Build Tools",
26-
"Programming Language :: Python :: 3.10",
2723
"Programming Language :: Python :: 3.11",
2824
"Programming Language :: Python :: 3.12",
25+
"Programming Language :: Python :: 3.13",
2926
]
3027
maintainers = [
3128
{ name = "Marius Cosareanu", email = "marius.cosareanu@uipath.com" },
@@ -35,6 +32,9 @@ maintainers = [
3532
[project.entry-points."uipath.middlewares"]
3633
register = "uipath_langchain.middlewares:register_middleware"
3734

35+
[project.entry-points."uipath.runtime.factories"]
36+
langgraph = "uipath_langchain.runtime:register_runtime_factory"
37+
3838
[project.urls]
3939
Homepage = "https://uipath.com"
4040
Repository = "https://github.com/UiPath/uipath-langchain-python"

samples/RAG-quiz-generator/.agent/SDK_REFERENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This section provides a comprehensive reference for all UiPath SDK services and
77
Initialize the UiPath SDK client
88

99
```python
10-
from uipath import UiPath
10+
from uipath.platform import UiPath
1111

1212
# Initialize with environment variables
1313
sdk = UiPath()

samples/RAG-quiz-generator/src/agents/quiz-generator-RAG-agent.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
from langgraph.graph import END, START, MessagesState, StateGraph
55
from langgraph.types import Command, interrupt
66
from pydantic import BaseModel, Field, field_validator, ValidationInfo
7-
from uipath import UiPath
7+
from uipath.platform import UiPath
88
from langchain_core.output_parsers import PydanticOutputParser
99
import logging
1010
import time
11-
from uipath.models import InvokeProcess, IngestionInProgressException
11+
from uipath.platform.common import InvokeProcess
12+
from uipath.platform.errors import IngestionInProgressException
1213
from uipath_langchain.retrievers import ContextGroundingRetriever
1314
from langchain_anthropic import ChatAnthropic
1415
from langchain_core.documents import Document

samples/RAG-quiz-generator/src/agents/researcher-RAG-agent.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
from langchain_anthropic import ChatAnthropic
44
from langchain_tavily import TavilySearch
55
from langgraph.graph import END, START, MessagesState, StateGraph
6-
from langgraph.prebuilt import create_react_agent
6+
from langgraph import create_agent
77
from langgraph.types import Command
88
from pydantic import BaseModel
9-
from uipath import UiPath
9+
from uipath.platform import UiPath
1010
from langchain_core.messages import AIMessage, SystemMessage, HumanMessage
11-
from uipath.models import ContextGroundingIndex
11+
from uipath.platform.context_grounding import ContextGroundingIndex
1212

1313
uipath = UiPath()
1414
tavily_tool = TavilySearch(max_results=5)
@@ -42,7 +42,7 @@ def prepare_input(state: GraphInput) -> GraphState:
4242
)
4343

4444
async def research_node(state: GraphState) -> Command:
45-
research_agent = create_react_agent(
45+
research_agent = create_agent(
4646
llm, tools=[tavily_tool],
4747
prompt=("As an AI research specialist, your task is to scour the internet for pertinent information based on the user's specified search_instructions."
4848
" Avoid summarizing or organizing the content; simply gather raw, unprocessed information. Do not engage in follow-up questions or discussions, "

samples/calculator-agent/.agent/SDK_REFERENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This section provides a comprehensive reference for all UiPath SDK services and
77
Initialize the UiPath SDK client
88

99
```python
10-
from uipath import UiPath
10+
from uipath.platform import UiPath
1111

1212
# Initialize with environment variables
1313
sdk = UiPath()

samples/chat-agent/.agent/SDK_REFERENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This section provides a comprehensive reference for all UiPath SDK services and
77
Initialize the UiPath SDK client
88

99
```python
10-
from uipath import UiPath
10+
from uipath.platform import UiPath
1111

1212
# Initialize with environment variables
1313
sdk = UiPath()

0 commit comments

Comments
 (0)