uipath-langchain 0.0.136__py3-none-any.whl → 0.0.138__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/_cli/cli_eval.py +5 -3
- uipath_langchain/_tracing/_oteladapter.py +19 -7
- {uipath_langchain-0.0.136.dist-info → uipath_langchain-0.0.138.dist-info}/METADATA +2 -2
- {uipath_langchain-0.0.136.dist-info → uipath_langchain-0.0.138.dist-info}/RECORD +7 -7
- {uipath_langchain-0.0.136.dist-info → uipath_langchain-0.0.138.dist-info}/WHEEL +0 -0
- {uipath_langchain-0.0.136.dist-info → uipath_langchain-0.0.138.dist-info}/entry_points.txt +0 -0
- {uipath_langchain-0.0.136.dist-info → uipath_langchain-0.0.138.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import asyncio
|
|
2
|
-
import uuid
|
|
3
2
|
from typing import List, Optional
|
|
4
3
|
|
|
5
4
|
from openinference.instrumentation.langchain import (
|
|
6
5
|
LangChainInstrumentor,
|
|
7
6
|
get_current_span,
|
|
8
7
|
)
|
|
8
|
+
from uipath._cli._evals._console_progress_reporter import ConsoleProgressReporter
|
|
9
9
|
from uipath._cli._evals._progress_reporter import StudioWebProgressReporter
|
|
10
10
|
from uipath._cli._evals._runtime import UiPathEvalContext, UiPathEvalRuntime
|
|
11
11
|
from uipath._cli._runtime._contracts import (
|
|
@@ -39,11 +39,13 @@ def langgraph_eval_middleware(
|
|
|
39
39
|
|
|
40
40
|
event_bus = EventBus()
|
|
41
41
|
|
|
42
|
-
if
|
|
42
|
+
if kwargs.get("register_progress_reporter", False):
|
|
43
43
|
progress_reporter = StudioWebProgressReporter(
|
|
44
44
|
spans_exporter=LangChainExporter()
|
|
45
45
|
)
|
|
46
46
|
asyncio.run(progress_reporter.subscribe_to_eval_runtime_events(event_bus))
|
|
47
|
+
console_reporter = ConsoleProgressReporter()
|
|
48
|
+
asyncio.run(console_reporter.subscribe_to_eval_runtime_events(event_bus))
|
|
47
49
|
|
|
48
50
|
def generate_runtime_context(
|
|
49
51
|
context_entrypoint: str, langgraph_config: LangGraphConfig, **context_kwargs
|
|
@@ -56,7 +58,7 @@ def langgraph_eval_middleware(
|
|
|
56
58
|
runtime_entrypoint = entrypoint or auto_discover_entrypoint()
|
|
57
59
|
|
|
58
60
|
eval_context = UiPathEvalContext.with_defaults(
|
|
59
|
-
entrypoint=runtime_entrypoint,
|
|
61
|
+
entrypoint=runtime_entrypoint, **kwargs
|
|
60
62
|
)
|
|
61
63
|
eval_context.eval_set = eval_set or EvalHelpers.auto_discover_eval_set()
|
|
62
64
|
eval_context.eval_ids = eval_ids
|
|
@@ -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(
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath-langchain
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.138
|
|
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
|
|
@@ -26,7 +26,7 @@ Requires-Dist: openai>=1.65.5
|
|
|
26
26
|
Requires-Dist: openinference-instrumentation-langchain>=0.1.50
|
|
27
27
|
Requires-Dist: pydantic-settings>=2.6.0
|
|
28
28
|
Requires-Dist: python-dotenv>=1.0.1
|
|
29
|
-
Requires-Dist: uipath<2.2.0,>=2.1.
|
|
29
|
+
Requires-Dist: uipath<2.2.0,>=2.1.76
|
|
30
30
|
Provides-Extra: langchain
|
|
31
31
|
Description-Content-Type: text/markdown
|
|
32
32
|
|
|
@@ -2,7 +2,7 @@ uipath_langchain/__init__.py,sha256=VBrvQn7d3nuOdN7zEnV2_S-uhmkjgEIlXiFVeZxZakQ,
|
|
|
2
2
|
uipath_langchain/middlewares.py,sha256=6ljfbtWekrYc5G9KWDLSaViJ1DVIaNM-4qeB1BfHywE,731
|
|
3
3
|
uipath_langchain/_cli/__init__.py,sha256=juqd9PbXs4yg45zMJ7BHAOPQjb7sgEbWE9InBtGZhfo,24
|
|
4
4
|
uipath_langchain/_cli/cli_dev.py,sha256=3e9RldNGirIk9184NdLK6kDuGeeqZjekTxbSZRtXjBE,1505
|
|
5
|
-
uipath_langchain/_cli/cli_eval.py,sha256=
|
|
5
|
+
uipath_langchain/_cli/cli_eval.py,sha256=rsa13I3bPxAsc0Gf5KFyvf5AMT8WdhgY7kT7ZAyXrJM,3572
|
|
6
6
|
uipath_langchain/_cli/cli_init.py,sha256=xhxJ8tuMSrVUNHvltgyPpOrvgMA-wq9shHeYYwvHILs,8199
|
|
7
7
|
uipath_langchain/_cli/cli_new.py,sha256=KKLxCzz7cDQ__rRr_a496IHWlSQXhmrBNgmKHnXAnTY,2336
|
|
8
8
|
uipath_langchain/_cli/cli_run.py,sha256=hRcoXJgOIFceCswzTfZKyzqVee3j-oSh-13EfuQmmE8,2614
|
|
@@ -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.138.dist-info/METADATA,sha256=aM1VS1o-g7Fc7KBltSpLGugqNLi3b3qAbzHE2cy_xs8,4275
|
|
38
|
+
uipath_langchain-0.0.138.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
39
|
+
uipath_langchain-0.0.138.dist-info/entry_points.txt,sha256=FUtzqGOEntlJKMJIXhQUfT7ZTbQmGhke1iCmDWZaQZI,81
|
|
40
|
+
uipath_langchain-0.0.138.dist-info/licenses/LICENSE,sha256=JDpt-uotAkHFmxpwxi6gwx6HQ25e-lG4U_Gzcvgp7JY,1063
|
|
41
|
+
uipath_langchain-0.0.138.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|