uipath-langchain 0.0.124__py3-none-any.whl → 0.0.125__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of uipath-langchain might be problematic. Click here for more details.

@@ -57,11 +57,6 @@ class LangGraphRuntime(UiPathBaseRuntime):
57
57
  tracer = None
58
58
 
59
59
  try:
60
- if self.context.resume is False and self.context.job_id is None:
61
- # Delete the previous graph state file at debug time
62
- if os.path.exists(self.state_file_path):
63
- os.remove(self.state_file_path)
64
-
65
60
  async with AsyncSqliteSaver.from_conn_string(
66
61
  self.state_file_path
67
62
  ) as memory:
@@ -86,9 +81,11 @@ class LangGraphRuntime(UiPathBaseRuntime):
86
81
 
87
82
  graph_config: RunnableConfig = {
88
83
  "configurable": {
89
- "thread_id": self.context.job_id
90
- if self.context.job_id
91
- else "default"
84
+ "thread_id": (
85
+ self.context.execution_id
86
+ or self.context.job_id
87
+ or "default"
88
+ )
92
89
  },
93
90
  "callbacks": callbacks,
94
91
  }
@@ -1,4 +1,5 @@
1
1
  import asyncio
2
+ import os
2
3
  from os import environ as env
3
4
  from typing import Optional
4
5
 
@@ -40,7 +41,8 @@ def langgraph_run_middleware(
40
41
  context.langgraph_config = config
41
42
  context.debug = kwargs.get("debug", False)
42
43
  context.logs_min_level = env.get("LOG_LEVEL", "INFO")
43
- context.job_id = env.get("UIPATH_JOB_KEY")
44
+ context.job_id = env.get("UIPATH_JOB_KEY", None)
45
+ context.execution_id = env.get("UIPATH_JOB_KEY", None)
44
46
  context.trace_id = env.get("UIPATH_TRACE_ID")
45
47
  context.is_eval_run = kwargs.get("is_eval_run", False)
46
48
  context.tracing_enabled = tracing
@@ -64,6 +66,10 @@ def langgraph_run_middleware(
64
66
  env["UIPATH_REQUESTING_FEATURE"] = "langgraph-agent"
65
67
 
66
68
  async with LangGraphRuntime.from_context(context) as runtime:
69
+ if context.resume is False and context.job_id is None:
70
+ # Delete the previous graph state file at debug time
71
+ if os.path.exists(runtime.state_file_path):
72
+ os.remove(runtime.state_file_path)
67
73
  await runtime.execute()
68
74
 
69
75
  asyncio.run(execute())
@@ -9,7 +9,7 @@ import httpx
9
9
  import openai
10
10
  from langchain_core.embeddings import Embeddings
11
11
  from langchain_core.language_models.chat_models import _cleanup_llm_representation
12
- from pydantic import BaseModel, Field, SecretStr
12
+ from pydantic import BaseModel, ConfigDict, Field, SecretStr
13
13
  from tenacity import (
14
14
  AsyncRetrying,
15
15
  Retrying,
@@ -37,8 +37,7 @@ def get_from_uipath_url():
37
37
 
38
38
 
39
39
  class UiPathRequestMixin(BaseModel):
40
- class Config:
41
- arbitrary_types_allowed = True
40
+ model_config = ConfigDict(arbitrary_types_allowed=True)
42
41
 
43
42
  default_headers: Optional[Mapping[str, str]] = {
44
43
  "X-UiPath-Streaming-Enabled": "false",
@@ -0,0 +1,191 @@
1
+ from enum import Enum
2
+ from typing import Annotated, Any, Dict, List, Literal, Optional, Union
3
+
4
+ from pydantic import BaseModel, ConfigDict, Field
5
+
6
+
7
+ class AgentMessageRole(str, Enum):
8
+ """Enum for message roles"""
9
+
10
+ SYSTEM = "System"
11
+ USER = "User"
12
+
13
+
14
+ class AgentMessage(BaseModel):
15
+ """Message model for agent conversations"""
16
+
17
+ role: AgentMessageRole
18
+ content: str
19
+
20
+ model_config = ConfigDict(
21
+ validate_by_name=True, validate_by_alias=True, extra="allow"
22
+ )
23
+
24
+
25
+ class AgentSettings(BaseModel):
26
+ """Settings for agent configuration"""
27
+
28
+ engine: str = Field(..., description="Engine type, e.g., 'basic-v1'")
29
+ model: str = Field(..., description="LLM model identifier")
30
+ max_tokens: int = Field(
31
+ ..., alias="maxTokens", description="Maximum number of tokens"
32
+ )
33
+ temperature: float = Field(..., description="Temperature for response generation")
34
+
35
+ model_config = ConfigDict(
36
+ validate_by_name=True, validate_by_alias=True, extra="allow"
37
+ )
38
+
39
+
40
+ class AgentResourceType(str, Enum):
41
+ """Enum for resource types"""
42
+
43
+ TOOL = "tool"
44
+ CONTEXT = "context"
45
+ ESCALATION = "escalation"
46
+
47
+
48
+ class AgentBaseResourceConfig(BaseModel):
49
+ """Base resource model with common properties"""
50
+
51
+ name: str
52
+ description: str
53
+
54
+ model_config = ConfigDict(
55
+ validate_by_name=True, validate_by_alias=True, extra="allow"
56
+ )
57
+
58
+
59
+ class AgentUnknownResourceConfig(AgentBaseResourceConfig):
60
+ """Fallback for unknown or future resource types"""
61
+
62
+ resource_type: str = Field(alias="$resourceType")
63
+
64
+ model_config = ConfigDict(extra="allow")
65
+
66
+
67
+ class AgentToolSettings(BaseModel):
68
+ """Settings for tool configuration"""
69
+
70
+ max_attempts: int = Field(0, alias="maxAttempts")
71
+ retry_delay: int = Field(0, alias="retryDelay")
72
+ timeout: int = Field(0)
73
+
74
+ model_config = ConfigDict(
75
+ validate_by_name=True, validate_by_alias=True, extra="allow"
76
+ )
77
+
78
+
79
+ class AgentToolProperties(BaseModel):
80
+ """Properties specific to tool configuration"""
81
+
82
+ folder_path: Optional[str] = Field(None, alias="folderPath")
83
+ process_name: Optional[str] = Field(None, alias="processName")
84
+
85
+ model_config = ConfigDict(
86
+ validate_by_name=True, validate_by_alias=True, extra="allow"
87
+ )
88
+
89
+
90
+ class AgentToolResourceConfig(AgentBaseResourceConfig):
91
+ """Tool resource with tool-specific properties"""
92
+
93
+ resource_type: Literal[AgentResourceType.TOOL] = Field(alias="$resourceType")
94
+ type: str = Field(..., description="Tool type")
95
+ arguments: Dict[str, Any] = Field(
96
+ default_factory=dict, description="Tool arguments"
97
+ )
98
+ input_schema: Dict[str, Any] = Field(
99
+ ..., alias="inputSchema", description="Input schema for the tool"
100
+ )
101
+ output_schema: Dict[str, Any] = Field(
102
+ ..., alias="outputSchema", description="Output schema for the tool"
103
+ )
104
+ properties: AgentToolProperties = Field(..., description="Tool-specific properties")
105
+ settings: AgentToolSettings = Field(
106
+ default_factory=AgentToolSettings, description="Tool settings"
107
+ )
108
+
109
+ model_config = ConfigDict(
110
+ validate_by_name=True, validate_by_alias=True, extra="allow"
111
+ )
112
+
113
+
114
+ class AgentContextSettings(BaseModel):
115
+ """Settings for context configuration"""
116
+
117
+ result_count: int = Field(alias="resultCount")
118
+ retrieval_mode: Literal["Semantic", "Structured"] = Field(alias="retrievalMode")
119
+ threshold: float = Field(default=0)
120
+
121
+ model_config = ConfigDict(
122
+ validate_by_name=True, validate_by_alias=True, extra="allow"
123
+ )
124
+
125
+
126
+ class AgentContextResourceConfig(AgentBaseResourceConfig):
127
+ """Context resource with context-specific properties"""
128
+
129
+ resource_type: Literal[AgentResourceType.CONTEXT] = Field(alias="$resourceType")
130
+ folder_path: str = Field(alias="folderPath")
131
+ index_name: str = Field(alias="indexName")
132
+ settings: AgentContextSettings = Field(..., description="Context settings")
133
+
134
+ model_config = ConfigDict(
135
+ validate_by_name=True, validate_by_alias=True, extra="allow"
136
+ )
137
+
138
+
139
+ class AgentEscalationResourceConfig(AgentBaseResourceConfig):
140
+ """Escalation resource with escalation-specific properties"""
141
+
142
+ resource_type: Literal[AgentResourceType.ESCALATION] = Field(alias="$resourceType")
143
+
144
+ model_config = ConfigDict(
145
+ validate_by_name=True, validate_by_alias=True, extra="allow"
146
+ )
147
+
148
+
149
+ # Discriminated union for known types
150
+ KnownAgentResourceConfig = Annotated[
151
+ Union[
152
+ AgentToolResourceConfig,
153
+ AgentContextResourceConfig,
154
+ AgentEscalationResourceConfig,
155
+ ],
156
+ Field(discriminator="resource_type"),
157
+ ]
158
+
159
+ # Final union includes unknowns as a catch-all
160
+ AgentResourceConfig = Union[
161
+ KnownAgentResourceConfig,
162
+ AgentUnknownResourceConfig,
163
+ ]
164
+
165
+
166
+ class AgentConfig(BaseModel):
167
+ """Main agent model"""
168
+
169
+ id: str = Field(..., description="Agent id or project name")
170
+ name: str = Field(..., description="Agent name or project name")
171
+ input_schema: Dict[str, Any] = Field(
172
+ ..., alias="inputSchema", description="JSON schema for input arguments"
173
+ )
174
+ output_schema: Dict[str, Any] = Field(
175
+ ..., alias="outputSchema", description="JSON schema for output arguments"
176
+ )
177
+ messages: List[AgentMessage] = Field(
178
+ ..., description="List of system and user messages"
179
+ )
180
+ features: List[Any] = Field(
181
+ default_factory=list, description="Currently empty feature list"
182
+ )
183
+ version: str = Field("1.0.0", description="Agent version")
184
+ settings: AgentSettings = Field(..., description="Agent settings configuration")
185
+ resources: List[AgentResourceConfig] = Field(
186
+ ..., description="List of tools, context, and escalation resources"
187
+ )
188
+
189
+ model_config = ConfigDict(
190
+ validate_by_name=True, validate_by_alias=True, extra="allow"
191
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath-langchain
3
- Version: 0.0.124
3
+ Version: 0.0.125
4
4
  Summary: UiPath Langchain
5
5
  Project-URL: Homepage, https://uipath.com
6
6
  Project-URL: Repository, https://github.com/UiPath/uipath-langchain-python
@@ -25,7 +25,7 @@ Requires-Dist: openai>=1.65.5
25
25
  Requires-Dist: openinference-instrumentation-langchain>=0.1.50
26
26
  Requires-Dist: pydantic-settings>=2.6.0
27
27
  Requires-Dist: python-dotenv>=1.0.1
28
- Requires-Dist: uipath<2.2.0,>=2.1.30
28
+ Requires-Dist: uipath<2.2.0,>=2.1.33
29
29
  Provides-Extra: langchain
30
30
  Description-Content-Type: text/markdown
31
31
 
@@ -4,19 +4,20 @@ uipath_langchain/_cli/__init__.py,sha256=juqd9PbXs4yg45zMJ7BHAOPQjb7sgEbWE9InBtG
4
4
  uipath_langchain/_cli/cli_dev.py,sha256=VlI8qgCw-63I97tp_9lbXs-CVcNSjpd2sC13YNZAIuU,1401
5
5
  uipath_langchain/_cli/cli_init.py,sha256=xhxJ8tuMSrVUNHvltgyPpOrvgMA-wq9shHeYYwvHILs,8199
6
6
  uipath_langchain/_cli/cli_new.py,sha256=dL8-Rri6u67ZZdbb4nT38A5xD_Q3fVnG0UK9VSeKaqg,2563
7
- uipath_langchain/_cli/cli_run.py,sha256=Jr-nxzBaSPQoVrdV1nQBSDVFElFV3N0a0uNDDrdSc8I,3375
7
+ uipath_langchain/_cli/cli_run.py,sha256=R-cUi3lO3Qd4ysTXD7PW4sa1RsB427v_Y6xUQxWijfQ,3725
8
8
  uipath_langchain/_cli/_runtime/_context.py,sha256=yyzYJDmk2fkH4T5gm4cLGRyXtjLESrpzHBT9euqluTA,817
9
9
  uipath_langchain/_cli/_runtime/_exception.py,sha256=USKkLYkG-dzjX3fEiMMOHnVUpiXJs_xF0OQXCCOvbYM,546
10
10
  uipath_langchain/_cli/_runtime/_input.py,sha256=vZ8vfVxvPSaPWmIPghvNx1VRKzbalHsKUMBPiKDvJWM,5492
11
11
  uipath_langchain/_cli/_runtime/_output.py,sha256=yJOZPWv2FRUJWv1NRs9JmpB4QMTDXu8jrxoaKrfJvzw,9078
12
- uipath_langchain/_cli/_runtime/_runtime.py,sha256=E4aEX4eTjK2XymdKYD1fXNz668S4U2CwEmfL7HSNxjo,14692
12
+ uipath_langchain/_cli/_runtime/_runtime.py,sha256=dRM28l1k3qFf8NLWytRKlOcPwZJ__qUjqmV04wN9JRY,14504
13
13
  uipath_langchain/_cli/_templates/langgraph.json.template,sha256=eeh391Gta_hoRgaNaZ58nW1LNvCVXA7hlAH6l7Veous,107
14
14
  uipath_langchain/_cli/_templates/main.py.template,sha256=nMJQIYPlRk90iANfNVpkJ2EQX20Dxsyq92-BucEz_UM,1189
15
15
  uipath_langchain/_cli/_utils/_graph.py,sha256=JPShHNl0UQvl4AdjLIqLpNt_JAjpWH9WWF22Gs47Xew,7445
16
16
  uipath_langchain/_utils/__init__.py,sha256=WoY66enCygRXTh6v5B1UrRcFCnQYuPJ8oqDkwomXzLc,194
17
- uipath_langchain/_utils/_request_mixin.py,sha256=Tr57358_dwb7SQ1OU75XjdFVWEIr05-QJifeJfHHZgc,19680
17
+ uipath_langchain/_utils/_request_mixin.py,sha256=ddKFs_0mjoFCmvPTiOTPJh1IIqYUo5CUka-B7zAZphE,19695
18
18
  uipath_langchain/_utils/_settings.py,sha256=2fExMQJ88YptfldmzMfZIpsx-m1gfMkeYGf5t6KIe0A,3084
19
19
  uipath_langchain/_utils/_sleep_policy.py,sha256=e9pHdjmcCj4CVoFM1jMyZFelH11YatsgWfpyrfXzKBQ,1251
20
+ uipath_langchain/builder/agent_config.py,sha256=b9WODKPjvufj41Ow_dQn5CnaTAjAZyQoNhuAl8vfiso,5809
20
21
  uipath_langchain/chat/__init__.py,sha256=WDcvy91ixvZ3Mq7Ae94g5CjyQwXovDBnEv1NlD5SXBE,116
21
22
  uipath_langchain/chat/models.py,sha256=m5PRAFXzUamt6-1K9uSlWUvZg_NfVyYHkgoQDJ-1rGs,10527
22
23
  uipath_langchain/embeddings/__init__.py,sha256=QICtYB58ZyqFfDQrEaO8lTEgAU5NuEKlR7iIrS0OBtc,156
@@ -30,8 +31,8 @@ uipath_langchain/tracers/_instrument_traceable.py,sha256=0e841zVzcPWjOGtmBx0GeHb
30
31
  uipath_langchain/tracers/_utils.py,sha256=JOT1tKMdvqjMDtj2WbmbOWMeMlTXBWavxWpogX7KlRA,1543
31
32
  uipath_langchain/vectorstores/__init__.py,sha256=w8qs1P548ud1aIcVA_QhBgf_jZDrRMK5Lono78yA8cs,114
32
33
  uipath_langchain/vectorstores/context_grounding_vectorstore.py,sha256=TncIXG-YsUlO0R5ZYzWsM-Dj1SVCZbzmo2LraVxXelc,9559
33
- uipath_langchain-0.0.124.dist-info/METADATA,sha256=zIj8p28Nc1KOTVJ7wjJNCXbsyMAmbx995lA8GdAoeUs,4235
34
- uipath_langchain-0.0.124.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
35
- uipath_langchain-0.0.124.dist-info/entry_points.txt,sha256=FUtzqGOEntlJKMJIXhQUfT7ZTbQmGhke1iCmDWZaQZI,81
36
- uipath_langchain-0.0.124.dist-info/licenses/LICENSE,sha256=JDpt-uotAkHFmxpwxi6gwx6HQ25e-lG4U_Gzcvgp7JY,1063
37
- uipath_langchain-0.0.124.dist-info/RECORD,,
34
+ uipath_langchain-0.0.125.dist-info/METADATA,sha256=-qGeRLnvPNVGjyNyQRn5SQ0bgd8Kn07sgfgmVCYfihg,4235
35
+ uipath_langchain-0.0.125.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
36
+ uipath_langchain-0.0.125.dist-info/entry_points.txt,sha256=FUtzqGOEntlJKMJIXhQUfT7ZTbQmGhke1iCmDWZaQZI,81
37
+ uipath_langchain-0.0.125.dist-info/licenses/LICENSE,sha256=JDpt-uotAkHFmxpwxi6gwx6HQ25e-lG4U_Gzcvgp7JY,1063
38
+ uipath_langchain-0.0.125.dist-info/RECORD,,