uipath-langchain 0.0.136__py3-none-any.whl → 0.0.137__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.
- uipath_langchain/_tracing/_oteladapter.py +19 -7
- {uipath_langchain-0.0.136.dist-info → uipath_langchain-0.0.137.dist-info}/METADATA +1 -1
- {uipath_langchain-0.0.136.dist-info → uipath_langchain-0.0.137.dist-info}/RECORD +6 -6
- {uipath_langchain-0.0.136.dist-info → uipath_langchain-0.0.137.dist-info}/WHEEL +0 -0
- {uipath_langchain-0.0.136.dist-info → uipath_langchain-0.0.137.dist-info}/entry_points.txt +0 -0
- {uipath_langchain-0.0.136.dist-info → uipath_langchain-0.0.137.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import json
|
|
2
2
|
import logging
|
|
3
|
-
from typing import Any, Dict, List
|
|
3
|
+
from typing import Any, Dict, List, Optional
|
|
4
4
|
|
|
5
|
-
from opentelemetry.sdk.trace.export import
|
|
6
|
-
SpanExportResult,
|
|
7
|
-
)
|
|
5
|
+
from opentelemetry.sdk.trace.export import SpanExportResult
|
|
8
6
|
from uipath.tracing import LlmOpsHttpExporter
|
|
9
7
|
|
|
10
8
|
logger = logging.getLogger(__name__)
|
|
@@ -71,6 +69,11 @@ class LangChainExporter(LlmOpsHttpExporter):
|
|
|
71
69
|
# Add more mappings as needed
|
|
72
70
|
}
|
|
73
71
|
|
|
72
|
+
class Status:
|
|
73
|
+
SUCCESS = 1
|
|
74
|
+
ERROR = 2
|
|
75
|
+
INTERRUPTED = 3
|
|
76
|
+
|
|
74
77
|
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
|
75
78
|
super().__init__(*args, **kwargs)
|
|
76
79
|
|
|
@@ -161,13 +164,18 @@ class LangChainExporter(LlmOpsHttpExporter):
|
|
|
161
164
|
|
|
162
165
|
return result
|
|
163
166
|
|
|
167
|
+
def _determine_status(self, error: Optional[str]) -> int:
|
|
168
|
+
if error:
|
|
169
|
+
if error and error.startswith("GraphInterrupt("):
|
|
170
|
+
return self.Status.INTERRUPTED
|
|
171
|
+
return self.Status.ERROR
|
|
172
|
+
return self.Status.SUCCESS
|
|
173
|
+
|
|
164
174
|
def _process_span_attributes(self, span_data: Dict[str, Any]) -> Dict[str, Any]:
|
|
165
175
|
"""Extracts, transforms, and maps attributes for a span."""
|
|
166
176
|
if "Attributes" not in span_data:
|
|
167
177
|
return span_data
|
|
168
178
|
|
|
169
|
-
logger.debug(f"Processing span: {span_data}")
|
|
170
|
-
|
|
171
179
|
attributes_val = span_data["Attributes"]
|
|
172
180
|
if isinstance(attributes_val, str):
|
|
173
181
|
try:
|
|
@@ -206,7 +214,11 @@ class LangChainExporter(LlmOpsHttpExporter):
|
|
|
206
214
|
|
|
207
215
|
span_data["Attributes"] = json.dumps(processed_attributes)
|
|
208
216
|
|
|
209
|
-
|
|
217
|
+
# Determine status based on error information
|
|
218
|
+
error = attributes.get("error") or attributes.get("exception.message")
|
|
219
|
+
status = self._determine_status(error)
|
|
220
|
+
span_data["Status"] = status
|
|
221
|
+
|
|
210
222
|
return span_data
|
|
211
223
|
|
|
212
224
|
def _send_with_retries(
|
|
@@ -17,7 +17,7 @@ uipath_langchain/_cli/_templates/main.py.template,sha256=GpSblGH2hwS9ibqQmX2iB2n
|
|
|
17
17
|
uipath_langchain/_cli/_utils/_graph.py,sha256=nMJWy8FmaD9rqPUY2lHc5uVpUzbXD1RO12uJnhe0kdo,6803
|
|
18
18
|
uipath_langchain/_tracing/__init__.py,sha256=UqrLc_WimpzKY82M0LJsgJ-HFQUQFjOmOlD1XQ8V-R4,181
|
|
19
19
|
uipath_langchain/_tracing/_instrument_traceable.py,sha256=8f9FyAKWE6kH1N8ErbpwqZHAzNjGwbLjQn7jdX5yAgA,4343
|
|
20
|
-
uipath_langchain/_tracing/_oteladapter.py,sha256=
|
|
20
|
+
uipath_langchain/_tracing/_oteladapter.py,sha256=PD0gsC39ZNvrm0gsfnt1ti6DEy56sBA9sIoxaAbHFFM,8887
|
|
21
21
|
uipath_langchain/_tracing/_utils.py,sha256=r_fiSk3HDDAcePY_UbbEYiSbNqzn5gFeMPYBDvGrFx0,902
|
|
22
22
|
uipath_langchain/_utils/__init__.py,sha256=-w-4TD9ZnJDCpj4VIPXhJciukrmDJJbmnOFnhAkAaEU,81
|
|
23
23
|
uipath_langchain/_utils/_request_mixin.py,sha256=ddKFs_0mjoFCmvPTiOTPJh1IIqYUo5CUka-B7zAZphE,19695
|
|
@@ -34,8 +34,8 @@ uipath_langchain/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
34
34
|
uipath_langchain/tools/preconfigured.py,sha256=xCP0hiQuFKIv45PTvMsoWlwsxJDs7goyZujKflYBngY,7476
|
|
35
35
|
uipath_langchain/vectorstores/__init__.py,sha256=w8qs1P548ud1aIcVA_QhBgf_jZDrRMK5Lono78yA8cs,114
|
|
36
36
|
uipath_langchain/vectorstores/context_grounding_vectorstore.py,sha256=TncIXG-YsUlO0R5ZYzWsM-Dj1SVCZbzmo2LraVxXelc,9559
|
|
37
|
-
uipath_langchain-0.0.
|
|
38
|
-
uipath_langchain-0.0.
|
|
39
|
-
uipath_langchain-0.0.
|
|
40
|
-
uipath_langchain-0.0.
|
|
41
|
-
uipath_langchain-0.0.
|
|
37
|
+
uipath_langchain-0.0.137.dist-info/METADATA,sha256=tYkBQ1NZGqzxGefhPDnDELJi2McbQnAZHiNdtbNVyxE,4275
|
|
38
|
+
uipath_langchain-0.0.137.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
39
|
+
uipath_langchain-0.0.137.dist-info/entry_points.txt,sha256=FUtzqGOEntlJKMJIXhQUfT7ZTbQmGhke1iCmDWZaQZI,81
|
|
40
|
+
uipath_langchain-0.0.137.dist-info/licenses/LICENSE,sha256=JDpt-uotAkHFmxpwxi6gwx6HQ25e-lG4U_Gzcvgp7JY,1063
|
|
41
|
+
uipath_langchain-0.0.137.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|