diff --git a/.gitattributes b/.gitattributes index c8f9eb864..6f41db98f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,10 @@ *.db filter=lfs diff=lfs merge=lfs -text **/cached_embeddings/** filter=lfs diff=lfs merge=lfs -text + +* text=auto + +*.py text eol=lf +*.json text eol=lf +*.yaml text eol=lf +*.yml text eol=lf +*.toml text eol=lf diff --git a/packages/uipath/docs/core/llm_gateway.md b/packages/uipath/docs/core/llm_gateway.md index db58ab8c3..52f0b445d 100644 --- a/packages/uipath/docs/core/llm_gateway.md +++ b/packages/uipath/docs/core/llm_gateway.md @@ -1 +1 @@ -::: uipath.platform.chat._llm_gateway_service +::: uipath.platform.chat._llm_gateway_service diff --git a/packages/uipath/scripts/debug_test.py b/packages/uipath/scripts/debug_test.py index 101f1c8d9..54b4f5d45 100644 --- a/packages/uipath/scripts/debug_test.py +++ b/packages/uipath/scripts/debug_test.py @@ -1,28 +1,28 @@ -import subprocess -import sys -import tempfile -from pathlib import Path - -# Simple test -test_code = """ -import httpx - -def test(): - client = httpx.Client() - return client -""" - -linter_path = Path(__file__).parent / "lint_httpx_client.py" - -with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as f: - f.write(test_code) - f.flush() - - print(f"Testing file: {f.name}") - result = subprocess.run( - [sys.executable, str(linter_path), f.name], capture_output=True, text=True - ) - - print(f"Return code: {result.returncode}") - print(f"Stdout: {result.stdout}") - print(f"Stderr: {result.stderr}") +import subprocess +import sys +import tempfile +from pathlib import Path + +# Simple test +test_code = """ +import httpx + +def test(): + client = httpx.Client() + return client +""" + +linter_path = Path(__file__).parent / "lint_httpx_client.py" + +with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as f: + f.write(test_code) + f.flush() + + print(f"Testing file: {f.name}") + result = subprocess.run( + [sys.executable, str(linter_path), f.name], capture_output=True, text=True + ) + + print(f"Return code: {result.returncode}") + print(f"Stdout: {result.stdout}") + print(f"Stderr: {result.stderr}") diff --git a/packages/uipath/testcases/apicalls-testcase/src/assert.py b/packages/uipath/testcases/apicalls-testcase/src/assert.py index 025ddf212..6314bdf0c 100644 --- a/packages/uipath/testcases/apicalls-testcase/src/assert.py +++ b/packages/uipath/testcases/apicalls-testcase/src/assert.py @@ -1,32 +1,32 @@ -import json -import os - -# Check NuGet package -uipath_dir = ".uipath" -assert os.path.exists(uipath_dir), "NuGet package directory (.uipath) not found" - -nupkg_files = [f for f in os.listdir(uipath_dir) if f.endswith(".nupkg")] -assert nupkg_files, "NuGet package file (.nupkg) not found in .uipath directory" - -print(f"NuGet package found: {nupkg_files[0]}") - -# Check agent output file -output_file = "__uipath/output.json" -assert os.path.isfile(output_file), "Agent output file not found" - -print("Agent output file found") - -# Check status and required fields -with open(output_file, "r", encoding="utf-8") as f: - output_data = json.load(f) - -# Check status -status = output_data.get("status") -assert status == "successful", f"Agent execution failed with status: {status}" - -print("Agent execution status: successful") - -# Check required fields for ticket classification agent -assert "output" in output_data, "Missing 'output' field in agent response" - -print("Required fields validation passed") +import json +import os + +# Check NuGet package +uipath_dir = ".uipath" +assert os.path.exists(uipath_dir), "NuGet package directory (.uipath) not found" + +nupkg_files = [f for f in os.listdir(uipath_dir) if f.endswith(".nupkg")] +assert nupkg_files, "NuGet package file (.nupkg) not found in .uipath directory" + +print(f"NuGet package found: {nupkg_files[0]}") + +# Check agent output file +output_file = "__uipath/output.json" +assert os.path.isfile(output_file), "Agent output file not found" + +print("Agent output file found") + +# Check status and required fields +with open(output_file, "r", encoding="utf-8") as f: + output_data = json.load(f) + +# Check status +status = output_data.get("status") +assert status == "successful", f"Agent execution failed with status: {status}" + +print("Agent execution status: successful") + +# Check required fields for ticket classification agent +assert "output" in output_data, "Missing 'output' field in agent response" + +print("Required fields validation passed") diff --git a/packages/uipath/testcases/basic-testcase/src/assert.py b/packages/uipath/testcases/basic-testcase/src/assert.py index 025ddf212..6314bdf0c 100644 --- a/packages/uipath/testcases/basic-testcase/src/assert.py +++ b/packages/uipath/testcases/basic-testcase/src/assert.py @@ -1,32 +1,32 @@ -import json -import os - -# Check NuGet package -uipath_dir = ".uipath" -assert os.path.exists(uipath_dir), "NuGet package directory (.uipath) not found" - -nupkg_files = [f for f in os.listdir(uipath_dir) if f.endswith(".nupkg")] -assert nupkg_files, "NuGet package file (.nupkg) not found in .uipath directory" - -print(f"NuGet package found: {nupkg_files[0]}") - -# Check agent output file -output_file = "__uipath/output.json" -assert os.path.isfile(output_file), "Agent output file not found" - -print("Agent output file found") - -# Check status and required fields -with open(output_file, "r", encoding="utf-8") as f: - output_data = json.load(f) - -# Check status -status = output_data.get("status") -assert status == "successful", f"Agent execution failed with status: {status}" - -print("Agent execution status: successful") - -# Check required fields for ticket classification agent -assert "output" in output_data, "Missing 'output' field in agent response" - -print("Required fields validation passed") +import json +import os + +# Check NuGet package +uipath_dir = ".uipath" +assert os.path.exists(uipath_dir), "NuGet package directory (.uipath) not found" + +nupkg_files = [f for f in os.listdir(uipath_dir) if f.endswith(".nupkg")] +assert nupkg_files, "NuGet package file (.nupkg) not found in .uipath directory" + +print(f"NuGet package found: {nupkg_files[0]}") + +# Check agent output file +output_file = "__uipath/output.json" +assert os.path.isfile(output_file), "Agent output file not found" + +print("Agent output file found") + +# Check status and required fields +with open(output_file, "r", encoding="utf-8") as f: + output_data = json.load(f) + +# Check status +status = output_data.get("status") +assert status == "successful", f"Agent execution failed with status: {status}" + +print("Agent execution status: successful") + +# Check required fields for ticket classification agent +assert "output" in output_data, "Missing 'output' field in agent response" + +print("Required fields validation passed") diff --git a/packages/uipath/testcases/common/trace_assert.py b/packages/uipath/testcases/common/trace_assert.py index e1ae76a74..1d89a78c9 100644 --- a/packages/uipath/testcases/common/trace_assert.py +++ b/packages/uipath/testcases/common/trace_assert.py @@ -1,160 +1,160 @@ -""" -Simple trace assertion - just check that expected spans exist with required attributes. -Much simpler than the tree-based approach. -""" - -import json -from typing import List, Dict, Any - - -def load_traces(traces_file: str) -> List[Dict[str, Any]]: - """Load traces from a JSONL file.""" - traces = [] - with open(traces_file, 'r', encoding='utf-8') as f: - for line in f: - if line.strip(): - traces.append(json.loads(line)) - return traces - - -def load_expected_traces(expected_file: str) -> List[Dict[str, Any]]: - """Load expected trace definitions from a JSON file.""" - with open(expected_file, 'r', encoding='utf-8') as f: - data = json.load(f) - return data.get('required_spans', []) - - -def get_attributes(span: Dict[str, Any]) -> Dict[str, Any]: - """Parse attributes from a span.""" - return span.get('attributes', {}) - - -def matches_value(expected_value: Any, actual_value: Any) -> bool: - """ - Check if an actual value matches the expected value. - - Supports: - - List of possible values: ["value1", "value2"] - - Wildcard: "*" (any value accepted) - - Exact match: "value" - """ - # Wildcard - accept any value - if expected_value == "*": - return True - - # List of possible values - if isinstance(expected_value, list): - return actual_value in expected_value - - # Exact match - return expected_value == actual_value - - -def matches_expected(span: Dict[str, Any], expected: Dict[str, Any], all_spans: List[Dict[str, Any]] = None) -> bool: - """Check if a span matches the expected definition.""" - # Check name - can be a string or list of possible names - expected_name = expected.get('name') - actual_name = span.get('name') - - if isinstance(expected_name, list): - if actual_name not in expected_name: - return False - elif expected_name != actual_name: - return False - - # Check span type if specified - if 'span_type' in expected: - actual_attrs = get_attributes(span) - actual_span_type = actual_attrs.get('span_type') - - if actual_span_type != expected['span_type']: - return False - - # Check parent if specified - if 'parent' in expected: - expected_parent = expected['parent'] - actual_parent_id = span.get('parent_id') - - # Handle null parent (root span) - if expected_parent is None: - if actual_parent_id is not None: - return False - else: - # Find parent span by name - if all_spans is None: - return False - - parent_span = None - for s in all_spans: - if s.get('context', {}).get('span_id') == actual_parent_id: - parent_span = s - break - - if parent_span is None: - return False - - # Check if parent name matches expected - parent_name = parent_span.get('name') - if isinstance(expected_parent, list): - if parent_name not in expected_parent: - return False - elif parent_name != expected_parent: - return False - - # Check attributes if specified - if 'attributes' in expected: - actual_attrs = get_attributes(span) - for key, expected_value in expected['attributes'].items(): - if key not in actual_attrs: - return False - # Use flexible value matching - if not matches_value(expected_value, actual_attrs[key]): - return False - - return True - - -def assert_traces(traces_file: str, expected_file: str) -> None: - """ - Assert that all expected traces exist in the traces file. - - Args: - traces_file: Path to the traces.jsonl file - expected_file: Path to the expected_traces.json file - - Raises: - AssertionError: If any expected trace is not found - """ - traces = load_traces(traces_file) - expected_spans = load_expected_traces(expected_file) - - print(f"Loaded {len(traces)} traces from {traces_file}") - print(f"Checking {len(expected_spans)} expected spans...") - - missing_spans = [] - - for expected in expected_spans: - # Find a matching span - found = False - for span in traces: - if matches_expected(span, expected, traces): - found = True - print(f"✓ Found span: {expected['name']}") - break - - if not found: - missing_spans.append(expected['name']) - print(f"✗ Missing span: {expected['name']}") - - if missing_spans: - raise AssertionError( - f"Missing expected spans: {', '.join(missing_spans)}\n" - f"Expected {len(expected_spans)} spans, found {len(expected_spans) - len(missing_spans)}" - ) - - print(f"\n✓ All {len(expected_spans)} expected spans found!") - - -if __name__ == "__main__": - # Example usage +""" +Simple trace assertion - just check that expected spans exist with required attributes. +Much simpler than the tree-based approach. +""" + +import json +from typing import List, Dict, Any + + +def load_traces(traces_file: str) -> List[Dict[str, Any]]: + """Load traces from a JSONL file.""" + traces = [] + with open(traces_file, 'r', encoding='utf-8') as f: + for line in f: + if line.strip(): + traces.append(json.loads(line)) + return traces + + +def load_expected_traces(expected_file: str) -> List[Dict[str, Any]]: + """Load expected trace definitions from a JSON file.""" + with open(expected_file, 'r', encoding='utf-8') as f: + data = json.load(f) + return data.get('required_spans', []) + + +def get_attributes(span: Dict[str, Any]) -> Dict[str, Any]: + """Parse attributes from a span.""" + return span.get('attributes', {}) + + +def matches_value(expected_value: Any, actual_value: Any) -> bool: + """ + Check if an actual value matches the expected value. + + Supports: + - List of possible values: ["value1", "value2"] + - Wildcard: "*" (any value accepted) + - Exact match: "value" + """ + # Wildcard - accept any value + if expected_value == "*": + return True + + # List of possible values + if isinstance(expected_value, list): + return actual_value in expected_value + + # Exact match + return expected_value == actual_value + + +def matches_expected(span: Dict[str, Any], expected: Dict[str, Any], all_spans: List[Dict[str, Any]] = None) -> bool: + """Check if a span matches the expected definition.""" + # Check name - can be a string or list of possible names + expected_name = expected.get('name') + actual_name = span.get('name') + + if isinstance(expected_name, list): + if actual_name not in expected_name: + return False + elif expected_name != actual_name: + return False + + # Check span type if specified + if 'span_type' in expected: + actual_attrs = get_attributes(span) + actual_span_type = actual_attrs.get('span_type') + + if actual_span_type != expected['span_type']: + return False + + # Check parent if specified + if 'parent' in expected: + expected_parent = expected['parent'] + actual_parent_id = span.get('parent_id') + + # Handle null parent (root span) + if expected_parent is None: + if actual_parent_id is not None: + return False + else: + # Find parent span by name + if all_spans is None: + return False + + parent_span = None + for s in all_spans: + if s.get('context', {}).get('span_id') == actual_parent_id: + parent_span = s + break + + if parent_span is None: + return False + + # Check if parent name matches expected + parent_name = parent_span.get('name') + if isinstance(expected_parent, list): + if parent_name not in expected_parent: + return False + elif parent_name != expected_parent: + return False + + # Check attributes if specified + if 'attributes' in expected: + actual_attrs = get_attributes(span) + for key, expected_value in expected['attributes'].items(): + if key not in actual_attrs: + return False + # Use flexible value matching + if not matches_value(expected_value, actual_attrs[key]): + return False + + return True + + +def assert_traces(traces_file: str, expected_file: str) -> None: + """ + Assert that all expected traces exist in the traces file. + + Args: + traces_file: Path to the traces.jsonl file + expected_file: Path to the expected_traces.json file + + Raises: + AssertionError: If any expected trace is not found + """ + traces = load_traces(traces_file) + expected_spans = load_expected_traces(expected_file) + + print(f"Loaded {len(traces)} traces from {traces_file}") + print(f"Checking {len(expected_spans)} expected spans...") + + missing_spans = [] + + for expected in expected_spans: + # Find a matching span + found = False + for span in traces: + if matches_expected(span, expected, traces): + found = True + print(f"✓ Found span: {expected['name']}") + break + + if not found: + missing_spans.append(expected['name']) + print(f"✗ Missing span: {expected['name']}") + + if missing_spans: + raise AssertionError( + f"Missing expected spans: {', '.join(missing_spans)}\n" + f"Expected {len(expected_spans)} spans, found {len(expected_spans) - len(missing_spans)}" + ) + + print(f"\n✓ All {len(expected_spans)} expected spans found!") + + +if __name__ == "__main__": + # Example usage assert_traces(".uipath/traces.jsonl", "expected_traces.json") \ No newline at end of file diff --git a/packages/uipath/testcases/langchain-cross/agent.mermaid b/packages/uipath/testcases/langchain-cross/agent.mermaid index 6fa387dce..15cd0e32e 100644 --- a/packages/uipath/testcases/langchain-cross/agent.mermaid +++ b/packages/uipath/testcases/langchain-cross/agent.mermaid @@ -1,14 +1,14 @@ ---- -config: - flowchart: - curve: linear ---- -graph TD; - __start__([

__start__

]):::first - generate_report(generate_report) - __end__([

__end__

]):::last - __start__ --> generate_report; - generate_report --> __end__; - classDef default fill:#f2f0ff,line-height:1.2 - classDef first fill-opacity:0 - classDef last fill:#bfb6fc +--- +config: + flowchart: + curve: linear +--- +graph TD; + __start__([

__start__

]):::first + generate_report(generate_report) + __end__([

__end__

]):::last + __start__ --> generate_report; + generate_report --> __end__; + classDef default fill:#f2f0ff,line-height:1.2 + classDef first fill-opacity:0 + classDef last fill:#bfb6fc diff --git a/packages/uipath/testcases/langchain-cross/expected_traces.json b/packages/uipath/testcases/langchain-cross/expected_traces.json index 82701a144..8bee43f77 100644 --- a/packages/uipath/testcases/langchain-cross/expected_traces.json +++ b/packages/uipath/testcases/langchain-cross/expected_traces.json @@ -1,101 +1,101 @@ -{ - "description": "Langchain cross and traced - checks key spans exist with parent relationships", - "required_spans": [ - { - "name": "LangGraph", - "parent": null, - "attributes": { - "openinference.span.kind": "CHAIN" - } - }, - { - "name": "generate_report", - "parent": "LangGraph", - "attributes": { - "openinference.span.kind": "CHAIN" - } - }, - { - "name": "my_custom_traceable_function", - "parent": "generate_report", - "span_type": "function_call_sync", - "attributes": { - "input.mime_type": "application/json", - "output.mime_type": "application/json" - } - }, - { - "name": "my_custom_traced_function", - "parent": "generate_report", - "span_type": "function_call_sync", - "attributes": { - "input.mime_type": "application/json", - "output.mime_type": "application/json" - } - }, - { - "name": "my_custom_nested_traced_function", - "parent": "my_custom_traced_function", - "span_type": "function_call_sync", - "attributes": { - "input.mime_type": "application/json", - "output.mime_type": "application/json" - } - }, - { - "name": "factorial", - "parent": "generate_report", - "span_type": "function_call_async", - "attributes": { - "input.mime_type": "application/json", - "output.mime_type": "application/json", - "input.value": "{\"i\": 5}", - "output.value": "120" - } - }, - { - "name": "factorial", - "parent": "factorial", - "span_type": "function_call_async", - "attributes": { - "input.mime_type": "application/json", - "output.mime_type": "application/json", - "input.value": "{\"i\": 4}", - "output.value": "24" - } - }, - { - "name": "factorial", - "parent": "factorial", - "span_type": "function_call_async", - "attributes": { - "input.mime_type": "application/json", - "output.mime_type": "application/json", - "input.value": "{\"i\": 3}", - "output.value": "6" - } - }, - { - "name": "factorial", - "parent": "factorial", - "span_type": "function_call_async", - "attributes": { - "input.mime_type": "application/json", - "output.mime_type": "application/json", - "input.value": "{\"i\": 2}", - "output.value": "2" - } - }, - { - "name": "factorial", - "parent": "factorial", - "span_type": "function_call_async", - "attributes": { - "input.mime_type": "application/json", - "output.mime_type": "application/json", - "input.value": "{\"i\": 1}", - "output.value": "1" - } - } - ] -} +{ + "description": "Langchain cross and traced - checks key spans exist with parent relationships", + "required_spans": [ + { + "name": "LangGraph", + "parent": null, + "attributes": { + "openinference.span.kind": "CHAIN" + } + }, + { + "name": "generate_report", + "parent": "LangGraph", + "attributes": { + "openinference.span.kind": "CHAIN" + } + }, + { + "name": "my_custom_traceable_function", + "parent": "generate_report", + "span_type": "function_call_sync", + "attributes": { + "input.mime_type": "application/json", + "output.mime_type": "application/json" + } + }, + { + "name": "my_custom_traced_function", + "parent": "generate_report", + "span_type": "function_call_sync", + "attributes": { + "input.mime_type": "application/json", + "output.mime_type": "application/json" + } + }, + { + "name": "my_custom_nested_traced_function", + "parent": "my_custom_traced_function", + "span_type": "function_call_sync", + "attributes": { + "input.mime_type": "application/json", + "output.mime_type": "application/json" + } + }, + { + "name": "factorial", + "parent": "generate_report", + "span_type": "function_call_async", + "attributes": { + "input.mime_type": "application/json", + "output.mime_type": "application/json", + "input.value": "{\"i\": 5}", + "output.value": "120" + } + }, + { + "name": "factorial", + "parent": "factorial", + "span_type": "function_call_async", + "attributes": { + "input.mime_type": "application/json", + "output.mime_type": "application/json", + "input.value": "{\"i\": 4}", + "output.value": "24" + } + }, + { + "name": "factorial", + "parent": "factorial", + "span_type": "function_call_async", + "attributes": { + "input.mime_type": "application/json", + "output.mime_type": "application/json", + "input.value": "{\"i\": 3}", + "output.value": "6" + } + }, + { + "name": "factorial", + "parent": "factorial", + "span_type": "function_call_async", + "attributes": { + "input.mime_type": "application/json", + "output.mime_type": "application/json", + "input.value": "{\"i\": 2}", + "output.value": "2" + } + }, + { + "name": "factorial", + "parent": "factorial", + "span_type": "function_call_async", + "attributes": { + "input.mime_type": "application/json", + "output.mime_type": "application/json", + "input.value": "{\"i\": 1}", + "output.value": "1" + } + } + ] +} diff --git a/packages/uipath/testcases/langchain-cross/pyproject.toml b/packages/uipath/testcases/langchain-cross/pyproject.toml index 58c3c38d2..058c8ef4d 100644 --- a/packages/uipath/testcases/langchain-cross/pyproject.toml +++ b/packages/uipath/testcases/langchain-cross/pyproject.toml @@ -1,14 +1,14 @@ -[project] -name = "agent" -version = "0.0.1" -description = "agent" -authors = [{ name = "John Doe", email = "john.doe@myemail.com" }] +[project] +name = "agent" +version = "0.0.1" +description = "agent" +authors = [{ name = "John Doe", email = "john.doe@myemail.com" }] dependencies = [ "uipath-langchain>=0.14.0,<0.15.0", "uipath" ] -requires-python = ">=3.11" - +requires-python = ">=3.11" + [tool.uv.sources] uipath = { path = "../../", editable = true } uipath-core = { path = "../../../uipath-core", editable = true } diff --git a/packages/uipath/testcases/langchain-cross/src/assert.py.orig b/packages/uipath/testcases/langchain-cross/src/assert.py.orig index db1830133..4bbfef399 100644 --- a/packages/uipath/testcases/langchain-cross/src/assert.py.orig +++ b/packages/uipath/testcases/langchain-cross/src/assert.py.orig @@ -49,53 +49,53 @@ assert_traces(".uipath/traces.jsonl", "expected_traces.json") print("Required fields validation passed") print(f"Output structure validation passed - report: '{actual_report}'") ======= -import json -import os -from trace_assert import assert_traces - -# Check NuGet package -uipath_dir = ".uipath" -assert os.path.exists(uipath_dir), "NuGet package directory (.uipath) not found" - -nupkg_files = [f for f in os.listdir(uipath_dir) if f.endswith(".nupkg")] -assert nupkg_files, "NuGet package file (.nupkg) not found in .uipath directory" - -print(f"NuGet package found: {nupkg_files[0]}") - -# Check agent output file -output_file = "__uipath/output.json" -assert os.path.isfile(output_file), "Agent output file not found" - -print("Agent output file found") - -# Check status and required fields -with open(output_file, "r", encoding="utf-8") as f: - output_data = json.load(f) - -# Check status -status = output_data.get("status") -assert status == "successful", f"Agent execution failed with status: {status}" - -print("Agent execution status: successful") - -# Check required fields and structure -assert "output" in output_data, "Missing 'output' field in agent response" - -# Check the specific structure of the output -output_section = output_data.get("output") -assert isinstance(output_section, dict), "Output field should be a dictionary" -assert "report" in output_section, "Missing 'report' field in output section" - -# Check the specific report content -expected_report = "Just a sanity report" -actual_report = output_section.get("report") -assert actual_report == expected_report, ( - f"Expected report: '{expected_report}', but got: '{actual_report}'" -) - -# Simple trace assertions - just check that expected spans exist -assert_traces(".uipath/traces.jsonl", "expected_traces.json") - -print("Required fields validation passed") -print(f"Output structure validation passed - report: '{actual_report}'") +import json +import os +from trace_assert import assert_traces + +# Check NuGet package +uipath_dir = ".uipath" +assert os.path.exists(uipath_dir), "NuGet package directory (.uipath) not found" + +nupkg_files = [f for f in os.listdir(uipath_dir) if f.endswith(".nupkg")] +assert nupkg_files, "NuGet package file (.nupkg) not found in .uipath directory" + +print(f"NuGet package found: {nupkg_files[0]}") + +# Check agent output file +output_file = "__uipath/output.json" +assert os.path.isfile(output_file), "Agent output file not found" + +print("Agent output file found") + +# Check status and required fields +with open(output_file, "r", encoding="utf-8") as f: + output_data = json.load(f) + +# Check status +status = output_data.get("status") +assert status == "successful", f"Agent execution failed with status: {status}" + +print("Agent execution status: successful") + +# Check required fields and structure +assert "output" in output_data, "Missing 'output' field in agent response" + +# Check the specific structure of the output +output_section = output_data.get("output") +assert isinstance(output_section, dict), "Output field should be a dictionary" +assert "report" in output_section, "Missing 'report' field in output section" + +# Check the specific report content +expected_report = "Just a sanity report" +actual_report = output_section.get("report") +assert actual_report == expected_report, ( + f"Expected report: '{expected_report}', but got: '{actual_report}'" +) + +# Simple trace assertions - just check that expected spans exist +assert_traces(".uipath/traces.jsonl", "expected_traces.json") + +print("Required fields validation passed") +print(f"Output structure validation passed - report: '{actual_report}'") >>>>>>> 13298dfa (feat(tests): add traces testcase) diff --git a/packages/uipath/testcases/llamaindexcross/agent.mermaid b/packages/uipath/testcases/llamaindexcross/agent.mermaid index 723243021..5f1583777 100644 --- a/packages/uipath/testcases/llamaindexcross/agent.mermaid +++ b/packages/uipath/testcases/llamaindexcross/agent.mermaid @@ -1,17 +1,17 @@ -flowchart TD - step__done["_done"]:::stepStyle - step_critique_joke["critique_joke"]:::stepStyle - step_generate_joke["generate_joke"]:::stepStyle - event_JokeEvent([

JokeEvent

]):::defaultEventStyle - event_CritiqueEvent([

CritiqueEvent

]):::stopEventStyle - event_TopicEvent([

TopicEvent

]):::defaultEventStyle - event_CritiqueEvent --> step__done - step_critique_joke --> event_CritiqueEvent - event_JokeEvent --> step_critique_joke - step_generate_joke --> event_JokeEvent - event_TopicEvent --> step_generate_joke - classDef stepStyle fill:#f2f0ff,line-height:1.2 - classDef externalStyle fill:#f2f0ff,line-height:1.2 - classDef defaultEventStyle fill-opacity:0 - classDef stopEventStyle fill:#bfb6fc +flowchart TD + step__done["_done"]:::stepStyle + step_critique_joke["critique_joke"]:::stepStyle + step_generate_joke["generate_joke"]:::stepStyle + event_JokeEvent([

JokeEvent

]):::defaultEventStyle + event_CritiqueEvent([

CritiqueEvent

]):::stopEventStyle + event_TopicEvent([

TopicEvent

]):::defaultEventStyle + event_CritiqueEvent --> step__done + step_critique_joke --> event_CritiqueEvent + event_JokeEvent --> step_critique_joke + step_generate_joke --> event_JokeEvent + event_TopicEvent --> step_generate_joke + classDef stepStyle fill:#f2f0ff,line-height:1.2 + classDef externalStyle fill:#f2f0ff,line-height:1.2 + classDef defaultEventStyle fill-opacity:0 + classDef stopEventStyle fill:#bfb6fc classDef inputRequiredStyle fill:#f2f0ff,line-height:1.2 \ No newline at end of file diff --git a/packages/uipath/testcases/llamaindexcross/pyproject.toml b/packages/uipath/testcases/llamaindexcross/pyproject.toml index 3cb977f82..22d5c2450 100644 --- a/packages/uipath/testcases/llamaindexcross/pyproject.toml +++ b/packages/uipath/testcases/llamaindexcross/pyproject.toml @@ -1,13 +1,13 @@ -[project] -name = "agent" -version = "0.0.1" -description = "agent" -authors = [{ name = "John Doe", email = "john.doe@myemail.com" }] -dependencies = [ - "uipath-llamaindex>=0.0.27", - "uipath" -] -requires-python = ">=3.11" - -[tool.uv.sources] +[project] +name = "agent" +version = "0.0.1" +description = "agent" +authors = [{ name = "John Doe", email = "john.doe@myemail.com" }] +dependencies = [ + "uipath-llamaindex>=0.0.27", + "uipath" +] +requires-python = ">=3.11" + +[tool.uv.sources] uipath = { path = "../../", editable = true } \ No newline at end of file