Skip to content

Commit 15fbaae

Browse files
authored
Merge pull request #305 from UiPath/feature/add-message-mapping-methods
fix: add chat agent with hitl middleware
2 parents 8717f19 + a68e066 commit 15fbaae

26 files changed

+8144
-1863
lines changed

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
[project]
22
name = "uipath-langchain"
3-
version = "0.1.13"
3+
version = "0.1.14"
44
description = "UiPath Langchain"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"
77
dependencies = [
8-
"uipath-core>=0.0.6, <0.1.0",
9-
"uipath-runtime>=0.1.2, <0.2.0",
10-
"uipath>=2.2.11, <2.3.0",
8+
"uipath>=2.2.16, <2.3.0",
119
"langgraph>=1.0.0, <2.0.0",
1210
"langchain-core>=1.0.0, <2.0.0",
1311
"langgraph-checkpoint-sqlite>=3.0.0, <4.0.0",
@@ -110,3 +108,4 @@ name = "testpypi"
110108
url = "https://test.pypi.org/simple/"
111109
publish-url = "https://test.pypi.org/legacy/"
112110
explicit = true
111+

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -259,37 +259,37 @@ Documents service
259259
# Classify a document using a DU Modern project.
260260
sdk.documents.classify(project_type: <enum 'ProjectType, tag: Optional[str]=None, project_name: Optional[str]=None, file: Union[IO[bytes], bytes, str, NoneType]=None, file_path: Optional[str]=None) -> typing.List[uipath.platform.documents.documents.ClassificationResult]
261261

262-
# Asynchronously version of the [`classify`][uipath._services.documents_service.DocumentsService.classify] method.
262+
# Asynchronously version of the [`classify`][uipath.platform.documents._documents_service.DocumentsService.classify] method.
263263
sdk.documents.classify_async(project_type: <enum 'ProjectType, tag: Optional[str]=None, project_name: Optional[str]=None, file: Union[IO[bytes], bytes, str, NoneType]=None, file_path: Optional[str]=None) -> typing.List[uipath.platform.documents.documents.ClassificationResult]
264264

265265
# Create a validate classification action for a document based on the classification results. More details about validation actions can be found in the [official documentation](https://docs.uipath.com/ixp/automation-cloud/latest/user-guide/validating-classifications).
266266
sdk.documents.create_validate_classification_action(action_title: str, action_priority: <enum 'ActionPriority, action_catalog: str, action_folder: str, storage_bucket_name: str, storage_bucket_directory_path: str, classification_results: List[uipath.platform.documents.documents.ClassificationResult]) -> uipath.platform.documents.documents.ValidateClassificationAction
267267

268-
# Asynchronous version of the [`create_validation_action`][uipath._services.documents_service.DocumentsService.create_validate_classification_action] method.
268+
# Asynchronous version of the [`create_validation_action`][uipath.platform.documents._documents_service.DocumentsService.create_validate_classification_action] method.
269269
sdk.documents.create_validate_classification_action_async(action_title: str, action_priority: <enum 'ActionPriority, action_catalog: str, action_folder: str, storage_bucket_name: str, storage_bucket_directory_path: str, classification_results: List[uipath.platform.documents.documents.ClassificationResult]) -> uipath.platform.documents.documents.ValidateClassificationAction
270270

271271
# Create a validate extraction action for a document based on the extraction response. More details about validation actions can be found in the [official documentation](https://docs.uipath.com/ixp/automation-cloud/latest/user-guide/validating-extractions).
272272
sdk.documents.create_validate_extraction_action(action_title: str, action_priority: <enum 'ActionPriority, action_catalog: str, action_folder: str, storage_bucket_name: str, storage_bucket_directory_path: str, extraction_response: uipath.platform.documents.documents.ExtractionResponse) -> uipath.platform.documents.documents.ValidateExtractionAction
273273

274-
# Asynchronous version of the [`create_validation_action`][uipath._services.documents_service.DocumentsService.create_validate_extraction_action] method.
274+
# Asynchronous version of the [`create_validation_action`][uipath.platform.documents._documents_service.DocumentsService.create_validate_extraction_action] method.
275275
sdk.documents.create_validate_extraction_action_async(action_title: str, action_priority: <enum 'ActionPriority, action_catalog: str, action_folder: str, storage_bucket_name: str, storage_bucket_directory_path: str, extraction_response: uipath.platform.documents.documents.ExtractionResponse) -> uipath.platform.documents.documents.ValidateExtractionAction
276276

277277
# Extract predicted data from a document using an DU Modern/IXP project.
278278
sdk.documents.extract(tag: Optional[str]=None, project_name: Optional[str]=None, file: Union[IO[bytes], bytes, str, NoneType]=None, file_path: Optional[str]=None, classification_result: Optional[uipath.platform.documents.documents.ClassificationResult]=None, project_type: Optional[uipath.platform.documents.documents.ProjectType]=None, document_type_name: Optional[str]=None) -> typing.Union[uipath.platform.documents.documents.ExtractionResponse, uipath.platform.documents.documents.ExtractionResponseIXP]
279279

280-
# Asynchronously version of the [`extract`][uipath._services.documents_service.DocumentsService.extract] method.
280+
# Asynchronously version of the [`extract`][uipath.platform.documents._documents_service.DocumentsService.extract] method.
281281
sdk.documents.extract_async(tag: Optional[str]=None, project_name: Optional[str]=None, file: Union[IO[bytes], bytes, str, NoneType]=None, file_path: Optional[str]=None, classification_result: Optional[uipath.platform.documents.documents.ClassificationResult]=None, project_type: Optional[uipath.platform.documents.documents.ProjectType]=None, document_type_name: Optional[str]=None) -> typing.Union[uipath.platform.documents.documents.ExtractionResponse, uipath.platform.documents.documents.ExtractionResponseIXP]
282282

283283
# Get the result of a validate classification action.
284284
sdk.documents.get_validate_classification_result(validation_action: uipath.platform.documents.documents.ValidateClassificationAction) -> typing.List[uipath.platform.documents.documents.ClassificationResult]
285285

286-
# Asynchronous version of the [`get_validation_result`][uipath._services.documents_service.DocumentsService.get_validate_classification_result] method.
286+
# Asynchronous version of the [`get_validation_result`][uipath.platform.documents._documents_service.DocumentsService.get_validate_classification_result] method.
287287
sdk.documents.get_validate_classification_result_async(validation_action: uipath.platform.documents.documents.ValidateClassificationAction) -> typing.List[uipath.platform.documents.documents.ClassificationResult]
288288

289289
# Get the result of a validate extraction action.
290290
sdk.documents.get_validate_extraction_result(validation_action: uipath.platform.documents.documents.ValidateExtractionAction) -> typing.Union[uipath.platform.documents.documents.ExtractionResponse, uipath.platform.documents.documents.ExtractionResponseIXP]
291291

292-
# Asynchronous version of the [`get_validation_result`][uipath._services.documents_service.DocumentsService.get_validate_extraction_result] method.
292+
# Asynchronous version of the [`get_validation_result`][uipath.platform.documents._documents_service.DocumentsService.get_validate_extraction_result] method.
293293
sdk.documents.get_validate_extraction_result_async(validation_action: uipath.platform.documents.documents.ValidateExtractionAction) -> typing.Union[uipath.platform.documents.documents.ExtractionResponse, uipath.platform.documents.documents.ExtractionResponseIXP]
294294

295295
```
@@ -411,7 +411,7 @@ Llm service
411411

412412
```python
413413
# Generate chat completions using UiPath's normalized LLM Gateway API.
414-
sdk.llm.chat_completions(messages: Union[List[Dict[str, str]], List[tuple[str, str]]], model: str="gpt-4o-mini-2024-07-18", max_tokens: int=4096, temperature: float=0, n: int=1, frequency_penalty: float=0, presence_penalty: float=0, top_p: Optional[float]=1, top_k: Optional[int]=None, tools: Optional[List[uipath.platform.llm_gateway.llm_gateway.ToolDefinition]]=None, tool_choice: Union[uipath.platform.llm_gateway.llm_gateway.AutoToolChoice, uipath.platform.llm_gateway.llm_gateway.RequiredToolChoice, uipath.platform.llm_gateway.llm_gateway.SpecificToolChoice, Literal['auto', 'none'], NoneType]=None, response_format: Union[Dict[str, Any], type[pydantic.main.BaseModel], NoneType]=None, api_version: str="2024-08-01-preview")
414+
sdk.llm.chat_completions(messages: list[dict[str, str]] | list[tuple[str, str]], model: str="gpt-4o-mini-2024-07-18", max_tokens: int=4096, temperature: float=0, n: int=1, frequency_penalty: float=0, presence_penalty: float=0, top_p: float | None=1, top_k: int | None=None, tools: list[uipath.platform.llm_gateway.llm_gateway.ToolDefinition] | None=None, tool_choice: Union[uipath.platform.llm_gateway.llm_gateway.AutoToolChoice, uipath.platform.llm_gateway.llm_gateway.RequiredToolChoice, uipath.platform.llm_gateway.llm_gateway.SpecificToolChoice, Literal['auto', 'none'], NoneType]=None, response_format: dict[str, Any] | type[pydantic.main.BaseModel] | None=None, api_version: str="2024-08-01-preview")
415415

416416
```
417417

@@ -421,7 +421,7 @@ Llm Openai service
421421

422422
```python
423423
# Generate chat completions using UiPath's LLM Gateway service.
424-
sdk.llm_openai.chat_completions(messages: List[Dict[str, str]], model: str="gpt-4o-mini-2024-07-18", max_tokens: int=4096, temperature: float=0, response_format: Union[Dict[str, Any], type[pydantic.main.BaseModel], NoneType]=None, api_version: str="2024-10-21")
424+
sdk.llm_openai.chat_completions(messages: list[dict[str, str]], model: str="gpt-4o-mini-2024-07-18", max_tokens: int=4096, temperature: float=0, response_format: dict[str, Any] | type[pydantic.main.BaseModel] | None=None, api_version: str="2024-10-21")
425425

426426
# Generate text embeddings using UiPath's LLM Gateway service.
427427
sdk.llm_openai.embeddings(input: str, embedding_model: str="text-embedding-ada-002", openai_api_version: str="2024-10-21")
@@ -434,16 +434,16 @@ Mcp service
434434

435435
```python
436436
# List all MCP servers.
437-
sdk.mcp.list(folder_path: Optional[str]=None) -> typing.List[uipath.platform.orchestrator.mcp.McpServer]
437+
sdk.mcp.list(folder_path: str | None=None) -> typing.List[uipath.platform.orchestrator.mcp.McpServer]
438438

439439
# Asynchronously list all MCP servers.
440-
sdk.mcp.list_async(folder_path: Optional[str]=None) -> typing.List[uipath.platform.orchestrator.mcp.McpServer]
440+
sdk.mcp.list_async(folder_path: str | None=None) -> typing.List[uipath.platform.orchestrator.mcp.McpServer]
441441

442442
# Retrieve a specific MCP server by its slug.
443-
sdk.mcp.retrieve(slug: str, folder_path: Optional[str]=None) -> uipath.platform.orchestrator.mcp.McpServer
443+
sdk.mcp.retrieve(slug: str, folder_path: str | None=None) -> uipath.platform.orchestrator.mcp.McpServer
444444

445445
# Asynchronously retrieve a specific MCP server by its slug.
446-
sdk.mcp.retrieve_async(slug: str, folder_path: Optional[str]=None) -> uipath.platform.orchestrator.mcp.McpServer
446+
sdk.mcp.retrieve_async(slug: str, folder_path: str | None=None) -> uipath.platform.orchestrator.mcp.McpServer
447447

448448
```
449449

samples/chat-agent/entry-points.json

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"entryPoints": [
55
{
66
"filePath": "agent",
7-
"uniqueId": "f5a38c3c-199a-4c57-b49b-e8b8eb7319f7",
7+
"uniqueId": "9c094a08-edb8-4e43-b4bd-94e4c1665d5f",
88
"type": "agent",
99
"input": {
1010
"type": "object",
@@ -2142,26 +2142,38 @@
21422142
{
21432143
"id": "__start__",
21442144
"name": "__start__",
2145-
"type": "Node",
2146-
"subgraph": null
2145+
"type": "__start__",
2146+
"subgraph": null,
2147+
"metadata": {}
21472148
},
21482149
{
21492150
"id": "model",
21502151
"name": "model",
2151-
"type": "Node",
2152-
"subgraph": null
2152+
"type": "model",
2153+
"subgraph": null,
2154+
"metadata": {
2155+
"model_name": "claude-3-7-sonnet-latest",
2156+
"max_tokens": 64000
2157+
}
21532158
},
21542159
{
21552160
"id": "tools",
21562161
"name": "tools",
2157-
"type": "Node",
2158-
"subgraph": null
2162+
"type": "tool",
2163+
"subgraph": null,
2164+
"metadata": {
2165+
"tool_names": [
2166+
"tavily_search"
2167+
],
2168+
"tool_count": 1
2169+
}
21592170
},
21602171
{
21612172
"id": "__end__",
21622173
"name": "__end__",
2163-
"type": "Node",
2164-
"subgraph": null
2174+
"type": "__end__",
2175+
"subgraph": null,
2176+
"metadata": {}
21652177
}
21662178
],
21672179
"edges": [

samples/chat-agent/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ dependencies = [
99
"langchain-anthropic>=1.2.0",
1010
"tavily-python>=0.7.13",
1111
"langchain-tavily>=0.2.13",
12-
"uipath-langchain>=0.1.0, <0.2.0",
12+
"uipath-langchain>=0.1.11, <0.2.0",
1313
"uipath>=2.2.0, <2.3.0",
1414
]
1515

@@ -49,5 +49,5 @@ lint.ignore = [
4949

5050
[dependency-groups]
5151
dev = [
52-
"uipath-dev>=0.0.5",
52+
"uipath-dev==0.0.11",
5353
]

0 commit comments

Comments
 (0)