Skip to content

Commit 672c463

Browse files
committed
feat: add trace-file option
1 parent 15437e7 commit 672c463

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/uipath/_cli/cli_eval.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
from uipath.eval._helpers import auto_discover_entrypoint
2222
from uipath.platform.common import UiPathConfig
2323
from uipath.telemetry._track import flush_events
24-
from uipath.tracing import LlmOpsHttpExporter
24+
from uipath.tracing import JsonLinesFileExporter, LlmOpsHttpExporter
2525

2626
from ._utils._console import ConsoleLogger
2727
from ._utils._eval_set import EvalHelpers
@@ -100,6 +100,12 @@ def setup_reporting_prereq(no_report: bool) -> bool:
100100
default="default",
101101
help="Model settings ID from evaluation set to override agent settings (default: 'default')",
102102
)
103+
@click.option(
104+
"--trace-file",
105+
required=False,
106+
type=click.Path(exists=False),
107+
help="File path where traces will be written in JSONL format",
108+
)
103109
def eval(
104110
entrypoint: str | None,
105111
eval_set: str | None,
@@ -111,6 +117,7 @@ def eval(
111117
enable_mocker_cache: bool,
112118
report_coverage: bool,
113119
model_settings_id: str,
120+
trace_file: str | None,
114121
) -> None:
115122
"""Run an evaluation set against the agent.
116123
@@ -185,6 +192,11 @@ async def execute_eval():
185192
if ctx.job_id:
186193
trace_manager.add_span_exporter(LlmOpsHttpExporter())
187194

195+
if trace_file:
196+
trace_manager.add_span_exporter(
197+
JsonLinesFileExporter(trace_file)
198+
)
199+
188200
project_id = UiPathConfig.project_id
189201

190202
runtime_factory = UiPathRuntimeFactoryRegistry.get(context=ctx)

0 commit comments

Comments
 (0)