diff --git a/pyproject.toml b/pyproject.toml index de2205318..cdf3fcb06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "uipath-langchain" -version = "0.10.20" +version = "0.10.21" description = "Python SDK that enables developers to build and deploy LangGraph agents to the UiPath Cloud Platform" readme = { file = "README.md", content-type = "text/markdown" } requires-python = ">=3.11" diff --git a/src/uipath_langchain/_cli/cli_init.py b/src/uipath_langchain/_cli/cli_init.py index a797dcc7e..9fa91848e 100644 --- a/src/uipath_langchain/_cli/cli_init.py +++ b/src/uipath_langchain/_cli/cli_init.py @@ -35,14 +35,11 @@ def generate_agent_md_file( target_directory: The directory where the file should be created. file_name: The name of the file should be created. resource_name: The name of the resource folder where should be the file. - no_agents_md_override: Whether to override existing files. + no_agents_md_override: When True, do not overwrite an existing file. Returns: - A tuple of (file_name, status) where status is a FileOperationStatus: - - CREATED: File was created - - UPDATED: File was overwritten - - SKIPPED: File exists and no_agents_md_override is True - Returns None if an error occurred. + A tuple of (file_name, status) where status is a FileOperationStatus, + or None if an error occurred. """ target_path = os.path.join(target_directory, file_name) will_override = os.path.exists(target_path) @@ -68,54 +65,70 @@ def generate_agent_md_file( def generate_specific_agents_md_files( - target_directory: str, no_agents_md_override: bool + target_directory: str, + no_agents_md_override: bool, + with_offline_docs: bool = False, ) -> Generator[tuple[str, FileOperationStatus], None, None]: - """Generate agent-specific files from the packaged resource. + """Generate AGENTS.md (and a CLAUDE.md shim), optionally bundling the offline docs. Args: target_directory: The directory where the files should be created. - no_agents_md_override: Whether to override existing files. + no_agents_md_override: When True, do not overwrite existing AGENTS.md/CLAUDE.md. + with_offline_docs: When True, copy llms-full.txt to .uipath/ as an offline fallback. Yields: - Tuple of (file_name, status) for each file operation, where status is a FileOperationStatus: - - CREATED: File was created - - UPDATED: File was overwritten - - SKIPPED: File exists and was not overwritten + Tuple of (file_name, status) for each file operation. """ - agent_dir = os.path.join(target_directory, ".agent") - os.makedirs(agent_dir, exist_ok=True) - - file_configs = [ - (target_directory, "CLAUDE.md", "uipath._resources"), - (agent_dir, "CLI_REFERENCE.md", "uipath._resources"), - (agent_dir, "SDK_REFERENCE.md", "uipath._resources"), - (target_directory, "AGENTS.md", "uipath_langchain._resources"), - (agent_dir, "REQUIRED_STRUCTURE.md", "uipath_langchain._resources"), - ] - - for directory, file_name, resource_name in file_configs: - result = generate_agent_md_file( - directory, file_name, resource_name, no_agents_md_override - ) - if result: - yield result + result = generate_agent_md_file( + target_directory, + "AGENTS.md", + "uipath_langchain._resources", + no_agents_md_override, + ) + if result: + yield result + + claude_result = generate_agent_md_file( + target_directory, + "CLAUDE.md", + "uipath_langchain._resources", + no_agents_md_override, + ) + if claude_result: + yield claude_result + + if with_offline_docs: + uipath_dir = os.path.join(target_directory, ".uipath") + os.makedirs(uipath_dir, exist_ok=True) + try: + source = importlib.resources.files("uipath._resources").joinpath( + "llms-full.txt" + ) + with importlib.resources.as_file(source) as s_path: + shutil.copy(s_path, os.path.join(uipath_dir, "llms-full.txt")) + except (FileNotFoundError, ModuleNotFoundError): + pass + else: + agents_path = os.path.join(target_directory, "AGENTS.md") + with open(agents_path, "a", encoding="utf-8") as f: + f.write( + "\n3. If neither of the above is reachable, read " + "`.uipath/llms-full.txt` (offline fallback bundled with this project).\n" + ) def generate_agents_md_files(options: dict[str, Any]) -> None: - """Generate agent MD files and log categorized summary. - - Args: - options: Options dictionary - """ + """Generate AGENTS.md and log a summary.""" current_directory = os.getcwd() no_agents_md_override = options.get("no_agents_md_override", False) + with_offline_docs = options.get("with_offline_docs", False) created_files = [] updated_files = [] skipped_files = [] for file_name, status in generate_specific_agents_md_files( - current_directory, no_agents_md_override + current_directory, no_agents_md_override, with_offline_docs ): if status == FileOperationStatus.CREATED: created_files.append(file_name) diff --git a/src/uipath_langchain/_resources/AGENTS.md b/src/uipath_langchain/_resources/AGENTS.md index c1f02680a..4c4e4a2d0 100644 --- a/src/uipath_langchain/_resources/AGENTS.md +++ b/src/uipath_langchain/_resources/AGENTS.md @@ -1,21 +1,9 @@ -# Agent Code Patterns Reference +# UiPath LangGraph Project -This document provides practical code patterns for building UiPath coded agents using LangGraph and the UiPath Python SDK. +For SDK and CLI knowledge, follow this order: ---- +1. Run `uip skills install` (install the CLI first if needed: `npm install -g @uipath/cli`). + Recommended skills: `uipath-agents`, `uipath-platform`. -## Documentation Structure - -This documentation is split into multiple files for efficient context loading. Load only the files you need: - -1. **@.agent/REQUIRED_STRUCTURE.md** - Agent structure patterns and templates - - **When to load:** Creating a new agent or understanding required patterns - - **Contains:** Required Pydantic models (Input, State, Output), LLM initialization patterns, standard agent template - -2. **@.agent/SDK_REFERENCE.md** - Complete SDK API reference - - **When to load:** Calling UiPath SDK methods, working with services (actions, assets, jobs, etc.) - - **Contains:** All SDK services and methods with full signatures and type annotations - -3. **@.agent/CLI_REFERENCE.md** - CLI commands documentation - - **When to load:** Working with `uipath init`, `uipath run`, or `uipath eval` commands - - **Contains:** Command syntax, options, usage examples, and workflows +2. If `uip` is unavailable, fetch `https://uipath.github.io/uipath-python/llms.txt` + and follow the linked sections on demand. diff --git a/src/uipath_langchain/_resources/CLAUDE.md b/src/uipath_langchain/_resources/CLAUDE.md new file mode 100644 index 000000000..43c994c2d --- /dev/null +++ b/src/uipath_langchain/_resources/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/src/uipath_langchain/_resources/REQUIRED_STRUCTURE.md b/src/uipath_langchain/_resources/REQUIRED_STRUCTURE.md deleted file mode 100644 index a8d245123..000000000 --- a/src/uipath_langchain/_resources/REQUIRED_STRUCTURE.md +++ /dev/null @@ -1,92 +0,0 @@ -## Required Agent Structure - -**IMPORTANT**: All UiPath coded agents MUST follow this standard structure unless explicitly specified otherwise by the user. - -### Required Components - -Every agent implementation MUST include these three Pydantic models: - -```python -from pydantic import BaseModel - -class Input(BaseModel): - """Define input fields that the agent accepts""" - # Add your input fields here - pass - -class State(BaseModel): - """Define the agent's internal state that flows between nodes""" - # Add your state fields here - pass - -class Output(BaseModel): - """Define output fields that the agent returns""" - # Add your output fields here - pass -``` - -### Required LLM Initialization - -Unless the user explicitly requests a different LLM provider, always use `UiPathChat`: - -```python -from uipath_langchain.chat import UiPathChat - -llm = UiPathChat(model="gpt-4.1-mini-2025-04-14", temperature=0.7) -``` - -**Alternative LLMs** (only use if explicitly requested): -- `ChatOpenAI` from `langchain_openai` -- `ChatAnthropic` from `langchain_anthropic` -- Other LangChain-compatible LLMs - -### Standard Agent Template - -Every agent should follow this basic structure: - -```python -from langchain_core.messages import SystemMessage, HumanMessage -from langgraph.graph import START, StateGraph, END -from uipath_langchain.chat import UiPathChat -from pydantic import BaseModel - -# 1. Define Input, State, and Output models -class Input(BaseModel): - field: str - -class State(BaseModel): - field: str - result: str = "" - -class Output(BaseModel): - result: str - -# 2. Initialize UiPathChat LLM -llm = UiPathChat(model="gpt-4.1-mini-2025-04-14", temperature=0.7) - -# 3. Define agent nodes (async functions) -async def process_node(state: State) -> State: - response = await llm.ainvoke([HumanMessage(state.field)]) - return State(field=state.field, result=response.content) - -async def output_node(state: State) -> Output: - return Output(result=state.result) - -# 4. Build the graph -builder = StateGraph(State, input=Input, output=Output) -builder.add_node("process", process_node) -builder.add_node("output", output_node) -builder.add_edge(START, "process") -builder.add_edge("process", "output") -builder.add_edge("output", END) - -# 5. Compile the graph -graph = builder.compile() -``` - -**Key Rules**: -1. Always use async/await for all node functions -2. All nodes (except output) must accept and return `State` -3. The final output node must return `Output` -4. Use `StateGraph(State, input=Input, output=Output)` for initialization -5. Always compile with `graph = builder.compile()` diff --git a/template/.agent/CLI_REFERENCE.md b/template/.agent/CLI_REFERENCE.md deleted file mode 100644 index 98524ddfd..000000000 --- a/template/.agent/CLI_REFERENCE.md +++ /dev/null @@ -1,948 +0,0 @@ -## CLI Commands Reference - -The UiPath Python SDK provides a comprehensive CLI for managing coded agents and automation projects. All commands should be executed with `uv run uipath `. - -### Command Overview - -| Command | Purpose | When to Use | -|---------|---------|-------------| -| `init` | Initialize agent project | Creating a new agent or updating schema | -| `run` | Execute agent | Running agent locally or testing | -| `eval` | Evaluate agent | Testing agent performance with evaluation sets | - ---- - -### `uipath init` - -**Description:** Initialize the project. - -**Options:** - -| Option | Type | Default | Description | -|--------|------|---------|-------------| -| `--no-agents-md-override` | flag | false | Won't override existing .agent files and AGENTS.md file. | - -**Usage Examples:** - -```bash -# Initialize a new agent project -uv run uipath init - -# Initialize with specific entrypoint -uv run uipath init main.py - -# Initialize and infer bindings from code -uv run uipath init --infer-bindings -``` - -**When to use:** Run this command when you've modified the Input/Output models and need to regenerate the `uipath.json` schema file. - ---- - -### `uipath run` - -**Description:** Execute the project. - -**Arguments:** - -| Argument | Required | Description | -|----------|----------|-------------| -| `entrypoint` | No | N/A | -| `input` | No | N/A | - -**Options:** - -| Option | Type | Default | Description | -|--------|------|---------|-------------| -| `--resume` | flag | false | Resume execution from a previous state | -| `-f`, `--file` | value | `Sentinel.UNSET` | File path for the .json input | -| `--input-file` | value | `Sentinel.UNSET` | Alias for '-f/--file' arguments | -| `--output-file` | value | `Sentinel.UNSET` | File path where the output will be written | -| `--trace-file` | value | `Sentinel.UNSET` | File path where the trace spans will be written (JSON Lines format) | -| `--state-file` | value | `Sentinel.UNSET` | File path where the state file is stored for persisting execution state. If not provided, a temporary file will be used. | -| `--debug` | flag | false | Enable debugging with debugpy. The process will wait for a debugger to attach. | -| `--debug-port` | value | `5678` | Port for the debug server (default: 5678) | -| `--keep-state-file` | flag | false | Keep the temporary state file even when not resuming and no job id is provided | - -**Usage Examples:** - -```bash -# Run agent with inline JSON input -uv run uipath run main.py '{"query": "What is the weather?"}' - -# Run agent with input from file -uv run uipath run main.py --file input.json - -# Run agent and save output to file -uv run uipath run agent '{"task": "Process data"}' --output-file result.json - -# Run agent with debugging enabled -uv run uipath run main.py '{"input": "test"}' --debug --debug-port 5678 - -# Resume agent execution from previous state -uv run uipath run --resume -``` - -**When to use:** Run this command to execute your agent locally for development, testing, or debugging. Use `--debug` flag to attach a debugger for step-by-step debugging. - ---- - -### `uipath eval` - -**Description:** Run an evaluation set against the agent. - - Args: - entrypoint: Path to the agent script to evaluate (optional, will auto-discover if not specified) - eval_set: Path to the evaluation set JSON file (optional, will auto-discover if not specified) - eval_ids: Optional list of evaluation IDs - eval_set_run_id: Custom evaluation set run ID (optional, will generate UUID if not specified) - workers: Number of parallel workers for running evaluations - no_report: Do not report the evaluation results - enable_mocker_cache: Enable caching for LLM mocker responses - report_coverage: Report evaluation coverage - model_settings_id: Model settings ID to override agent settings - trace_file: File path where traces will be written in JSONL format - max_llm_concurrency: Maximum concurrent LLM requests - input_overrides: Input field overrides mapping (direct field override with deep merge) - resume: Resume execution from a previous suspended state - - -**Arguments:** - -| Argument | Required | Description | -|----------|----------|-------------| -| `entrypoint` | No | N/A | -| `eval_set` | No | N/A | - -**Options:** - -| Option | Type | Default | Description | -|--------|------|---------|-------------| -| `--eval-set-run-id` | value | `Sentinel.UNSET` | Custom evaluation set run ID (if not provided, a UUID will be generated) | -| `--no-report` | flag | false | Do not report the evaluation results | -| `--workers` | value | `1` | Number of parallel workers for running evaluations (default: 1) | -| `--output-file` | value | `Sentinel.UNSET` | File path where the output will be written | -| `--enable-mocker-cache` | flag | false | Enable caching for LLM mocker responses | -| `--report-coverage` | flag | false | Report evaluation coverage | -| `--model-settings-id` | value | `"default"` | Model settings ID from evaluation set to override agent settings (default: 'default') | -| `--trace-file` | value | `Sentinel.UNSET` | File path where traces will be written in JSONL format | -| `--max-llm-concurrency` | value | `20` | Maximum concurrent LLM requests (default: 20) | -| `--resume` | flag | false | Resume execution from a previous suspended state | -| `--verbose` | flag | false | Include agent execution output (trace, result) in the output file | - -**Usage Examples:** - -```bash -# Run evaluation with auto-discovered files -uv run uipath eval - -# Run evaluation with specific entrypoint and eval set -uv run uipath eval main.py eval_set.json - -# Run evaluation without reporting results -uv run uipath eval --no-report - -# Run evaluation with custom number of workers -uv run uipath eval --workers 4 - -# Save evaluation output to file -uv run uipath eval --output-file eval_results.json -``` - -**When to use:** Run this command to test your agent's performance against a predefined evaluation set. This helps validate agent behavior and measure quality metrics. - ---- - -### Common Workflows - -**1. Creating a New Agent:** -```bash -# Step 1: Initialize project -uv run uipath init - -# Step 2: Run agent to test -uv run uipath run main.py '{"input": "test"}' - -# Step 3: Evaluate agent performance -uv run uipath eval -``` - -**2. Development & Testing:** -```bash -# Run with debugging -uv run uipath run main.py '{"input": "test"}' --debug - -# Test with input file -uv run uipath run main.py --file test_input.json --output-file test_output.json -``` - -**3. Schema Updates:** -```bash -# After modifying Input/Output models, regenerate schema -uv run uipath init --infer-bindings -``` - -### Configuration File (uipath.json) - -The `uipath.json` file is automatically generated by `uipath init` and defines your agent's schema and bindings. - -**Structure:** - -```json -{ - "entryPoints": [ - { - "filePath": "agent", - "uniqueId": "uuid-here", - "type": "agent", - "input": { - "type": "object", - "properties": { ... }, - "description": "Input schema", - "required": [ ... ] - }, - "output": { - "type": "object", - "properties": { ... }, - "description": "Output schema", - "required": [ ... ] - } - } - ], - "bindings": { - "version": "2.0", - "resources": [] - } -} -``` - -**When to Update:** - -1. **After Modifying Input/Output Models**: Run `uv run uipath init --infer-bindings` to regenerate schemas -2. **Changing Entry Point**: Update `filePath` if you rename or move your main file -3. **Manual Schema Adjustments**: Edit `input.jsonSchema` or `output.jsonSchema` directly if needed -4. **Bindings Updates**: The `bindings` section maps the exported graph variable - update if you rename your graph - -**Important Notes:** - -- The `uniqueId` should remain constant for the same agent -- Always use `type: "agent"` for LangGraph agents -- The `jsonSchema` must match your Pydantic models exactly -- Re-run `uipath init --infer-bindings` instead of manual edits when possible - - -## Service Commands Reference - -The UiPath CLI provides commands for interacting with UiPath platform services. These commands allow you to manage buckets, assets, jobs, and other resources. - -### `uipath assets` - -Manage UiPath assets. - - Assets are key-value pairs that store configuration data, credentials, - and settings used by automation processes. - - \b - Examples: - # List all assets in a folder - uipath assets list --folder-path "Shared" - - # List with filter - uipath assets list --filter "ValueType eq 'Text'" - - # List with ordering - uipath assets list --orderby "Name asc" - - -**Subcommands:** - -**`uipath assets list`** - -List assets in a folder. - - \b - Examples: - uipath assets list - uipath assets list --folder-path "Shared" - uipath assets list --filter "ValueType eq 'Text'" - uipath assets list --filter "Name eq 'MyAsset'" - uipath assets list --orderby "Name asc" - uipath assets list --top 50 --skip 100 - - -Options: -- `--filter`: OData $filter expression (default: `Sentinel.UNSET`) -- `--orderby`: OData $orderby expression (default: `Sentinel.UNSET`) -- `--top`: Maximum number of items to return (default: 100, max: 1000) (default: `100`) -- `--skip`: Number of items to skip (default: `0`) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - ---- - -### `uipath buckets` - -Manage UiPath storage buckets and files. - -Buckets are cloud storage containers for files used by automation processes. - - -Bucket Operations: - list - List all buckets - create - Create a new bucket - delete - Delete a bucket - retrieve - Get bucket details - exists - Check if bucket exists - - -File Operations (use 'buckets files' subcommand): - files list - List files in a bucket - files search - Search files using glob patterns - files upload - Upload a file to a bucket - files download - Download a file from a bucket - files delete - Delete a file from a bucket - files exists - Check if a file exists - - -Examples: -  - # Bucket operations with explicit folder - uipath buckets list --folder-path "Shared" - uipath buckets create my-bucket --description "Data storage" - uipath buckets exists my-bucket - uipath buckets delete my-bucket --confirm -  - # Using environment variable for folder context - export UIPATH_FOLDER_PATH="Shared" - uipath buckets list - uipath buckets create my-bucket --description "Data storage" -  - # File operations - uipath buckets files list my-bucket - uipath buckets files search my-bucket "*.pdf" - uipath buckets files upload my-bucket ./data.csv remote/data.csv - uipath buckets files download my-bucket data.csv ./local.csv - uipath buckets files delete my-bucket old-data.csv --confirm - uipath buckets files exists my-bucket data.csv - - -**Subcommands:** - -**`uipath buckets create`** - -Create a new Bucket. - -Examples: - uipath buckets create my-resource - uipath buckets create my-resource --folder-path Shared - - -Arguments: -- `name` (required): N/A - -Options: -- `--description`: Bucket description -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath buckets delete`** - -Delete a bucket. - -  - Examples: - uipath buckets delete my-bucket --confirm - uipath buckets delete my-bucket --dry-run - - -Arguments: -- `name` (required): N/A - -Options: -- `--confirm`: Skip confirmation prompt -- `--dry-run`: Show what would be deleted without deleting -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath buckets exists`** - -Check if a Bucket exists. - -Examples: - uipath buckets exists my-resource - uipath buckets exists my-resource --folder-path Shared - - -Arguments: -- `name` (required): N/A - -Options: -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -#### `uipath buckets files` - -Manage files within buckets. - -  - Examples: -  - # List files in a bucket - uipath buckets files list my-bucket -  - # Search for files with glob pattern - uipath buckets files search my-bucket "*.pdf" -  - # Upload a file - uipath buckets files upload my-bucket ./data.csv remote/data.csv -  - # Download a file - uipath buckets files download my-bucket data.csv ./local.csv -  - # Delete a file - uipath buckets files delete my-bucket old-data.csv --confirm -  - # Check if file exists - uipath buckets files exists my-bucket data.csv - - -**`uipath buckets files delete`** - -Delete a file from a bucket. - -  - Arguments: - BUCKET_NAME: Name of the bucket - FILE_PATH: Path to file in bucket - -  - Examples: - uipath buckets files delete my-bucket old-data.csv --confirm - uipath buckets files delete reports archive/old.pdf --dry-run - - -Arguments: -- `bucket_name` (required): N/A -- `file_path` (required): N/A - -Options: -- `--confirm`: Skip confirmation prompt -- `--dry-run`: Show what would be deleted -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath buckets files download`** - -Download a file from a bucket. - -  - Arguments: - BUCKET_NAME: Name of the bucket - REMOTE_PATH: Path to file in bucket - LOCAL_PATH: Local destination path - -  - Examples: - uipath buckets files download my-bucket data.csv ./downloads/data.csv - uipath buckets files download reports monthly/report.pdf ./report.pdf - - -Arguments: -- `bucket_name` (required): N/A -- `remote_path` (required): N/A -- `local_path` (required): N/A - -Options: -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath buckets files exists`** - -Check if a file exists in a bucket. - -  - Arguments: - BUCKET_NAME: Name of the bucket - FILE_PATH: Path to file in bucket - -  - Examples: - uipath buckets files exists my-bucket data.csv - uipath buckets files exists reports monthly/report.pdf - - -Arguments: -- `bucket_name` (required): N/A -- `file_path` (required): N/A - -Options: -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath buckets files list`** - -List files in a bucket. - -  - Arguments: - BUCKET_NAME: Name of the bucket - -  - Examples: - uipath buckets files list my-bucket - uipath buckets files list my-bucket --prefix "data/" - uipath buckets files list reports --limit 10 --format json - uipath buckets files list my-bucket --all - - -Arguments: -- `bucket_name` (required): N/A - -Options: -- `--prefix`: Filter files by prefix (default: ``) -- `--limit`: Maximum number of files to return (default: `Sentinel.UNSET`) -- `--offset`: Number of files to skip (default: `0`) -- `--all`: Fetch all files (auto-paginate) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath buckets files search`** - -Search for files using glob patterns. - - Uses the GetFiles API which supports glob patterns like *.pdf or data_*.csv. - -  - Arguments: - BUCKET_NAME: Name of the bucket - PATTERN: Glob pattern to match files (e.g., "*.pdf", "data_*.csv") - -  - Examples: - uipath buckets files search my-bucket "*.pdf" - uipath buckets files search reports "*.csv" --recursive - uipath buckets files search my-bucket "data_*.json" --prefix "archive/" - - -Arguments: -- `bucket_name` (required): N/A -- `pattern` (required): N/A - -Options: -- `--prefix`: Directory path to search in (default: ``) -- `--recursive`: Search subdirectories recursively -- `--limit`: Maximum number of files to return (default: `Sentinel.UNSET`) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath buckets files upload`** - -Upload a file to a bucket. - -  - Arguments: - BUCKET_NAME: Name of the bucket - LOCAL_PATH: Local file to upload - REMOTE_PATH: Destination path in bucket - -  - Examples: - uipath buckets files upload my-bucket ./data.csv remote/data.csv - uipath buckets files upload reports ./report.pdf monthly/report.pdf - - -Arguments: -- `bucket_name` (required): N/A -- `local_path` (required): N/A -- `remote_path` (required): N/A - -Options: -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath buckets list`** - -List all Buckets. - -Examples: - uipath buckets list - uipath buckets list --folder-path Shared - - -Options: -- `--limit`: Maximum number of items to return (default: `Sentinel.UNSET`) -- `--offset`: Number of items to skip (default: `0`) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath buckets retrieve`** - -Retrieve a bucket by name or key. - -  - Examples: - uipath buckets retrieve --name "my-bucket" - uipath buckets retrieve --key "abc-123-def-456" --format json - - -Options: -- `--name`: Bucket name (default: `Sentinel.UNSET`) -- `--key`: Bucket key (UUID) (default: `Sentinel.UNSET`) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - ---- - -### `uipath context-grounding` - -Manage UiPath Context Grounding indexes. - - Context Grounding indexes store and search contextual information - used to enhance AI-enabled automation processes. - -  - Two index types: - Regular - Persistent, backed by bucket or connection, created via 'create' - Ephemeral - Temporary, no Orchestrator folder, created from local files via 'create-ephemeral' - -  - Examples: - uipath context-grounding list --folder-path "Shared" - - -**Subcommands:** - -#### `uipath context-grounding batch-transform` - -Manage Batch Transform tasks. - - Batch Transform processes and transforms CSV files from context - grounding indexes. - -  - Examples: - uipath context-grounding batch-transform start --help - - -**`uipath context-grounding batch-transform download`** - -Download a Batch Transform result file. - -  - Examples: - uipath context-grounding batch-transform download --task-id abc-123 --output-file result.csv - - -Options: -- `--task-id`: ID of the Batch Transform task (default: `Sentinel.UNSET`) -- `--output-file`: Local destination path for the result file (default: `Sentinel.UNSET`) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath context-grounding batch-transform retrieve`** - -Retrieve a Batch Transform task status. - -  - Examples: - uipath context-grounding batch-transform retrieve --task-id abc-123-def-456 - - -Options: -- `--task-id`: ID of the Batch Transform task (default: `Sentinel.UNSET`) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath context-grounding batch-transform start`** - -Start a Batch Transform task on an index. - - The index must contain CSV files. Only one file is processed per task. - -  - Two ways to specify the index: - Regular index: --index-name + --folder-path - Ephemeral index: --index-id - -  - --columns-file is a JSON array defining output columns: - [ - {"name": "entity", "description": "Extracted entity name"}, - {"name": "category", "description": "Entity category"} - ] - -  - Examples: - uipath context-grounding batch-transform start --index-name my-index --task-name my-task --prompt "Extract" --columns-file cols.json - uipath context-grounding batch-transform start --index-id abc-123 --task-name my-task --prompt "Extract" --columns-file cols.json - - -Options: -- `--index-name`: Name of the context grounding index (default: `Sentinel.UNSET`) -- `--index-id`: ID of the context grounding index (ephemeral indexes only) (default: `Sentinel.UNSET`) -- `--task-name`: Name for the Batch Transform task (default: `Sentinel.UNSET`) -- `--prompt`: Task prompt describing what to process (default: `Sentinel.UNSET`) -- `--columns-file`: JSON file defining output columns (see format above) (default: `Sentinel.UNSET`) -- `--target-file`: Specific file name to target in the index (default: `Sentinel.UNSET`) -- `--prefix`: Storage bucket folder path prefix for filtering files (default: `Sentinel.UNSET`) -- `--web-search`: Enable web search grounding -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath context-grounding create`** - -Create a new context grounding index (persistent). - - The created index lives in an Orchestrator folder. Ingestion must be - triggered separately after creation. - -  - Two ways to specify the data source: - --bucket-source Bucket name for bucket-backed indexes - --source-file JSON file for connections (use 'source-schema' to see formats) - -  - Examples: - uipath context-grounding create --index-name my-index --bucket-source my-bucket - uipath context-grounding create --index-name my-index --source-file config.json - - -Options: -- `--index-name`: Name of the index to create (default: `Sentinel.UNSET`) -- `--source-file`: JSON file with connection source configuration (Google Drive, OneDrive, Dropbox, Confluence) (default: `Sentinel.UNSET`) -- `--bucket-source`: Bucket name for bucket-backed indexes (default: `Sentinel.UNSET`) -- `--description`: Description of the index (default: ``) -- `--extraction-strategy`: Extraction strategy (default: LLMV4) (default: `LLMV4`) -- `--file-type`: File type filter (e.g., 'pdf', 'txt') (default: `Sentinel.UNSET`) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath context-grounding create-ephemeral`** - -Create an ephemeral index from local files (temporary). - - Uploads files as attachments and creates a temporary index. Reference it - in other commands with --index-id (no folder, no name). Ingestion starts - automatically. Poll with 'retrieve --index-id ' until - lastIngestionStatus is Successful before starting a task. - -  - Supported file types: - DeepRAG: PDF, TXT - BatchRAG: CSV - -  - Examples: - uipath context-grounding create-ephemeral --usage DeepRAG --files doc1.pdf --files doc2.pdf - uipath context-grounding create-ephemeral --usage BatchRAG --files data.csv - - -Options: -- `--usage`: Task type for the ephemeral index (default: `Sentinel.UNSET`) -- `--files`: Local file paths to upload as attachments (repeatable) (default: `Sentinel.UNSET`) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -#### `uipath context-grounding deep-rag` - -Manage Deep RAG tasks. - - Deep RAG performs multi-document research and synthesis on context - grounding indexes. - -  - Examples: - uipath context-grounding deep-rag start --help - - -**`uipath context-grounding deep-rag retrieve`** - -Retrieve a Deep RAG task result (status, summary, citations). - -  - Examples: - uipath context-grounding deep-rag retrieve --task-id abc-123-def-456 - - -Options: -- `--task-id`: ID of the Deep RAG task (default: `Sentinel.UNSET`) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath context-grounding deep-rag start`** - -Start a Deep RAG task on an index. - -  - Two ways to specify the index: - Regular index: --index-name + --folder-path - Ephemeral index: --index-id - -  - Examples: - uipath context-grounding deep-rag start --index-name my-index --folder-path Shared --task-name my-task --prompt "Summarize" - uipath context-grounding deep-rag start --index-id abc-123 --task-name my-task --prompt "Summarize" - - -Options: -- `--index-name`: Name of the context grounding index (default: `Sentinel.UNSET`) -- `--index-id`: ID of the context grounding index (ephemeral indexes only) (default: `Sentinel.UNSET`) -- `--task-name`: Name for the Deep RAG task (default: `Sentinel.UNSET`) -- `--prompt`: Task prompt describing what to research (default: `Sentinel.UNSET`) -- `--glob-pattern`: Glob pattern to filter files in the index (default: **) (default: `**`) -- `--citation-mode`: Citation mode (default: Skip) (default: `Skip`) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath context-grounding delete`** - -Delete a context grounding index. - -  - Examples: - uipath context-grounding delete --index-name my-index --confirm - uipath context-grounding delete --index-name my-index --dry-run - - -Options: -- `--index-name`: Name of the index to delete (default: `Sentinel.UNSET`) -- `--confirm`: Skip confirmation prompt -- `--dry-run`: Show what would be deleted without deleting -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath context-grounding ingest`** - -Trigger ingestion on a context grounding index. - - Ingestion runs asynchronously. Use 'retrieve' to poll lastIngestionStatus - until it reaches Successful or Failed. - -  - Examples: - uipath context-grounding ingest --index-name my-index --folder-path "Shared" - - -Options: -- `--index-name`: Name of the index to ingest (default: `Sentinel.UNSET`) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath context-grounding list`** - -List all context grounding indexes. - -  - Examples: - uipath context-grounding list --folder-path "Shared" - - -Options: -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath context-grounding retrieve`** - -Retrieve a context grounding index. - -  - Two ways to specify the index: - Regular index: --index-name + --folder-path - Ephemeral index: --index-id - -  - Examples: - uipath context-grounding retrieve --index-name my-index --folder-path "Shared" - uipath context-grounding retrieve --index-id abc-123-def-456 --format json - - -Options: -- `--index-name`: Name of the index to retrieve (default: `Sentinel.UNSET`) -- `--index-id`: ID of the index to retrieve (ephemeral indexes only) (default: `Sentinel.UNSET`) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath context-grounding search`** - -Search a context grounding index (regular indexes only). - -  - Examples: - uipath context-grounding search --index-name my-index --query "What is the revenue?" - uipath context-grounding search --index-name my-index --query "results" --limit 5 - - -Options: -- `--index-name`: Name of the index to search (default: `Sentinel.UNSET`) -- `--query`: Search query in natural language (default: `Sentinel.UNSET`) -- `--limit`: Maximum number of results (default: 10) (default: `10`) -- `--threshold`: Minimum similarity threshold (default: 0.0) (default: `0.0`) -- `--search-mode`: Search mode (default: Auto) (default: `Auto`) -- `--folder-path`: Folder path (e.g., "Shared"). Can also be set via UIPATH_FOLDER_PATH environment variable. (default: `Sentinel.UNSET`) -- `--folder-key`: Folder key (UUID) (default: `Sentinel.UNSET`) -- `--format`: Output format (overrides global) (default: `Sentinel.UNSET`) -- `--output`, `-o`: Output file (overrides global) (default: `Sentinel.UNSET`) - -**`uipath context-grounding source-schema`** - -Show JSON source file formats for connection-backed indexes. - - Use this to see the required fields for --source-file when creating - an index backed by Google Drive, OneDrive, Dropbox, or Confluence. - -  - Examples: - uipath context-grounding source-schema --type google_drive - - -Options: -- `--type`: Show schema for a specific source type (omit to show all) (default: `Sentinel.UNSET`) - ---- - diff --git a/template/.agent/REQUIRED_STRUCTURE.md b/template/.agent/REQUIRED_STRUCTURE.md deleted file mode 100644 index a8d245123..000000000 --- a/template/.agent/REQUIRED_STRUCTURE.md +++ /dev/null @@ -1,92 +0,0 @@ -## Required Agent Structure - -**IMPORTANT**: All UiPath coded agents MUST follow this standard structure unless explicitly specified otherwise by the user. - -### Required Components - -Every agent implementation MUST include these three Pydantic models: - -```python -from pydantic import BaseModel - -class Input(BaseModel): - """Define input fields that the agent accepts""" - # Add your input fields here - pass - -class State(BaseModel): - """Define the agent's internal state that flows between nodes""" - # Add your state fields here - pass - -class Output(BaseModel): - """Define output fields that the agent returns""" - # Add your output fields here - pass -``` - -### Required LLM Initialization - -Unless the user explicitly requests a different LLM provider, always use `UiPathChat`: - -```python -from uipath_langchain.chat import UiPathChat - -llm = UiPathChat(model="gpt-4.1-mini-2025-04-14", temperature=0.7) -``` - -**Alternative LLMs** (only use if explicitly requested): -- `ChatOpenAI` from `langchain_openai` -- `ChatAnthropic` from `langchain_anthropic` -- Other LangChain-compatible LLMs - -### Standard Agent Template - -Every agent should follow this basic structure: - -```python -from langchain_core.messages import SystemMessage, HumanMessage -from langgraph.graph import START, StateGraph, END -from uipath_langchain.chat import UiPathChat -from pydantic import BaseModel - -# 1. Define Input, State, and Output models -class Input(BaseModel): - field: str - -class State(BaseModel): - field: str - result: str = "" - -class Output(BaseModel): - result: str - -# 2. Initialize UiPathChat LLM -llm = UiPathChat(model="gpt-4.1-mini-2025-04-14", temperature=0.7) - -# 3. Define agent nodes (async functions) -async def process_node(state: State) -> State: - response = await llm.ainvoke([HumanMessage(state.field)]) - return State(field=state.field, result=response.content) - -async def output_node(state: State) -> Output: - return Output(result=state.result) - -# 4. Build the graph -builder = StateGraph(State, input=Input, output=Output) -builder.add_node("process", process_node) -builder.add_node("output", output_node) -builder.add_edge(START, "process") -builder.add_edge("process", "output") -builder.add_edge("output", END) - -# 5. Compile the graph -graph = builder.compile() -``` - -**Key Rules**: -1. Always use async/await for all node functions -2. All nodes (except output) must accept and return `State` -3. The final output node must return `Output` -4. Use `StateGraph(State, input=Input, output=Output)` for initialization -5. Always compile with `graph = builder.compile()` diff --git a/template/.agent/SDK_REFERENCE.md b/template/.agent/SDK_REFERENCE.md deleted file mode 100644 index 4af1b60ae..000000000 --- a/template/.agent/SDK_REFERENCE.md +++ /dev/null @@ -1,803 +0,0 @@ -## API Reference - -This section provides a comprehensive reference for all UiPath SDK services and methods. Each service is documented with complete method signatures, including parameter types and return types. - -### SDK Initialization - -Initialize the UiPath SDK client - -```python -from uipath.platform import UiPath - -# Initialize with environment variables -sdk = UiPath() - -# Or with explicit credentials -sdk = UiPath(base_url="https://cloud.uipath.com/...", secret="your_token") -``` - -### Agenthub - -Agenthub service - -```python -# Fetch available models from LLM Gateway discovery endpoint. -sdk.agenthub.get_available_llm_models(headers: dict[str, Any] | None=None) -> list[uipath.platform.agenthub.agenthub.LlmModel] - -# Asynchronously fetch available models from LLM Gateway discovery endpoint. -sdk.agenthub.get_available_llm_models_async(headers: dict[str, Any] | None=None) -> list[uipath.platform.agenthub.agenthub.LlmModel] - -# Start a system agent job. -sdk.agenthub.invoke_system_agent(agent_name: str, entrypoint: str, input_arguments: dict[str, Any] | None=None, folder_key: str | None=None, folder_path: str | None=None, headers: dict[str, Any] | None=None) -> str - -# Asynchronously start a system agent and return the job. -sdk.agenthub.invoke_system_agent_async(agent_name: str, entrypoint: str, input_arguments: dict[str, Any] | None=None, folder_key: str | None=None, folder_path: str | None=None, headers: dict[str, Any] | None=None) -> str - -``` - -### Api Client - -Api Client service - -```python -# Access api_client service methods -service = sdk.api_client - -``` - -### Assets - -Assets service - -```python -# List assets using OData API with offset-based pagination. -sdk.assets.list(folder_path: Optional[str]=None, folder_key: Optional[str]=None, filter: Optional[str]=None, orderby: Optional[str]=None, skip: int=0, top: int=100) -> uipath.platform.common.paging.PagedResult[uipath.platform.orchestrator.assets.Asset] - -# Asynchronously list assets using OData API with offset-based pagination. -sdk.assets.list_async(folder_path: Optional[str]=None, folder_key: Optional[str]=None, filter: Optional[str]=None, orderby: Optional[str]=None, skip: int=0, top: int=100) -> uipath.platform.common.paging.PagedResult[uipath.platform.orchestrator.assets.Asset] - -# Retrieve an asset by its name. -sdk.assets.retrieve(name: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.platform.orchestrator.assets.UserAsset | uipath.platform.orchestrator.assets.Asset - -# Asynchronously retrieve an asset by its name. -sdk.assets.retrieve_async(name: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.platform.orchestrator.assets.UserAsset | uipath.platform.orchestrator.assets.Asset - -# Gets a specified Orchestrator credential. -sdk.assets.retrieve_credential(name: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> typing.Optional[str] - -# Asynchronously gets a specified Orchestrator credential. -sdk.assets.retrieve_credential_async(name: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> typing.Optional[str] - -# Update an asset's value. -sdk.assets.update(robot_asset: uipath.platform.orchestrator.assets.UserAsset, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> httpx.Response - -# Asynchronously update an asset's value. -sdk.assets.update_async(robot_asset: uipath.platform.orchestrator.assets.UserAsset, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> httpx.Response - -``` - -### Attachments - -Attachments service - -```python -# Delete an attachment. -sdk.attachments.delete(key: uuid.UUID, folder_key: str | None=None, folder_path: str | None=None) -> None - -# Delete an attachment asynchronously. -sdk.attachments.delete_async(key: uuid.UUID, folder_key: str | None=None, folder_path: str | None=None) -> None - -# Download an attachment. -sdk.attachments.download(key: uuid.UUID, destination_path: str, folder_key: str | None=None, folder_path: str | None=None) -> str - -# Download an attachment asynchronously. -sdk.attachments.download_async(key: uuid.UUID, destination_path: str, folder_key: str | None=None, folder_path: str | None=None) -> str - -# Get the BlobFileAccess information for an attachment. -sdk.attachments.get_blob_file_access_uri(key: uuid.UUID, folder_key: str | None=None, folder_path: str | None=None) -> uipath.platform.attachments.attachments.BlobFileAccessInfo - -# Get the BlobFileAccess information for an attachment asynchronously. -sdk.attachments.get_blob_file_access_uri_async(key: uuid.UUID, folder_key: str | None=None, folder_path: str | None=None) -> uipath.platform.attachments.attachments.BlobFileAccessInfo - -# Open an attachment. -sdk.attachments.open(attachment: uipath.platform.attachments.attachments.Attachment, mode: typing.Iterator[typing.Tuple[uipath.platform.attachments.attachments.Attachment, httpx.Response]] - -# Open an attachment asynchronously. -sdk.attachments.open_async(attachment: uipath.platform.attachments.attachments.Attachment, mode: typing.AsyncIterator[typing.Tuple[uipath.platform.attachments.attachments.Attachment, httpx.Response]] - -# Upload a file or content to UiPath as an attachment. -sdk.attachments.upload(name: str, content: str | bytes | None=None, source_path: str | None=None, folder_key: str | None=None, folder_path: str | None=None) -> uuid.UUID - -# Upload a file or content to UiPath as an attachment asynchronously. -sdk.attachments.upload_async(name: str, content: str | bytes | None=None, source_path: str | None=None, folder_key: str | None=None, folder_path: str | None=None) -> uuid.UUID - -``` - -### Automation Tracker - -Automation Tracker service - -```python -# End tracking an operation within a transaction. -sdk.automation_tracker.end_operation(transaction_id: str, operation_id: str, name: str, fingerprint: str, parent_operation: Optional[str]=None, status: None - -# End tracking an operation within a transaction (async). -sdk.automation_tracker.end_operation_async(transaction_id: str, operation_id: str, name: str, fingerprint: str, parent_operation: Optional[str]=None, status: None - -# End tracking a business transaction. -sdk.automation_tracker.end_transaction(transaction_id: str, name: str, reference: str, fingerprint: str, status: None - -# End tracking a business transaction (async). -sdk.automation_tracker.end_transaction_async(transaction_id: str, name: str, reference: str, fingerprint: str, status: None - -# Start tracking an operation within a transaction. -sdk.automation_tracker.start_operation(transaction_id: str, operation_id: str, name: str, fingerprint: str, parent_operation: Optional[str]=None, status: None - -# Start tracking an operation within a transaction (async). -sdk.automation_tracker.start_operation_async(transaction_id: str, operation_id: str, name: str, fingerprint: str, parent_operation: Optional[str]=None, status: None - -# Start tracking a business transaction. -sdk.automation_tracker.start_transaction(transaction_id: str, name: str, reference: str, fingerprint: str, status: None - -# Start tracking a business transaction (async). -sdk.automation_tracker.start_transaction_async(transaction_id: str, name: str, reference: str, fingerprint: str, status: None - -``` - -### Buckets - -Buckets service - -```python -# Create a new bucket. -sdk.buckets.create(name: str, description: Optional[str]=None, identifier: Optional[str]=None, folder_path: Optional[str]=None, folder_key: Optional[str]=None) -> uipath.platform.orchestrator.buckets.Bucket - -# Async version of create(). -sdk.buckets.create_async(name: str, description: Optional[str]=None, identifier: Optional[str]=None, folder_path: Optional[str]=None, folder_key: Optional[str]=None) -> uipath.platform.orchestrator.buckets.Bucket - -# Delete a bucket. -sdk.buckets.delete(name: Optional[str]=None, key: Optional[str]=None, folder_path: Optional[str]=None, folder_key: Optional[str]=None) -> None - -# Async version of delete(). -sdk.buckets.delete_async(name: Optional[str]=None, key: Optional[str]=None, folder_path: Optional[str]=None, folder_key: Optional[str]=None) -> None - -# Delete a file from a bucket. -sdk.buckets.delete_file(name: Optional[str]=None, key: Optional[str]=None, blob_file_path: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -# Delete a file from a bucket asynchronously. -sdk.buckets.delete_file_async(name: Optional[str]=None, key: Optional[str]=None, blob_file_path: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -# Download a file from a bucket. -sdk.buckets.download(name: Optional[str]=None, key: Optional[str]=None, blob_file_path: str, destination_path: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -# Download a file from a bucket asynchronously. -sdk.buckets.download_async(name: Optional[str]=None, key: Optional[str]=None, blob_file_path: str, destination_path: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -# Check if bucket exists. -sdk.buckets.exists(name: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> bool - -# Async version of exists(). -sdk.buckets.exists_async(name: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> bool - -# Check if a file exists in a bucket. -sdk.buckets.exists_file(name: Optional[str]=None, key: Optional[str]=None, blob_file_path: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> bool - -# Async version of exists_file(). -sdk.buckets.exists_file_async(name: Optional[str]=None, key: Optional[str]=None, blob_file_path: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> bool - -# Get files using OData GetFiles API with offset-based pagination. -sdk.buckets.get_files(name: Optional[str]=None, key: Optional[str]=None, prefix: str="", recursive: bool=False, file_name_glob: Optional[str]=None, skip: int=0, top: int=500, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.platform.common.paging.PagedResult[uipath.platform.orchestrator.buckets.BucketFile] - -# Async version of get_files() with offset-based pagination. -sdk.buckets.get_files_async(name: Optional[str]=None, key: Optional[str]=None, prefix: str="", recursive: bool=False, file_name_glob: Optional[str]=None, skip: int=0, top: int=500, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.platform.common.paging.PagedResult[uipath.platform.orchestrator.buckets.BucketFile] - -# List buckets using OData API with offset-based pagination. -sdk.buckets.list(folder_path: Optional[str]=None, folder_key: Optional[str]=None, name: Optional[str]=None, skip: int=0, top: int=100) -> uipath.platform.common.paging.PagedResult[uipath.platform.orchestrator.buckets.Bucket] - -# Async version of list() with offset-based pagination. -sdk.buckets.list_async(folder_path: Optional[str]=None, folder_key: Optional[str]=None, name: Optional[str]=None, skip: int=0, top: int=100) -> uipath.platform.common.paging.PagedResult[uipath.platform.orchestrator.buckets.Bucket] - -# List files in a bucket using cursor-based pagination. -sdk.buckets.list_files(name: Optional[str]=None, key: Optional[str]=None, prefix: str="", take_hint: int=500, continuation_token: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.platform.common.paging.PagedResult[uipath.platform.orchestrator.buckets.BucketFile] - -# Async version of list_files() with cursor-based pagination. -sdk.buckets.list_files_async(name: Optional[str]=None, key: Optional[str]=None, prefix: str="", take_hint: int=500, continuation_token: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.platform.common.paging.PagedResult[uipath.platform.orchestrator.buckets.BucketFile] - -# Retrieve bucket information by its name. -sdk.buckets.retrieve(name: Optional[str]=None, key: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.platform.orchestrator.buckets.Bucket - -# Asynchronously retrieve bucket information by its name. -sdk.buckets.retrieve_async(name: Optional[str]=None, key: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.platform.orchestrator.buckets.Bucket - -# Upload a file to a bucket. -sdk.buckets.upload(key: Optional[str]=None, name: Optional[str]=None, blob_file_path: str, content_type: Optional[str]=None, source_path: Optional[str]=None, content: Union[str, bytes, NoneType]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -# Upload a file to a bucket asynchronously. -sdk.buckets.upload_async(key: Optional[str]=None, name: Optional[str]=None, blob_file_path: str, content_type: Optional[str]=None, source_path: Optional[str]=None, content: Union[str, bytes, NoneType]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -``` - -### Connections - -Connections service - -```python -# Invoke an activity synchronously. -sdk.connections.invoke_activity(activity_metadata: uipath.platform.connections.connections.ActivityMetadata, connection_id: str, activity_input: Dict[str, Any]) -> typing.Any - -# Invoke an activity asynchronously. -sdk.connections.invoke_activity_async(activity_metadata: uipath.platform.connections.connections.ActivityMetadata, connection_id: str, activity_input: Dict[str, Any]) -> typing.Any - -# Lists all connections with optional filtering. -sdk.connections.list(name: Optional[str]=None, folder_path: Optional[str]=None, folder_key: Optional[str]=None, connector_key: Optional[str]=None, skip: Optional[int]=None, top: Optional[int]=None) -> typing.List[uipath.platform.connections.connections.Connection] - -# Asynchronously lists all connections with optional filtering. -sdk.connections.list_async(name: Optional[str]=None, folder_path: Optional[str]=None, folder_key: Optional[str]=None, connector_key: Optional[str]=None, skip: Optional[int]=None, top: Optional[int]=None) -> typing.List[uipath.platform.connections.connections.Connection] - -# Synchronously retrieve connection API metadata. -sdk.connections.metadata(element_instance_id: int, connector_key: str, tool_path: str, parameters: Optional[Dict[str, str]]=None, schema_mode: bool=True, max_jit_depth: int=5) -> uipath.platform.connections.connections.ConnectionMetadata - -# Asynchronously retrieve connection API metadata. -sdk.connections.metadata_async(element_instance_id: int, connector_key: str, tool_path: str, parameters: Optional[Dict[str, str]]=None, schema_mode: bool=True, max_jit_depth: int=5) -> uipath.platform.connections.connections.ConnectionMetadata - -# Retrieve connection details by its key. -sdk.connections.retrieve(key: str) -> uipath.platform.connections.connections.Connection - -# Asynchronously retrieve connection details by its key. -sdk.connections.retrieve_async(key: str) -> uipath.platform.connections.connections.Connection - -# Retrieve event payload from UiPath Integration Service. -sdk.connections.retrieve_event_payload(event_args: uipath.platform.connections.connections.EventArguments) -> typing.Dict[str, typing.Any] - -# Retrieve event payload from UiPath Integration Service. -sdk.connections.retrieve_event_payload_async(event_args: uipath.platform.connections.connections.EventArguments) -> typing.Dict[str, typing.Any] - -# Retrieve an authentication token for a connection. -sdk.connections.retrieve_token(key: str, token_type: uipath.platform.connections.connections.ConnectionToken - -# Asynchronously retrieve an authentication token for a connection. -sdk.connections.retrieve_token_async(key: str, token_type: uipath.platform.connections.connections.ConnectionToken - -``` - -### Context Grounding - -Context Grounding service - -```python -# Add content to the index. -sdk.context_grounding.add_to_index(name: str, blob_file_path: str, content_type: Optional[str]=None, content: Union[str, bytes, NoneType]=None, source_path: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None, ingest_data: bool=True) -> None - -# Asynchronously add content to the index. -sdk.context_grounding.add_to_index_async(name: str, blob_file_path: str, content_type: Optional[str]=None, content: Union[str, bytes, NoneType]=None, source_path: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None, ingest_data: bool=True) -> None - -# Create a new ephemeral context grounding index. -sdk.context_grounding.create_ephemeral_index(usage: uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex - -# Create a new ephemeral context grounding index. -sdk.context_grounding.create_ephemeral_index_async(usage: uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex - -# Create a new context grounding index. -sdk.context_grounding.create_index(name: str, source: Union[uipath.platform.context_grounding.context_grounding_payloads.BucketSourceConfig, uipath.platform.context_grounding.context_grounding_payloads.GoogleDriveSourceConfig, uipath.platform.context_grounding.context_grounding_payloads.DropboxSourceConfig, uipath.platform.context_grounding.context_grounding_payloads.OneDriveSourceConfig, uipath.platform.context_grounding.context_grounding_payloads.ConfluenceSourceConfig], description: Optional[str]=None, extraction_strategy: Optional[str]=None, embeddings_enabled: Optional[bool]=None, is_encrypted: Optional[bool]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex - -# Create a new context grounding index. -sdk.context_grounding.create_index_async(name: str, source: Union[uipath.platform.context_grounding.context_grounding_payloads.BucketSourceConfig, uipath.platform.context_grounding.context_grounding_payloads.GoogleDriveSourceConfig, uipath.platform.context_grounding.context_grounding_payloads.DropboxSourceConfig, uipath.platform.context_grounding.context_grounding_payloads.OneDriveSourceConfig, uipath.platform.context_grounding.context_grounding_payloads.ConfluenceSourceConfig], description: Optional[str]=None, extraction_strategy: Optional[str]=None, embeddings_enabled: Optional[bool]=None, is_encrypted: Optional[bool]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex - -# Delete a context grounding index by its name. -sdk.context_grounding.delete_by_name(name: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -# Asynchronously delete a context grounding index by its name. -sdk.context_grounding.delete_by_name_async(name: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -# Delete a context grounding index. -sdk.context_grounding.delete_index(index: uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -# Asynchronously delete a context grounding index. -sdk.context_grounding.delete_index_async(index: uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -# Downloads the Batch Transform result file to the specified path. -sdk.context_grounding.download_batch_transform_result(id: str, destination_path: str, validate_status: bool=True, index_name: str | None=None) -> None - -# Asynchronously downloads the Batch Transform result file to the specified path. -sdk.context_grounding.download_batch_transform_result_async(id: str, destination_path: str, validate_status: bool=True, index_name: str | None=None) -> None - -# Trigger ingestion on a context grounding index by its name. -sdk.context_grounding.ingest_by_name(name: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -# Asynchronously trigger ingestion on a context grounding index by its name. -sdk.context_grounding.ingest_by_name_async(name: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -# Ingest data into the context grounding index. -sdk.context_grounding.ingest_data(index: uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -# Asynchronously ingest data into the context grounding index. -sdk.context_grounding.ingest_data_async(index: uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> None - -# List all context grounding indexes in a folder. -sdk.context_grounding.list(folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> typing.List[uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex] - -# Asynchronously list all context grounding indexes in a folder. -sdk.context_grounding.list_async(folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> typing.List[uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex] - -# List all context grounding indexes in a folder. -sdk.context_grounding.list_indexes(folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> typing.List[uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex] - -# Asynchronously list all context grounding indexes in a folder. -sdk.context_grounding.list_indexes_async(folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> typing.List[uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex] - -# Retrieve context grounding index information by its name. -sdk.context_grounding.retrieve(name: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex - -# Retrieve all context grounding indexes across all folders. -sdk.context_grounding.retrieve_across_folders(name: Optional[str]=None) -> typing.List[uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex] - -# Asynchronously retrieve all context grounding indexes across all folders. -sdk.context_grounding.retrieve_across_folders_async(name: Optional[str]=None) -> typing.List[uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex] - -# Asynchronously retrieve context grounding index information by its name. -sdk.context_grounding.retrieve_async(name: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uipath.platform.context_grounding.context_grounding_index.ContextGroundingIndex - -# Retrieves a Batch Transform task status. -sdk.context_grounding.retrieve_batch_transform(id: str, index_name: str | None=None) -> uipath.platform.context_grounding.context_grounding.BatchTransformResponse - -# Asynchronously retrieves a Batch Transform task status. -sdk.context_grounding.retrieve_batch_transform_async(id: str, index_name: str | None=None) -> uipath.platform.context_grounding.context_grounding.BatchTransformResponse - -# Retrieve context grounding index information by its ID. -sdk.context_grounding.retrieve_by_id(id: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> typing.Any - -# Retrieve asynchronously context grounding index information by its ID. -sdk.context_grounding.retrieve_by_id_async(id: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> typing.Any - -# Retrieves a Deep RAG task. -sdk.context_grounding.retrieve_deep_rag(id: str, index_name: str | None=None) -> uipath.platform.context_grounding.context_grounding.DeepRagResponse - -# Asynchronously retrieves a Deep RAG task. -sdk.context_grounding.retrieve_deep_rag_async(id: str, index_name: str | None=None) -> uipath.platform.context_grounding.context_grounding.DeepRagResponse - -# Search for contextual information within a specific index. -sdk.context_grounding.search(name: str, query: str, number_of_results: int=10, threshold: Optional[float]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> typing.List[uipath.platform.context_grounding.context_grounding.ContextGroundingQueryResponse] - -# Search asynchronously for contextual information within a specific index. -sdk.context_grounding.search_async(name: str, query: str, number_of_results: int=10, threshold: Optional[float]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> typing.List[uipath.platform.context_grounding.context_grounding.ContextGroundingQueryResponse] - -# Starts a Batch Transform, task on the targeted index. -sdk.context_grounding.start_batch_transform(name: str, prompt: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=250000)])], output_columns: List[uipath.platform.context_grounding.context_grounding.BatchTransformOutputColumn], storage_bucket_folder_path_prefix: Annotated[str | None, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=512)])]=None, target_file_name: Annotated[str | None, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=512)])]=None, enable_web_search_grounding: bool=False, index_name: str | None=None, index_id: Optional[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=512)])]]=None, folder_key: str | None=None, folder_path: str | None=None) -> uipath.platform.context_grounding.context_grounding.BatchTransformCreationResponse - -# Asynchronously starts a Batch Transform, task on the targeted index. -sdk.context_grounding.start_batch_transform_async(name: str, prompt: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=250000)])], output_columns: List[uipath.platform.context_grounding.context_grounding.BatchTransformOutputColumn], storage_bucket_folder_path_prefix: Annotated[str | None, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=512)])]=None, target_file_name: Annotated[str | None, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=512)])]=None, enable_web_search_grounding: bool=False, index_name: str | None=None, index_id: Optional[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=512)])]]=None, folder_key: str | None=None, folder_path: str | None=None) -> uipath.platform.context_grounding.context_grounding.BatchTransformCreationResponse - -# Asynchronously starts a Batch Transform, task on the targeted index. -sdk.context_grounding.start_batch_transform_ephemeral(name: str, prompt: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=250000)])], output_columns: List[uipath.platform.context_grounding.context_grounding.BatchTransformOutputColumn], storage_bucket_folder_path_prefix: Annotated[str | None, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=512)])]=None, enable_web_search_grounding: bool=False, index_id: Optional[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=512)])]]=None) -> uipath.platform.context_grounding.context_grounding.BatchTransformCreationResponse - -# Asynchronously starts a Batch Transform, task on the targeted index. -sdk.context_grounding.start_batch_transform_ephemeral_async(name: str, prompt: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=250000)])], output_columns: List[uipath.platform.context_grounding.context_grounding.BatchTransformOutputColumn], storage_bucket_folder_path_prefix: Annotated[str | None, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=512)])]=None, enable_web_search_grounding: bool=False, index_id: Optional[Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=512)])]]=None) -> uipath.platform.context_grounding.context_grounding.BatchTransformCreationResponse - -# Starts a Deep RAG task on the targeted index. -sdk.context_grounding.start_deep_rag(name: str, prompt: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=250000)])], glob_pattern: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='*', metadata=[MaxLen(max_length=512)])]="**", citation_mode: uipath.platform.context_grounding.context_grounding.DeepRagCreationResponse - -# Asynchronously starts a Deep RAG task on the targeted index. -sdk.context_grounding.start_deep_rag_async(name: str, prompt: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=250000)])], glob_pattern: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='*', metadata=[MaxLen(max_length=512)])]="**", citation_mode: uipath.platform.context_grounding.context_grounding.DeepRagCreationResponse - -# Asynchronously starts a Deep RAG task on the targeted index. -sdk.context_grounding.start_deep_rag_ephemeral(name: str, prompt: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=250000)])], glob_pattern: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='*', metadata=[MaxLen(max_length=512)])]="**", citation_mode: uipath.platform.context_grounding.context_grounding.DeepRagCreationResponse - -# Asynchronously starts a Deep RAG task on the targeted index. -sdk.context_grounding.start_deep_rag_ephemeral_async(name: str, prompt: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[MaxLen(max_length=250000)])], glob_pattern: Annotated[str, FieldInfo(annotation=NoneType, required=False, default='*', metadata=[MaxLen(max_length=512)])]="**", citation_mode: uipath.platform.context_grounding.context_grounding.DeepRagCreationResponse - -# Perform a unified search on a context grounding index. -sdk.context_grounding.unified_search(name: str, query: str, search_mode: uipath.platform.context_grounding.context_grounding.UnifiedQueryResult - -# Asynchronously perform a unified search on a context grounding index. -sdk.context_grounding.unified_search_async(name: str, query: str, search_mode: uipath.platform.context_grounding.context_grounding.UnifiedQueryResult - -``` - -### Conversational - -Conversational service - -```python -# Access conversational service methods -service = sdk.conversational - -``` - -### Documents - -Documents service - -```python -# Classify a document using a DU Modern project. -sdk.documents.classify(project_type: typing.List[uipath.platform.documents.documents.ClassificationResult] - -# Asynchronously version of the [`classify`][uipath.platform.documents._documents_service.DocumentsService.classify] method. -sdk.documents.classify_async(project_type: typing.List[uipath.platform.documents.documents.ClassificationResult] - -# Create a validate classification action for a document based on the classification results. More details about validation actions can be found in the [official documentation](https://docs.uipath.com/ixp/automation-cloud/latest/user-guide/validating-classifications). -sdk.documents.create_validate_classification_action(classification_results: List[uipath.platform.documents.documents.ClassificationResult], action_title: str, action_priority: Optional[uipath.platform.documents.documents.ActionPriority]=None, action_catalog: Optional[str]=None, action_folder: Optional[str]=None, storage_bucket_name: Optional[str]=None, storage_bucket_directory_path: Optional[str]=None) -> uipath.platform.documents.documents.ValidateClassificationAction - -# Asynchronous version of the [`create_validation_action`][uipath.platform.documents._documents_service.DocumentsService.create_validate_classification_action] method. -sdk.documents.create_validate_classification_action_async(classification_results: List[uipath.platform.documents.documents.ClassificationResult], action_title: str, action_priority: Optional[uipath.platform.documents.documents.ActionPriority]=None, action_catalog: Optional[str]=None, action_folder: Optional[str]=None, storage_bucket_name: Optional[str]=None, storage_bucket_directory_path: Optional[str]=None) -> uipath.platform.documents.documents.ValidateClassificationAction - -# Create a validate extraction action for a document based on the extraction response. More details about validation actions can be found in the [official documentation](https://docs.uipath.com/ixp/automation-cloud/latest/user-guide/validating-extractions). -sdk.documents.create_validate_extraction_action(extraction_response: uipath.platform.documents.documents.ExtractionResponse, action_title: str, action_priority: Optional[uipath.platform.documents.documents.ActionPriority]=None, action_catalog: Optional[str]=None, action_folder: Optional[str]=None, storage_bucket_name: Optional[str]=None, storage_bucket_directory_path: Optional[str]=None) -> uipath.platform.documents.documents.ValidateExtractionAction - -# Asynchronous version of the [`create_validation_action`][uipath.platform.documents._documents_service.DocumentsService.create_validate_extraction_action] method. -sdk.documents.create_validate_extraction_action_async(extraction_response: uipath.platform.documents.documents.ExtractionResponse, action_title: str, action_priority: Optional[uipath.platform.documents.documents.ActionPriority]=None, action_catalog: Optional[str]=None, action_folder: Optional[str]=None, storage_bucket_name: Optional[str]=None, storage_bucket_directory_path: Optional[str]=None) -> uipath.platform.documents.documents.ValidateExtractionAction - -# Extract predicted data from a document using an DU Modern/IXP project. -sdk.documents.extract(tag: Optional[str]=None, version: Optional[int]=None, project_name: Optional[str]=None, file: Union[IO[bytes], bytes, str, NoneType]=None, file_path: Optional[str]=None, classification_result: Optional[uipath.platform.documents.documents.ClassificationResult]=None, project_type: Optional[uipath.platform.documents.documents.ProjectType]=None, document_type_name: Optional[str]=None) -> typing.Union[uipath.platform.documents.documents.ExtractionResponse, uipath.platform.documents.documents.ExtractionResponseIXP] - -# Asynchronously version of the [`extract`][uipath.platform.documents._documents_service.DocumentsService.extract] method. -sdk.documents.extract_async(tag: Optional[str]=None, version: Optional[int]=None, project_name: Optional[str]=None, file: Union[IO[bytes], bytes, str, NoneType]=None, file_path: Optional[str]=None, classification_result: Optional[uipath.platform.documents.documents.ClassificationResult]=None, project_type: Optional[uipath.platform.documents.documents.ProjectType]=None, document_type_name: Optional[str]=None) -> typing.Union[uipath.platform.documents.documents.ExtractionResponse, uipath.platform.documents.documents.ExtractionResponseIXP] - -# Get the result of a validate classification action. -sdk.documents.get_validate_classification_result(validation_action: uipath.platform.documents.documents.ValidateClassificationAction) -> typing.List[uipath.platform.documents.documents.ClassificationResult] - -# Asynchronous version of the [`get_validation_result`][uipath.platform.documents._documents_service.DocumentsService.get_validate_classification_result] method. -sdk.documents.get_validate_classification_result_async(validation_action: uipath.platform.documents.documents.ValidateClassificationAction) -> typing.List[uipath.platform.documents.documents.ClassificationResult] - -# Get the result of a validate extraction action. -sdk.documents.get_validate_extraction_result(validation_action: uipath.platform.documents.documents.ValidateExtractionAction) -> typing.Union[uipath.platform.documents.documents.ExtractionResponse, uipath.platform.documents.documents.ExtractionResponseIXP] - -# Asynchronous version of the [`get_validation_result`][uipath.platform.documents._documents_service.DocumentsService.get_validate_extraction_result] method. -sdk.documents.get_validate_extraction_result_async(validation_action: uipath.platform.documents.documents.ValidateExtractionAction) -> typing.Union[uipath.platform.documents.documents.ExtractionResponse, uipath.platform.documents.documents.ExtractionResponseIXP] - -# Retrieve the result of an IXP extraction operation (single-shot, non-blocking). -sdk.documents.retrieve_ixp_extraction_result(project_id: str, tag: str, operation_id: str) -> uipath.platform.documents.documents.ExtractionResponseIXP - -# Asynchronous version of the [`retrieve_ixp_extraction_result`][uipath.platform.documents._documents_service.DocumentsService.retrieve_ixp_extraction_result] method. -sdk.documents.retrieve_ixp_extraction_result_async(project_id: str, tag: str, operation_id: str) -> uipath.platform.documents.documents.ExtractionResponseIXP - -# Retrieve the result of an IXP create validate extraction action operation (single-shot, non-blocking). -sdk.documents.retrieve_ixp_extraction_validation_result(project_id: str, tag: str, operation_id: str) -> uipath.platform.documents.documents.ValidateExtractionAction - -# Asynchronous version of the [`retrieve_ixp_extraction_validation_result`][uipath.platform.documents._documents_service.DocumentsService.retrieve_ixp_extraction_validation_result] method. -sdk.documents.retrieve_ixp_extraction_validation_result_async(project_id: str, tag: str, operation_id: str) -> uipath.platform.documents.documents.ValidateExtractionAction - -# Start an IXP extraction process without waiting for results (non-blocking). -sdk.documents.start_ixp_extraction(project_name: str, tag: str, file: Union[IO[bytes], bytes, str, NoneType]=None, file_path: Optional[str]=None) -> uipath.platform.documents.documents.StartExtractionResponse - -# Asynchronous version of the [`start_ixp_extraction`][uipath.platform.documents._documents_service.DocumentsService.start_ixp_extraction] method. -sdk.documents.start_ixp_extraction_async(project_name: str, tag: str, file: Union[IO[bytes], bytes, str, NoneType]=None, file_path: Optional[str]=None) -> uipath.platform.documents.documents.StartExtractionResponse - -# Start an IXP extraction validation action without waiting for results (non-blocking). -sdk.documents.start_ixp_extraction_validation(extraction_response: uipath.platform.documents.documents.ExtractionResponseIXP, action_title: str, action_catalog: Optional[str]=None, action_priority: Optional[uipath.platform.documents.documents.ActionPriority]=None, action_folder: Optional[str]=None, storage_bucket_name: Optional[str]=None, storage_bucket_directory_path: Optional[str]=None) -> uipath.platform.documents.documents.StartExtractionValidationResponse - -# Asynchronous version of the [`start_ixp_extraction_validation`][uipath.platform.documents._documents_service.DocumentsService.start_ixp_extraction_validation] method. -sdk.documents.start_ixp_extraction_validation_async(extraction_response: uipath.platform.documents.documents.ExtractionResponseIXP, action_title: str, action_catalog: Optional[str]=None, action_priority: Optional[uipath.platform.documents.documents.ActionPriority]=None, action_folder: Optional[str]=None, storage_bucket_name: Optional[str]=None, storage_bucket_directory_path: Optional[str]=None) -> uipath.platform.documents.documents.StartExtractionValidationResponse - -``` - -### Entities - -Entities service - -```python -# Delete multiple records from an entity in a single batch operation. -sdk.entities.delete_records(entity_key: str, record_ids: List[str]) -> uipath.platform.entities.entities.EntityRecordsBatchResponse - -# Asynchronously delete multiple records from an entity in a single batch operation. -sdk.entities.delete_records_async(entity_key: str, record_ids: List[str]) -> uipath.platform.entities.entities.EntityRecordsBatchResponse - -# Insert multiple records into an entity in a single batch operation. -sdk.entities.insert_records(entity_key: str, records: List[Any], schema: Optional[Type[Any]]=None) -> uipath.platform.entities.entities.EntityRecordsBatchResponse - -# Asynchronously insert multiple records into an entity in a single batch operation. -sdk.entities.insert_records_async(entity_key: str, records: List[Any], schema: Optional[Type[Any]]=None) -> uipath.platform.entities.entities.EntityRecordsBatchResponse - -# List all entities in Data Service. -sdk.entities.list_entities() -> typing.List[uipath.platform.entities.entities.Entity] - -# Asynchronously list all entities in the Data Service. -sdk.entities.list_entities_async() -> typing.List[uipath.platform.entities.entities.Entity] - -# List records from an entity with optional pagination and schema validation. -sdk.entities.list_records(entity_key: str, schema: Optional[Type[Any]]=None, start: Optional[int]=None, limit: Optional[int]=None) -> typing.List[uipath.platform.entities.entities.EntityRecord] - -# Asynchronously list records from an entity with optional pagination and schema validation. -sdk.entities.list_records_async(entity_key: str, schema: Optional[Type[Any]]=None, start: Optional[int]=None, limit: Optional[int]=None) -> typing.List[uipath.platform.entities.entities.EntityRecord] - -# Query entity records using a validated SQL query. -sdk.entities.query_entity_records(sql_query: str, routing_context: Optional[uipath.platform.entities.entities.QueryRoutingOverrideContext]=None) -> typing.List[typing.Dict[str, typing.Any]] - -# Asynchronously query entity records using a validated SQL query. -sdk.entities.query_entity_records_async(sql_query: str, routing_context: Optional[uipath.platform.entities.entities.QueryRoutingOverrideContext]=None) -> typing.List[typing.Dict[str, typing.Any]] - -# Retrieve an entity by its key. -sdk.entities.retrieve(entity_key: str) -> uipath.platform.entities.entities.Entity - -# Asynchronously retrieve an entity by its key. -sdk.entities.retrieve_async(entity_key: str) -> uipath.platform.entities.entities.Entity - -# Update multiple records in an entity in a single batch operation. -sdk.entities.update_records(entity_key: str, records: List[Any], schema: Optional[Type[Any]]=None) -> uipath.platform.entities.entities.EntityRecordsBatchResponse - -# Asynchronously update multiple records in an entity in a single batch operation. -sdk.entities.update_records_async(entity_key: str, records: List[Any], schema: Optional[Type[Any]]=None) -> uipath.platform.entities.entities.EntityRecordsBatchResponse - -``` - -### Folders - -Folders service - -```python -# Retrieve the personal workspace folder for the current user. -sdk.folders.get_personal_workspace() -> uipath.platform.orchestrator.folder.PersonalWorkspace - -# Asynchronously retrieve the personal workspace folder for the current user. -sdk.folders.get_personal_workspace_async() -> uipath.platform.orchestrator.folder.PersonalWorkspace - -# Resolve a folder path to its corresponding folder key. -sdk.folders.retrieve_folder_key(folder_path: str | None) -> str | None - -# Asynchronously resolve a folder path to its corresponding folder key. -sdk.folders.retrieve_folder_key_async(folder_path: str | None) -> str | None - -# Retrieve the folder key by folder path with pagination support. -sdk.folders.retrieve_key(folder_path: str) -> typing.Optional[str] - -# Retrieve the folder key by folder path with pagination support. -sdk.folders.retrieve_key_async(folder_path: str) -> typing.Optional[str] - -``` - -### Guardrails - -Guardrails service - -```python -# Validate input text using the provided guardrail. -sdk.guardrails.evaluate_guardrail(input_data: str | dict[str, Any], guardrail: uipath.platform.guardrails.guardrails.BuiltInValidatorGuardrail) -> uipath.core.guardrails.guardrails.GuardrailValidationResult - -``` - -### Jobs - -Jobs service - -```python -# Create and upload an attachment, optionally linking it to a job. -sdk.jobs.create_attachment(name: str, content: Union[str, bytes, NoneType]=None, source_path: Union[str, pathlib.Path, NoneType]=None, job_key: Union[str, uuid.UUID, NoneType]=None, category: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uuid.UUID - -# Create and upload an attachment asynchronously, optionally linking it to a job. -sdk.jobs.create_attachment_async(name: str, content: Union[str, bytes, NoneType]=None, source_path: Union[str, pathlib.Path, NoneType]=None, job_key: Union[str, uuid.UUID, NoneType]=None, category: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> uuid.UUID - -# Check if job exists. -sdk.jobs.exists(job_key: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> bool - -# Async version of exists(). -sdk.jobs.exists_async(job_key: str, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> bool - -# Get the actual output data, downloading from attachment if necessary. -sdk.jobs.extract_output(job: uipath.platform.orchestrator.job.Job) -> typing.Optional[str] - -# Asynchronously fetch the actual output data, downloading from attachment if necessary. -sdk.jobs.extract_output_async(job: uipath.platform.orchestrator.job.Job) -> typing.Optional[str] - -# Link an attachment to a job. -sdk.jobs.link_attachment(attachment_key: uuid.UUID, job_key: uuid.UUID, category: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) - -# Link an attachment to a job asynchronously. -sdk.jobs.link_attachment_async(attachment_key: uuid.UUID, job_key: uuid.UUID, category: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) - -# List jobs using OData API with offset-based pagination. -sdk.jobs.list(folder_path: Optional[str]=None, folder_key: Optional[str]=None, filter: Optional[str]=None, orderby: Optional[str]=None, skip: int=0, top: int=100) -> uipath.platform.common.paging.PagedResult[uipath.platform.orchestrator.job.Job] - -# Async version of list() with offset-based pagination. -sdk.jobs.list_async(folder_path: Optional[str]=None, folder_key: Optional[str]=None, filter: Optional[str]=None, orderby: Optional[str]=None, skip: int=0, top: int=100) -> uipath.platform.common.paging.PagedResult[uipath.platform.orchestrator.job.Job] - -# List attachments associated with a specific job. -sdk.jobs.list_attachments(job_key: uuid.UUID, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> typing.List[str] - -# List attachments associated with a specific job asynchronously. -sdk.jobs.list_attachments_async(job_key: uuid.UUID, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> typing.List[str] - -# Restart a completed or failed job. -sdk.jobs.restart(job_key: str, folder_path: Optional[str]=None, folder_key: Optional[str]=None) -> uipath.platform.orchestrator.job.Job - -# Async version of restart(). -sdk.jobs.restart_async(job_key: str, folder_path: Optional[str]=None, folder_key: Optional[str]=None) -> uipath.platform.orchestrator.job.Job - -# Sends a payload to resume a paused job waiting for input, identified by its inbox ID. -sdk.jobs.resume(inbox_id: Optional[str]=None, job_id: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None, payload: Any) -> None - -# Asynchronously sends a payload to resume a paused job waiting for input, identified by its inbox ID. -sdk.jobs.resume_async(inbox_id: Optional[str]=None, job_id: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None, payload: Any) -> None - -# Retrieve a job identified by its key. -sdk.jobs.retrieve(job_key: str, folder_key: str | None=None, folder_path: str | None=None, process_name: str | None=None) -> uipath.platform.orchestrator.job.Job - -# Fetch payload data for API triggers. -sdk.jobs.retrieve_api_payload(inbox_id: str) -> typing.Any - -# Asynchronously fetch payload data for API triggers. -sdk.jobs.retrieve_api_payload_async(inbox_id: str) -> typing.Any - -# Asynchronously retrieve a job identified by its key. -sdk.jobs.retrieve_async(job_key: str, folder_key: str | None=None, folder_path: str | None=None, process_name: str | None=None) -> uipath.platform.orchestrator.job.Job - -# Stop one or more jobs with specified strategy. -sdk.jobs.stop(job_keys: List[str], strategy: str="SoftStop", folder_path: Optional[str]=None, folder_key: Optional[str]=None) -> None - -# Async version of stop(). -sdk.jobs.stop_async(job_keys: List[str], strategy: str="SoftStop", folder_path: Optional[str]=None, folder_key: Optional[str]=None) -> None - -``` - -### Llm - -Llm service - -```python -# Generate chat completions using UiPath's normalized LLM Gateway API. -sdk.llm.chat_completions(messages: list[dict[str, str]] | list[tuple[str, str]], model: str="gpt-4.1-mini-2025-04-14", max_tokens: int=4096, temperature: float=0, n: int=1, frequency_penalty: float=0, presence_penalty: float=0, top_p: float | None=1, top_k: int | None=None, tools: list[uipath.platform.chat.llm_gateway.ToolDefinition] | None=None, tool_choice: Union[uipath.platform.chat.llm_gateway.AutoToolChoice, uipath.platform.chat.llm_gateway.RequiredToolChoice, uipath.platform.chat.llm_gateway.SpecificToolChoice, Literal['auto', 'none'], NoneType]=None, response_format: dict[str, Any] | type[pydantic.main.BaseModel] | None=None, api_version: str="2024-08-01-preview") - -``` - -### Llm Openai - -Llm Openai service - -```python -# Generate chat completions using UiPath's LLM Gateway service. -sdk.llm_openai.chat_completions(messages: list[dict[str, str]], model: str="gpt-4.1-mini-2025-04-14", max_tokens: int=4096, temperature: float=0, response_format: dict[str, Any] | type[pydantic.main.BaseModel] | None=None, api_version: str="2024-10-21") - -# Generate text embeddings using UiPath's LLM Gateway service. -sdk.llm_openai.embeddings(input: str, embedding_model: str="text-embedding-ada-002", openai_api_version: str="2024-10-21") - -``` - -### Mcp - -Mcp service - -```python -# List all MCP servers. -sdk.mcp.list(folder_path: str | None=None) -> typing.List[uipath.platform.orchestrator.mcp.McpServer] - -# Asynchronously list all MCP servers. -sdk.mcp.list_async(folder_path: str | None=None) -> typing.List[uipath.platform.orchestrator.mcp.McpServer] - -# Retrieve a specific MCP server by its slug. -sdk.mcp.retrieve(slug: str, folder_path: str | None=None) -> uipath.platform.orchestrator.mcp.McpServer - -# Asynchronously retrieve a specific MCP server by its slug. -sdk.mcp.retrieve_async(slug: str, folder_path: str | None=None) -> uipath.platform.orchestrator.mcp.McpServer - -``` - -### Orchestrator Setup - -Orchestrator Setup service - -```python -# Fire-and-forget POST requests to enable first run for StudioWeb. -sdk.orchestrator_setup.enable_first_run() -> None - -# Fire-and-forget POST requests to enable first run for StudioWeb. -sdk.orchestrator_setup.enable_first_run_async() -> None - -``` - -### Processes - -Processes service - -```python -# Start execution of a process by its name. -sdk.processes.invoke(name: str, input_arguments: Optional[Dict[str, Any]]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None, attachments: Optional[list[uipath.platform.attachments.attachments.Attachment]]=None, parent_operation_id: Optional[str]=None, **kwargs) -> uipath.platform.orchestrator.job.Job - -# Asynchronously start execution of a process by its name. -sdk.processes.invoke_async(name: str, input_arguments: Optional[Dict[str, Any]]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None, attachments: Optional[list[uipath.platform.attachments.attachments.Attachment]]=None, parent_operation_id: Optional[str]=None, **kwargs) -> uipath.platform.orchestrator.job.Job - -``` - -### Queues - -Queues service - -```python -# Completes a transaction item with the specified result. -sdk.queues.complete_transaction_item(transaction_key: str, result: Union[Dict[str, Any], uipath.platform.orchestrator.queues.TransactionItemResult], queue_name: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> httpx.Response - -# Asynchronously completes a transaction item with the specified result. -sdk.queues.complete_transaction_item_async(transaction_key: str, result: Union[Dict[str, Any], uipath.platform.orchestrator.queues.TransactionItemResult], queue_name: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> httpx.Response - -# Creates a new queue item in the Orchestrator. -sdk.queues.create_item(item: Union[Dict[str, Any], uipath.platform.orchestrator.queues.QueueItem], queue_name: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> httpx.Response - -# Asynchronously creates a new queue item in the Orchestrator. -sdk.queues.create_item_async(item: Union[Dict[str, Any], uipath.platform.orchestrator.queues.QueueItem], queue_name: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> httpx.Response - -# Creates multiple queue items in bulk. -sdk.queues.create_items(items: List[Union[Dict[str, Any], uipath.platform.orchestrator.queues.QueueItem]], queue_name: str, commit_type: httpx.Response - -# Asynchronously creates multiple queue items in bulk. -sdk.queues.create_items_async(items: List[Union[Dict[str, Any], uipath.platform.orchestrator.queues.QueueItem]], queue_name: str, commit_type: httpx.Response - -# Creates a new transaction item in a queue. -sdk.queues.create_transaction_item(item: Union[Dict[str, Any], uipath.platform.orchestrator.queues.TransactionItem], queue_name: Optional[str]=None, no_robot: bool=False, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> httpx.Response - -# Asynchronously creates a new transaction item in a queue. -sdk.queues.create_transaction_item_async(item: Union[Dict[str, Any], uipath.platform.orchestrator.queues.TransactionItem], queue_name: Optional[str]=None, no_robot: bool=False, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> httpx.Response - -# Retrieves a list of queue items from the Orchestrator. -sdk.queues.list_items(queue_name: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> httpx.Response - -# Asynchronously retrieves a list of queue items from the Orchestrator. -sdk.queues.list_items_async(queue_name: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> httpx.Response - -# Updates the progress of a transaction item. -sdk.queues.update_progress_of_transaction_item(transaction_key: str, progress: str, queue_name: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> httpx.Response - -# Asynchronously updates the progress of a transaction item. -sdk.queues.update_progress_of_transaction_item_async(transaction_key: str, progress: str, queue_name: Optional[str]=None, folder_key: Optional[str]=None, folder_path: Optional[str]=None) -> httpx.Response - -``` - -### Remote A2A - -Remote A2A service - -```python -# List Remote A2A agents. -sdk.remote_a2a.list(top: int | None=None, skip: int | None=None, search: str | None=None, folder_path: str | None=None) -> typing.List[uipath.platform.agenthub.remote_a2a.RemoteA2aAgent] - -# Asynchronously list Remote A2A agents. -sdk.remote_a2a.list_async(top: int | None=None, skip: int | None=None, search: str | None=None, folder_path: str | None=None) -> typing.List[uipath.platform.agenthub.remote_a2a.RemoteA2aAgent] - -# Retrieve a specific Remote A2A agent by slug. -sdk.remote_a2a.retrieve(slug: str, folder_path: str | None=None) -> uipath.platform.agenthub.remote_a2a.RemoteA2aAgent - -# Asynchronously retrieve a specific Remote A2A agent by slug. -sdk.remote_a2a.retrieve_async(slug: str, folder_path: str | None=None) -> uipath.platform.agenthub.remote_a2a.RemoteA2aAgent - -``` - -### Resource Catalog - -Resource Catalog service - -```python -# Get tenant scoped resources and folder scoped resources (accessible to the user). -sdk.resource_catalog.list(resource_types: Optional[List[uipath.platform.resource_catalog.resource_catalog.ResourceType]]=None, resource_sub_types: Optional[List[str]]=None, folder_path: Optional[str]=None, folder_key: Optional[str]=None, page_size: int=20) -> typing.Iterator[uipath.platform.resource_catalog.resource_catalog.Resource] - -# Asynchronously get tenant scoped resources and folder scoped resources (accessible to the user). -sdk.resource_catalog.list_async(resource_types: Optional[List[uipath.platform.resource_catalog.resource_catalog.ResourceType]]=None, resource_sub_types: Optional[List[str]]=None, folder_path: Optional[str]=None, folder_key: Optional[str]=None, page_size: int=20) -> typing.AsyncIterator[uipath.platform.resource_catalog.resource_catalog.Resource] - -# Get resources of a specific type (tenant scoped or folder scoped). -sdk.resource_catalog.list_by_type(resource_type: typing.Iterator[uipath.platform.resource_catalog.resource_catalog.Resource] - -# Asynchronously get resources of a specific type (tenant scoped or folder scoped). -sdk.resource_catalog.list_by_type_async(resource_type: typing.AsyncIterator[uipath.platform.resource_catalog.resource_catalog.Resource] - -# Search for tenant scoped resources and folder scoped resources (accessible to the user). -sdk.resource_catalog.search(name: Optional[str]=None, resource_types: Optional[List[uipath.platform.resource_catalog.resource_catalog.ResourceType]]=None, resource_sub_types: Optional[List[str]]=None, page_size: int=20) -> typing.Iterator[uipath.platform.resource_catalog.resource_catalog.Resource] - -# Asynchronously search for tenant scoped resources and folder scoped resources (accessible to the user). -sdk.resource_catalog.search_async(name: Optional[str]=None, resource_types: Optional[List[uipath.platform.resource_catalog.resource_catalog.ResourceType]]=None, resource_sub_types: Optional[List[str]]=None, page_size: int=20) -> typing.AsyncIterator[uipath.platform.resource_catalog.resource_catalog.Resource] - -``` - -### Tasks - -Tasks service - -```python -# Creates a new task synchronously. -sdk.tasks.create(title: str, data: Optional[Dict[str, Any]]=None, app_name: Optional[str]=None, app_key: Optional[str]=None, app_folder_path: Optional[str]=None, app_folder_key: Optional[str]=None, assignee: Optional[str]=None, recipient: Optional[uipath.platform.action_center.tasks.TaskRecipient]=None, priority: Optional[str]=None, labels: Optional[List[str]]=None, is_actionable_message_enabled: Optional[bool]=None, actionable_message_metadata: Optional[Dict[str, Any]]=None, source_name: str="Agent") -> uipath.platform.action_center.tasks.Task - -# Creates a new action asynchronously. -sdk.tasks.create_async(title: str, data: Optional[Dict[str, Any]]=None, app_name: Optional[str]=None, app_key: Optional[str]=None, app_folder_path: Optional[str]=None, app_folder_key: Optional[str]=None, assignee: Optional[str]=None, recipient: Optional[uipath.platform.action_center.tasks.TaskRecipient]=None, priority: Optional[str]=None, labels: Optional[List[str]]=None, is_actionable_message_enabled: Optional[bool]=None, actionable_message_metadata: Optional[Dict[str, Any]]=None, source_name: str="Agent") -> uipath.platform.action_center.tasks.Task - -# Retrieves a task by its key synchronously. -sdk.tasks.retrieve(action_key: str, app_folder_path: Optional[str]=None, app_folder_key: Optional[str]=None, app_name: str | None=None) -> uipath.platform.action_center.tasks.Task - -# Retrieves a task by its key asynchronously. -sdk.tasks.retrieve_async(action_key: str, app_folder_path: Optional[str]=None, app_folder_key: Optional[str]=None, app_name: str | None=None) -> uipath.platform.action_center.tasks.Task - -``` - diff --git a/template/AGENTS.md b/template/AGENTS.md index c1f02680a..4c4e4a2d0 100644 --- a/template/AGENTS.md +++ b/template/AGENTS.md @@ -1,21 +1,9 @@ -# Agent Code Patterns Reference +# UiPath LangGraph Project -This document provides practical code patterns for building UiPath coded agents using LangGraph and the UiPath Python SDK. +For SDK and CLI knowledge, follow this order: ---- +1. Run `uip skills install` (install the CLI first if needed: `npm install -g @uipath/cli`). + Recommended skills: `uipath-agents`, `uipath-platform`. -## Documentation Structure - -This documentation is split into multiple files for efficient context loading. Load only the files you need: - -1. **@.agent/REQUIRED_STRUCTURE.md** - Agent structure patterns and templates - - **When to load:** Creating a new agent or understanding required patterns - - **Contains:** Required Pydantic models (Input, State, Output), LLM initialization patterns, standard agent template - -2. **@.agent/SDK_REFERENCE.md** - Complete SDK API reference - - **When to load:** Calling UiPath SDK methods, working with services (actions, assets, jobs, etc.) - - **Contains:** All SDK services and methods with full signatures and type annotations - -3. **@.agent/CLI_REFERENCE.md** - CLI commands documentation - - **When to load:** Working with `uipath init`, `uipath run`, or `uipath eval` commands - - **Contains:** Command syntax, options, usage examples, and workflows +2. If `uip` is unavailable, fetch `https://uipath.github.io/uipath-python/llms.txt` + and follow the linked sections on demand. diff --git a/template/CLAUDE.md b/template/CLAUDE.md index eef4bd20c..43c994c2d 100644 --- a/template/CLAUDE.md +++ b/template/CLAUDE.md @@ -1 +1 @@ -@AGENTS.md \ No newline at end of file +@AGENTS.md diff --git a/tests/cli/test_init.py b/tests/cli/test_init.py index f7a2f0a8a..f558f38b7 100644 --- a/tests/cli/test_init.py +++ b/tests/cli/test_init.py @@ -9,10 +9,9 @@ class TestGenerateAgentMdFile: - """Tests for the generate_agent_md_file function.""" + """Tests for the generate_agent_md_file helper.""" def test_generate_file_success(self): - """Test successfully generating an agent MD file.""" with tempfile.TemporaryDirectory() as temp_dir: result = generate_agent_md_file( temp_dir, "AGENTS.md", "uipath_langchain._resources", False @@ -24,179 +23,110 @@ def test_generate_file_success(self): target_path = os.path.join(temp_dir, "AGENTS.md") assert os.path.exists(target_path) - with open(target_path, "r") as f: + with open(target_path) as f: content = f.read() - assert len(content) > 0 - assert "Agent Code Patterns Reference" in content + assert "uip skills install" in content - def test_file_already_exists(self): - """Test that an existing file is overwritten.""" + def test_existing_file_overwritten(self): with tempfile.TemporaryDirectory() as temp_dir: target_path = os.path.join(temp_dir, "AGENTS.md") - original_content = "Original content" with open(target_path, "w") as f: - f.write(original_content) + f.write("original") result = generate_agent_md_file( temp_dir, "AGENTS.md", "uipath_langchain._resources", False ) - assert result is not None - file_name, status = result - assert file_name == "AGENTS.md" - assert status == FileOperationStatus.UPDATED - - with open(target_path, "r") as f: - content = f.read() + assert result == ("AGENTS.md", FileOperationStatus.UPDATED) - assert content != original_content - assert "Agent Code Patterns Reference" in content + with open(target_path) as f: + assert f.read() != "original" - def test_generate_required_structure_file(self): - """Test generating REQUIRED_STRUCTURE.md file.""" - with tempfile.TemporaryDirectory() as temp_dir: - agent_dir = os.path.join(temp_dir, ".agent") - os.makedirs(agent_dir, exist_ok=True) - result = generate_agent_md_file( - agent_dir, "REQUIRED_STRUCTURE.md", "uipath_langchain._resources", False - ) - assert result is not None - file_name, status = result - assert file_name == "REQUIRED_STRUCTURE.md" - assert status == FileOperationStatus.CREATED - - target_path = os.path.join(agent_dir, "REQUIRED_STRUCTURE.md") - assert os.path.exists(target_path) - with open(target_path, "r") as f: - content = f.read() - assert "Required Agent Structure" in content - - def test_file_skipped_when_no_override(self): - """Test that an existing file is skipped when no_agents_md_override is True.""" + def test_existing_file_skipped_when_no_override(self): with tempfile.TemporaryDirectory() as temp_dir: target_path = os.path.join(temp_dir, "AGENTS.md") - original_content = "Original content" with open(target_path, "w") as f: - f.write(original_content) + f.write("user content") result = generate_agent_md_file( temp_dir, "AGENTS.md", "uipath_langchain._resources", True ) - assert result is not None - file_name, status = result - assert file_name == "AGENTS.md" - assert status == FileOperationStatus.SKIPPED + assert result == ("AGENTS.md", FileOperationStatus.SKIPPED) - # Verify the file was not modified - with open(target_path, "r") as f: - content = f.read() - assert content == original_content + with open(target_path) as f: + assert f.read() == "user content" class TestGenerateSpecificAgentsMdFiles: - """Tests for the generate_specific_agents_md_files function.""" + """Tests for the generate_specific_agents_md_files entry point.""" - def test_generate_all_files(self): - """Test that all agent documentation files are generated.""" + def test_emits_agents_md_and_claude_shim(self): with tempfile.TemporaryDirectory() as temp_dir: results = list(generate_specific_agents_md_files(temp_dir, False)) - # Check that we got results for all files - assert len(results) == 5 file_names = [name for name, _ in results] - assert "AGENTS.md" in file_names - assert "REQUIRED_STRUCTURE.md" in file_names - assert "CLAUDE.md" in file_names - assert "CLI_REFERENCE.md" in file_names - assert "SDK_REFERENCE.md" in file_names - - # Check all were created (not updated or skipped) - for _, status in results: - assert status == FileOperationStatus.CREATED - - agent_dir = os.path.join(temp_dir, ".agent") - assert os.path.exists(agent_dir) - assert os.path.isdir(agent_dir) - - agents_md_path = os.path.join(temp_dir, "AGENTS.md") - assert os.path.exists(agents_md_path) + assert file_names == ["AGENTS.md", "CLAUDE.md"] + assert all(status == FileOperationStatus.CREATED for _, status in results) - required_structure_path = os.path.join(agent_dir, "REQUIRED_STRUCTURE.md") - assert os.path.exists(required_structure_path) + assert os.path.exists(os.path.join(temp_dir, "AGENTS.md")) + claude_path = os.path.join(temp_dir, "CLAUDE.md") + assert os.path.exists(claude_path) + with open(claude_path) as f: + assert f.read().strip() == "@AGENTS.md" + assert not os.path.exists(os.path.join(temp_dir, ".agent")) - with open(agents_md_path, "r") as f: - agents_content = f.read() - assert "Agent Code Patterns Reference" in agents_content - - with open(required_structure_path, "r") as f: - required_content = f.read() - assert "Required Agent Structure" in required_content - - def test_agent_dir_already_exists(self): - """Test that the existing .agent directory doesn't cause errors.""" + def test_default_does_not_bundle_offline_docs(self): with tempfile.TemporaryDirectory() as temp_dir: - agent_dir = os.path.join(temp_dir, ".agent") - os.makedirs(agent_dir, exist_ok=True) + list(generate_specific_agents_md_files(temp_dir, False)) - results = list(generate_specific_agents_md_files(temp_dir, False)) - assert len(results) == 5 - assert os.path.exists(agent_dir) + assert not os.path.exists( + os.path.join(temp_dir, ".uipath", "llms-full.txt") + ) + # default AGENTS.md must not reference the offline fallback + with open(os.path.join(temp_dir, "AGENTS.md")) as f: + assert ".uipath/llms-full.txt" not in f.read() - def test_files_overwritten(self): - """Test that existing files are overwritten.""" + def test_with_offline_docs_bundles_llms_full(self): with tempfile.TemporaryDirectory() as temp_dir: - agents_md_path = os.path.join(temp_dir, "AGENTS.md") - original_content = "Custom documentation" - with open(agents_md_path, "w") as f: - f.write(original_content) - - results = list(generate_specific_agents_md_files(temp_dir, False)) + list( + generate_specific_agents_md_files( + temp_dir, False, with_offline_docs=True + ) + ) - # Check that AGENTS.md was updated, others were created - agents_result = [r for r in results if r[0] == "AGENTS.md"] - assert len(agents_result) == 1 - _, status = agents_result[0] - assert status == FileOperationStatus.UPDATED + # llms-full.txt is bundled in the wheel; if running from a dev + # install where the file is missing, the .uipath dir is still + # created but the file may be absent. When the file is present, + # AGENTS.md gains a third step pointing at it. + uipath_dir = os.path.join(temp_dir, ".uipath") + assert os.path.isdir(uipath_dir) + if os.path.exists(os.path.join(uipath_dir, "llms-full.txt")): + with open(os.path.join(temp_dir, "AGENTS.md")) as f: + assert ".uipath/llms-full.txt" in f.read() + + def test_skip_existing_with_no_override(self): + with tempfile.TemporaryDirectory() as temp_dir: + agents_path = os.path.join(temp_dir, "AGENTS.md") + with open(agents_path, "w") as f: + f.write("user content") - with open(agents_md_path, "r") as f: - content = f.read() + results = list(generate_specific_agents_md_files(temp_dir, True)) - assert content != original_content - assert "Agent Code Patterns Reference" in content + statuses = {name: status for name, status in results} + assert statuses["AGENTS.md"] == FileOperationStatus.SKIPPED + assert statuses["CLAUDE.md"] == FileOperationStatus.CREATED + with open(agents_path) as f: + assert f.read() == "user content" - def test_files_skipped_when_no_override(self): - """Test that existing files are skipped when no_agents_md_override is True.""" + def test_overwrite_by_default(self): with tempfile.TemporaryDirectory() as temp_dir: - # Create some existing files - agents_md_path = os.path.join(temp_dir, "AGENTS.md") - claude_md_path = os.path.join(temp_dir, "CLAUDE.md") - with open(agents_md_path, "w") as f: - f.write("Existing AGENTS.md") - with open(claude_md_path, "w") as f: - f.write("Existing CLAUDE.md") + agents_path = os.path.join(temp_dir, "AGENTS.md") + with open(agents_path, "w") as f: + f.write("user content") - results = list(generate_specific_agents_md_files(temp_dir, True)) + results = list(generate_specific_agents_md_files(temp_dir, False)) - # Check that existing files were skipped - skipped_files = [ - name - for name, status in results - if status == FileOperationStatus.SKIPPED - ] - assert "AGENTS.md" in skipped_files - assert "CLAUDE.md" in skipped_files - - # Check that non-existing files were created - created_files = [ - name - for name, status in results - if status == FileOperationStatus.CREATED - ] - assert "CLI_REFERENCE.md" in created_files - assert "SDK_REFERENCE.md" in created_files - assert "REQUIRED_STRUCTURE.md" in created_files - - # Verify the existing files were not modified - with open(agents_md_path, "r") as f: - assert f.read() == "Existing AGENTS.md" - with open(claude_md_path, "r") as f: - assert f.read() == "Existing CLAUDE.md" + statuses = {name: status for name, status in results} + assert statuses["AGENTS.md"] == FileOperationStatus.UPDATED + assert statuses["CLAUDE.md"] == FileOperationStatus.CREATED + with open(agents_path) as f: + assert f.read() != "user content" diff --git a/uv.lock b/uv.lock index 00f0c9847..c066d301c 100644 --- a/uv.lock +++ b/uv.lock @@ -4375,7 +4375,7 @@ wheels = [ [[package]] name = "uipath-langchain" -version = "0.10.20" +version = "0.10.21" source = { editable = "." } dependencies = [ { name = "a2a-sdk" },