diff --git a/PRERESUISITES.md b/PREREQUISITIES.md similarity index 50% rename from PRERESUISITES.md rename to PREREQUISITIES.md index 47f2578..7868f60 100644 --- a/PRERESUISITES.md +++ b/PREREQUISITIES.md @@ -10,53 +10,16 @@ ## Common Prerequisites ### Required Software -1. **UV Package Manager** - - Fast Python package installer and resolver (handles Python installation) - - Installation options: - - Using pip (if Python exists): `pip install uv` - - Using pipx: `pipx install uv` - - Download from: https://github.com/astral-sh/uv - - Verify installation: `uv --version` - -2. **Git** +**Git** - For version control and cloning the repository - Check version: `git --version` -3. **Node.js and npm** (For MCP Server integration) - - Required for running the MCP remote client - - Node.js v14.0 or higher required - - Download from: https://nodejs.org/ - - Check versions: `node --version` and `npm --version` - -4. **Cursor** (AI-Powered Code Editor) - - Modern AI-enhanced code editor - - Download from: https://cursor.sh/ - - Check version: `cursor --version` - -### Optional Software -6. **Claude Desktop App** (Optional but recommended) - - Download from: https://claude.ai/download - - Used for testing the agent via MCP Server integration - ## UiPath Cloud Configuration ### 1. UiPath Account Setup -1. **Create UiPath Account**: - - Sign up at: https://staging.uipath.com/ - -2. **Generate Personal Access Token (PAT)**: - - In the top right corner, click on the icon to open your user menu - - Go to Preferences > Personal Access Tokens - - Click "Generate Token" - - Name: "Company Agent Token" - - Expiration: Set appropriate duration - - Scope: Select "Orchestrator API Access (All)" - - **Important**: Save the token securely - it won't be shown again - -## Anthropic Configuration - -If you want to follow along with your own anthropic account, you will need an API Key from your account. Ensure you have sufficient credits or billing set up and monitor the usage. +**Create UiPath Account**: + - Sign up at: https://cloud.uipath.com/tpenlabs/AgenticILT ## macOS Prerequisites @@ -69,7 +32,7 @@ If you want to follow along with your own anthropic account, you will need an AP - **SSL Certificates**: macOS may require additional certificates for HTTPS requests: ```bash - uv pip install --upgrade certifi + pip install --upgrade certifi ``` If the SSL Certificates validation still fails with error `https.ConnectError: [SSL: CERTIFY_VERIFY_FAILED]`, the problem could be caused by a proxy, and trusting the proxy CA might help: @@ -96,10 +59,8 @@ If you want to follow along with your own anthropic account, you will need an AP ``` ### Python Dependencies -The project uses UV for dependency management. Core dependencies include: +The project uses `pip` for dependency management. Core dependencies include: - `uipath-langchain>=0.0.106` - UiPath integration for LangChain -- `langchain-anthropic>=0.3.8` - Anthropic Claude integration - `langchain-openai` - OpenAI GPT integration - `ipykernel` - Jupyter notebook support - `jupyter` - Jupyter notebook environment -- `pexpect` - Process spawning for authentication diff --git a/README.md b/README.md index ea12ec9..4447f7f 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,9 @@ Rename-Item .env.fixed .env There are multiple ways of setting up the jupyter kernel. If you are using this method, make sure you restart `cursor` after creating the jupyter kernel. ```bash - uv init -p 3.11 - uv add ipykernel jupyter - uv run python -m ipykernel install --user --name=jupyter-uv-env --display-name "UiPathCodedAgents" + !py -m venv .venv + !.venv\Scripts\pip install ipykernel jupyter + !.venv\Scripts\python -m ipykernel install --user --name=jupyter-uv-env --display-name "WellsFargoLab" ``` 4. **Environment Variables** (`.env` file - optiona, you will create it in the `hello-world.ipynb` if needed): @@ -56,7 +56,6 @@ Rename-Item .env.fixed .env ```bash echo " UIPATH_FOLDER_PATH=Payments # or your specific folder - ANTHROPIC_API_KEY=your-anthropic-api-key " >> .env ``` diff --git a/agent.ipynb b/agent.ipynb index a21417e..0967920 100644 --- a/agent.ipynb +++ b/agent.ipynb @@ -47,9 +47,6 @@ "\n", "**Solution & Steps**\n", "\n", - "

\"Agent

\n", - "\n", - "\n", "1. **Define the Company Policy Reference**\n", "\n", "2. **Create UiPath Context Grounding Index from the policy text**\n", @@ -64,9 +61,6 @@ "\n", "5. **Deploy the Coded Agent as a process within UiPath Platform**\n", "\n", - "6. **Expose the Policy Agent via UiPath MCP Server**\n", - " 1. Get a Personal Access Token (PAT) \n", - " 2. Setup Claude Desktop \n", "\n", "\n" ] @@ -89,15 +83,15 @@ }, { "cell_type": "code", + "execution_count": null, "id": "ae7b7284", "metadata": {}, + "outputs": [], "source": [ "import shutil\n", "\n", "shutil.copy(\"resources/company_policy.txt\", \"company_policy.txt\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -146,77 +140,48 @@ }, { "cell_type": "code", - "id": "51fa0c23", + "execution_count": null, + "id": "bd6a673e", "metadata": {}, - "source": [ - "# check prerequisites in README.md and create the env and the jupyter kernel" - ], "outputs": [], - "execution_count": null + "source": [ + "!py -m venv .venv\n", + "!.venv\\Scripts\\pip install ipykernel jupyter\n", + "!.venv\\Scripts\\python -m ipykernel install --user --name=jupyter-uv-env --display-name \"WellsFargoLab\"" + ] }, { "cell_type": "code", + "execution_count": null, "id": "aa8411bd", "metadata": {}, - "source": [ - "# Install the uipath package\n", - "!uv add --active uipath-langchain" - ], "outputs": [], - "execution_count": null + "source": [ + "# Install the uipath package and upgrade it\n", + "%pip install --upgrade uipath-langchain" + ] }, { "cell_type": "code", + "execution_count": null, "id": "f3bffb31", "metadata": {}, - "source": [ - "# Verify the uipath installation\n", - "!uv run --active uipath -lv" - ], "outputs": [], - "execution_count": null - }, - { - "cell_type": "code", - "id": "d04410a8", - "metadata": {}, "source": [ - "!uv sync --upgrade --active" - ], - "outputs": [], - "execution_count": null + "# Verify the uipath installation using pip\n", + "%pip show uipath-langchain" + ] }, { "cell_type": "code", + "execution_count": null, "id": "60a30976", "metadata": {}, - "source": [ - "#Initialize the UiPath LangChain agent. replace your name here\n", - "!uv run --active uipath new companyAgent-" - ], "outputs": [], - "execution_count": null - }, - { - "cell_type": "code", - "id": "b6a3d346", - "metadata": {}, "source": [ - "!uv add --active langchain-openai" - ], - "outputs": [], - "execution_count": null - }, - { - "cell_type": "code", - "id": "961abd73", - "metadata": {}, - "source": [ - "# Install the langchain anthropic package\n", - "!uv add --active langchain-anthropic" - ], - "outputs": [], - "execution_count": null + "#Initialize the UiPath LangChain agent. replace your name here\n", + "!uipath new companyAgent-<<< ADD YOUR NAME HERE >>>" + ] }, { "cell_type": "markdown", @@ -230,14 +195,14 @@ }, { "cell_type": "code", + "execution_count": null, "id": "1c497d67", "metadata": {}, + "outputs": [], "source": [ "# Authenticate to UiPath Staging. Make sure to specify the name of the target Tenant \n", - "!uv run --active uipath auth --staging --force --tenant \"AgentsProCode\"" - ], - "outputs": [], - "execution_count": null + "!uipath auth --force --tenant AgenticILT" + ] }, { "cell_type": "markdown", @@ -247,7 +212,7 @@ "✏️ Check if the credentials were copied in the [`.env`](./.env) file. It should look somehting like this:\n", "\n", "```env\n", - "UIPATH_URL=https://staging.uipath.com/xxxxxxxx/DefaultTenant\n", + "UIPATH_URL=https://cloud.uipath.com/tpenlabs/AgenticILT\n", "UIPATH_TENANT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n", "UIPATH_ORGANIZATION_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\n", "UIPATH_ACCESS_TOKEN=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.xxxxxxxxxxxxxxxxxxxxx\n" @@ -267,8 +232,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "b1a94d9f", "metadata": {}, + "outputs": [], "source": [ "# %%writefile -a main.py\n", "\n", @@ -307,9 +274,7 @@ "If not covered:\n", "\n", "\"\"\"" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -321,8 +286,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "5543ff14", "metadata": {}, + "outputs": [], "source": [ "# %%writefile -a main.py\n", "\n", @@ -347,14 +314,14 @@ " if not data_queried:\n", " raise Exception(\"Ingestion is taking too long.\")\n", " return context_data" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "188c0841", "metadata": {}, + "outputs": [], "source": [ "# %%writefile -a main.py\n", "\n", @@ -389,9 +356,7 @@ " # result = await policy_agent.ainvoke(new_state)\n", " result = await llm.ainvoke(messages)\n", " return GraphOutput(response=result.content)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -400,11 +365,11 @@ "source": [ "**Set the LLM model and its parameters**\n", "\n", - "> **Recommended: Use Option 2 (UiPathAzureChatOpenAI)** - No API key required, uses your existing UiPath authentication.\n", + "> **Recommended: Use Option 2 (UiPathChatOpenAI)** - No API key required, uses your existing UiPath authentication.\n", "\n", "> **Available Models:** For the list of available models, refer to the [list of available models (under \"agenthub\")](https://github.com/UiPath/gitops-centralized-cluster/blob/master/projects/prod/llms/llmgateway-service/llmgateway-service-values.yaml#L2301) or use `sdk.agenthub.get_available_llm_models()` to fetch available models programmatically.\n", "\n", - "> **Note:** All `resources/mainX.py` files use `ChatOpenAI` by default. To use UiPath LLM instead (no API key needed), change `llm = ChatOpenAI(...)` to `llm = UiPathAzureChatOpenAI(...)` in the respective file before running.\n", + "> **Note:** All `resources/mainX.py` files use `ChatOpenAI` by default. To use UiPath LLM instead (no API key needed), change `llm = ChatOpenAI(...)` to `llm = UiPathChatOpenAI(...)` in the respective file before running.\n", "\n", "---\n", "\n", @@ -416,22 +381,24 @@ }, { "cell_type": "code", + "execution_count": null, "id": "a0dc0411", "metadata": {}, + "outputs": [], "source": [ "# TEMPORARY API KEY (FOR TESTING PURPOSES-WILL BE REMOVED AFTER THE SESSION)\n", "\n", "with open(\".env\", \"a\") as f:\n", " f.write(\"\\nOPENAI_API_KEY=****\\n\")\n", - " f.write(\"UIPATH_FOLDER_PATH=Shared\\n\")" - ], - "outputs": [], - "execution_count": null + " f.write(\"UIPATH_FOLDER_PATH=WellsFargoCodedAgents\\n\")" + ] }, { "cell_type": "code", + "execution_count": null, "id": "f7bfdb78", "metadata": {}, + "outputs": [], "source": [ "from langchain_openai import ChatOpenAI\n", "\n", @@ -446,30 +413,30 @@ " timeout=30,\n", " max_retries=2,\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", "id": "71fdb175", "metadata": {}, "source": [ - "**Option 2 (Recommended).** UiPath provides two chat models: `UiPathAzureChatOpenAI` and `UiPathChat`. These are compatible with `LangGraph` as drop-in replacements. \n", + "**Option 2 (Recommended).** UiPath provides multiple chat models, for example: `UiPathChatOpenAI` and `UiPathChat`. These are compatible with `LangGraph` as drop-in replacements. \n", "\n", "**No API Key required** - uses your existing UiPath authentication token.\n", "\n", - "> **Important:** If you want to use this option, you must also update `resources/main1.py` to use `UiPathAzureChatOpenAI` instead of `ChatOpenAI`, since that file gets copied to `main.py` later in the notebook." + "> **Important:** If you want to use this option, you must also update `resources/main1.py` to use `UiPathChatOpenAI` instead of `ChatOpenAI`, since that file gets copied to `main.py` later in the notebook." ] }, { "cell_type": "code", + "execution_count": null, "id": "4cffe990", "metadata": {}, + "outputs": [], "source": [ - "from uipath_langchain.chat.models import UiPathAzureChatOpenAI\n", + "from uipath_langchain.chat import UiPathChatOpenAI\n", "\n", - "llm = UiPathAzureChatOpenAI(\n", + "llm = UiPathChatOpenAI(\n", " model=\"gpt-4o-2024-08-06\",\n", " temperature=0,\n", " max_tokens=4000,\n", @@ -477,9 +444,7 @@ " max_retries=2,\n", " # other params...\n", ")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -491,8 +456,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "96a5414c", "metadata": {}, + "outputs": [], "source": [ "# %%writefile -a main.py\n", "\n", @@ -502,9 +469,7 @@ "\n", "builder.add_edge(START, \"policy\")\n", "builder.add_edge(\"policy\", END)" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -516,35 +481,40 @@ }, { "cell_type": "code", + "execution_count": null, "id": "6370f156", "metadata": {}, + "outputs": [], "source": [ "# %%writefile -a main.py\n", "\n", "# Compile the graph\n", "graph = builder.compile()" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "8c841b19", "metadata": {}, - "source": "# Copy the above python code to the main.py file\n\nimport shutil\nshutil.copyfile(\"resources/main1.py\", \"main.py\")", "outputs": [], - "execution_count": null + "source": [ + "# Copy the above python code to the main.py file\n", + "\n", + "import shutil\n", + "shutil.copyfile(\"resources/main1.py\", \"main.py\")" + ] }, { "cell_type": "code", + "execution_count": null, "id": "4cfa1ed2", "metadata": {}, + "outputs": [], "source": [ "# Initialize the project to make sure all file are up to date\n", - "!uv run --active uipath init" - ], - "outputs": [], - "execution_count": null + "!uipath init" + ] }, { "cell_type": "markdown", @@ -566,8 +536,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "1738dcaa", "metadata": {}, + "outputs": [], "source": [ "# See the Mermaid diagram\n", "from IPython.display import display, Markdown\n", @@ -576,9 +548,7 @@ " mermaid_code = f.read()\n", "\n", "display(Markdown(f\"```mermaid\\n{mermaid_code}\\n```\"))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -594,16 +564,16 @@ }, { "cell_type": "code", + "execution_count": null, "id": "24602b54", "metadata": {}, + "outputs": [], "source": [ "%%writefile input.json\n", "{\n", " \"question\": \"What is the PTO policy for taking 3 days off\"\n", "}" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -617,25 +587,25 @@ }, { "cell_type": "code", + "execution_count": null, "id": "98f7e1fb", "metadata": {}, + "outputs": [], "source": [ "# Re-initialize the project to make sure all file are up to date\n", - "!uv run --active uipath init" - ], - "outputs": [], - "execution_count": null + "!uipath init" + ] }, { "cell_type": "code", + "execution_count": null, "id": "db556fa4", "metadata": {}, + "outputs": [], "source": [ "# Run the agent locally\n", - "!uv run --active uipath run agent --file input.json" - ], - "outputs": [], - "execution_count": null + "!uipath run agent --file input.json" + ] }, { "cell_type": "markdown", @@ -644,7 +614,7 @@ "source": [ "#### πŸš€ Pack & Publish the Agent to UiPath Platform\n", "\n", - "The following steps will **package the Coded Agent** as a UiPath artifact and **publish it at Tenant level**.\n", + "The following steps will **package the Coded Agent** as a UiPath artifact and **publish it at Folder level**.\n", "\n", "---\n", "\n", @@ -670,36 +640,35 @@ "\n", "dependencies = [\n", " \"uipath-langchain>=0.0.106\",\n", - " \"langchain-anthropic>=0.3.8\",\n", "]\n", "\n", - "requires-python = \">=3.10\"\n" + "requires-python = \">=3.11\"\n" ] }, { "cell_type": "code", + "execution_count": null, "id": "9818da8c", "metadata": {}, + "outputs": [], "source": [ "# Auto-increase the version of the package\n", "import re, pathlib\n", "p = pathlib.Path(\"pyproject.toml\"); t = p.read_text()\n", "n = re.sub(r'(?m)^(version\\s*=\\s*\")(\\d+)\\.(\\d+)\\.(\\d+)(\")', lambda m: f'{m.group(1)}{m.group(2)}.{m.group(3)}.{int(m.group(4))+1}{m.group(5)}', t, count=1)\n", "p.write_text(n); print(re.search(r'(?m)^version\\s*=\\s*\"([^\"]+)\"', t).group(1), \"->\", re.search(r'(?m)^version\\s*=\\s*\"([^\"]+)\"', n).group(1))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "16a9ef22", "metadata": {}, - "source": [ - "!uv run --active uipath pack\n", - "!uv run --active uipath publish --tenant" - ], "outputs": [], - "execution_count": null + "source": [ + "!uipath pack\n", + "!uipath publish -f WellsFargoCodedAgents" + ] }, { "cell_type": "markdown", @@ -713,11 +682,10 @@ "

\"Upgrade

\n", "\n", "\n", - "Once published, the coded Agent appears in the Tenant feed as an Agent package.\n", + "Once published, the coded Agent appears in the Folder feed as an Agent package.\n", "\n", - "- **Where to find it**: Orchestrator β†’ Tenant β†’ Packages β†’ Agents\n", + "- **Where to find it**: Orchestrator β†’ WellsFargoCodedAgents Folder β†’ Packages β†’ Agents\n", "\n", - "

\"UiPath

\n", "

\"UiPath

\n", "\n", "- **Next step**: Deploy the package as a process and set the environment variables\n", @@ -730,105 +698,6 @@ "\n" ] }, - { - "cell_type": "markdown", - "id": "ca52ddfd", - "metadata": {}, - "source": [ - "## Step 6. Expose the Policy Agent via UiPath MCP Server\n", - "\n", - "Build a UiPath MCP Server directly in the UiPath platform by adding the `company-policy` agent as a tool and specifying a proper agent description. Once the UiPath MCP Server is built, copy the URL to be configured with the Claude Desktop app.\n", - "\n", - "

\"UiPath

\n" - ] - }, - { - "cell_type": "markdown", - "id": "7c1c908e", - "metadata": {}, - "source": [ - "\n", - "To grant secure access to the company policy, configure the Claude Desktop app to point to the UiPath MCP Server that exposes the `company_policy_agent` tool.\n", - "\n", - "1. Generate a Personal Access Token (PAT) for Claude Desktop to authenticate with the UiPath MCP Server.\n", - "2. Add the UiPath MCP Server to Claude Desktop's MCP Servers list." - ] - }, - { - "cell_type": "markdown", - "id": "df20ba2f", - "metadata": {}, - "source": [ - "### Get a Personal Access Token (PAT)\n", - "\n", - "To generate a Personal Access Token (PAT) In UiPath Orchestrator go to User β†’ Preferences β†’ Personal Access Token. \n", - "\n", - "

\"UiPath

\n", - "\n", - "Set the `Name` and `Expiration date` and add as scope the `Orchestrator API Access (All)`\n", - "\n", - "

\"UiPath

\n", - "\n", - "\n", - "

\"UiPath

\n", - "\n", - "Copy the PAT it will be used to configure Claude Desktop app.\n" - ] - }, - { - "cell_type": "markdown", - "id": "b8d7eb88", - "metadata": {}, - "source": [ - "### Setup Claude Desktop\n", - "\n", - "If not already available, download and install the Claude Desktop app. In the app `Settings` go to `Developer` -> `Edit Config`. \n", - "\n", - "

\"Claude

\n", - "\n", - "\n", - "This will open the claude_desktop_config.jsonwhere the list of MCP Servers is defined. Example:\n", - "\n", - "

\"Claude

\n" - ] - }, - { - "cell_type": "code", - "id": "9a37e909", - "metadata": {}, - "source": [ - "{\n", - " \"mcpServers\": {\n", - " \"CompanyPolicy\": {\n", - " \"command\": \"npx\",\n", - " \"args\": [\n", - " \"-y\",\n", - " \"mcp-remote\",\n", - " \"\",\n", - " \"--header\",\n", - " \"Authorization:${AUTH_HEADER}\"\n", - " ],\n", - " \"env\": {\n", - " \"AUTH_HEADER\": \"Bearer \"\n", - " }\n", - " }\n", - " }\n", - "}" - ], - "outputs": [], - "execution_count": null - }, - { - "cell_type": "markdown", - "id": "a2c6535e", - "metadata": {}, - "source": [ - "Restart Claude Desktop to load the MCP configuration. The tools exposed by the MCP Server should be available and used whenever a related prompt like *β€œI need to buy 10$ worth of API calls from OpenAI, what should I do per my company policy?β€œ is given \n", - "\n", - "

\"Claude

\n", - "\n" - ] - }, { "cell_type": "markdown", "id": "560005d8", @@ -876,8 +745,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "1ce2859b", "metadata": {}, + "outputs": [], "source": [ "# Added GraphState with fields: question, category\n", "from pydantic import BaseModel\n", @@ -886,14 +757,14 @@ " \"\"\"State for the company policy agent graph.\"\"\"\n", " question: str\n", " category: str | None = None\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "7c387bbb", "metadata": {}, + "outputs": [], "source": [ "# Added supervisor_node to classify into Company Policy or Procurement\n", "from langchain_openai import ChatOpenAI\n", @@ -911,14 +782,14 @@ " normalized = {c.lower(): c for c in categories}\n", " category = normalized.get(label.lower(), \"Company Policy\")\n", " return GraphState(question=state.question, category=category)\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "a49ae672", "metadata": {}, + "outputs": [], "source": [ "# Added procurement_node (initially same prompt shape as policy)\n", "from uipath_langchain.retrievers import ContextGroundingRetriever\n", @@ -948,14 +819,14 @@ " class GraphOutput(BaseModel):\n", " response: str\n", " return GraphOutput(response=result.content)\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "c4a68723", "metadata": {}, + "outputs": [], "source": [ "# Added route_by_category(state) to return the next node key\n", "\n", @@ -963,14 +834,14 @@ " if state.category and state.category.lower() == \"procurement\":\n", " return \"procurement\"\n", " return \"policy\"\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "9a575dfa", "metadata": {}, + "outputs": [], "source": [ "# Rewired graph: START -> supervisor -> (policy | procurement) -> END (demo wiring)\n", "from importlib import reload\n", @@ -1003,9 +874,7 @@ "builder_demo.add_edge(\"procurement\", END)\n", "\n", "demo_graph = builder_demo.compile()\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -1025,27 +894,36 @@ }, { "cell_type": "code", + "execution_count": null, "id": "08bfc764", "metadata": {}, - "source": "# Update the main.py\nfrom pathlib import Path\nsrc = Path(\"resources/main2_multiple_agents.py\")\ndst = Path(\"main.py\")\ndst.write_text(src.read_text(), encoding=\"utf-8\")\nprint(\"Synchronized main.py from resources/main2_multiple_agents.py\")", "outputs": [], - "execution_count": null + "source": [ + "# Update the main.py\n", + "from pathlib import Path\n", + "src = Path(\"resources/main2_multiple_agents.py\")\n", + "dst = Path(\"main.py\")\n", + "dst.write_text(src.read_text(), encoding=\"utf-8\")\n", + "print(\"Synchronized main.py from resources/main2_multiple_agents.py\")" + ] }, { "cell_type": "code", + "execution_count": null, "id": "600974ff", "metadata": {}, + "outputs": [], "source": [ "# Re-initialize the project to make sure all file are up to date\n", - "!uv run --active uipath init" - ], - "outputs": [], - "execution_count": null + "!uipath init" + ] }, { "cell_type": "code", + "execution_count": null, "id": "2a52d9b8", "metadata": {}, + "outputs": [], "source": [ "# See the Mermaid diagram\n", "from IPython.display import display, Markdown\n", @@ -1054,9 +932,7 @@ " mermaid_code = f.read()\n", "\n", "display(Markdown(f\"```mermaid\\n{mermaid_code}\\n```\"))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -1068,26 +944,26 @@ }, { "cell_type": "code", + "execution_count": null, "id": "460efe5f", "metadata": {}, + "outputs": [], "source": [ "%%writefile input.json\n", "{\n", " \"question\": \"Can I buy an OpenAI subscription for company use?\"\n", "}" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "ccda1b76", "metadata": {}, - "source": [ - "!uv run --active uipath run agent --file input.json" - ], "outputs": [], - "execution_count": null + "source": [ + "!uipath run agent --file input.json" + ] }, { "cell_type": "markdown", @@ -1109,26 +985,26 @@ }, { "cell_type": "code", + "execution_count": null, "id": "e951ca8e", "metadata": {}, + "outputs": [], "source": [ "%%writefile input.json\n", "{\n", " \"question\": \"What is the PTO policy for taking 3 days off?\"\n", "}" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "af599acf", "metadata": {}, - "source": [ - "!uv run --active uipath run agent --file input.json" - ], "outputs": [], - "execution_count": null + "source": [ + "!uipath run agent --file input.json" + ] }, { "cell_type": "markdown", @@ -1179,27 +1055,37 @@ }, { "cell_type": "code", + "execution_count": null, "id": "efd48c77", "metadata": {}, - "source": "# Update main.py with Validation node\n\nfrom pathlib import Path\nsrc = Path(\"resources/main3_validation.py\")\ndst = Path(\"main.py\")\ndst.write_text(src.read_text(), encoding=\"utf-8\")\nprint(\"Synchronized main.py from resources/main3_validation.py\")", "outputs": [], - "execution_count": null + "source": [ + "# Update main.py with Validation node\n", + "\n", + "from pathlib import Path\n", + "src = Path(\"resources/main3_validation.py\")\n", + "dst = Path(\"main.py\")\n", + "dst.write_text(src.read_text(), encoding=\"utf-8\")\n", + "print(\"Synchronized main.py from resources/main3_validation.py\")" + ] }, { "cell_type": "code", + "execution_count": null, "id": "3cb685d3", "metadata": {}, + "outputs": [], "source": [ "# Re-initialize the project to make sure all file are up to date\n", - "!uv run --active uipath init" - ], - "outputs": [], - "execution_count": null + "!uipath init" + ] }, { "cell_type": "code", + "execution_count": null, "id": "bd77e103", "metadata": {}, + "outputs": [], "source": [ "# See the Mermaid diagram\n", "from IPython.display import display, Markdown\n", @@ -1208,9 +1094,7 @@ " mermaid_code = f.read()\n", "\n", "display(Markdown(f\"```mermaid\\n{mermaid_code}\\n```\"))\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -1222,26 +1106,26 @@ }, { "cell_type": "code", + "execution_count": null, "id": "a60b1e07", "metadata": {}, + "outputs": [], "source": [ "%%writefile input.json\n", "{\n", " \"question\": \"Can I buy an OpenAI subscription for company use?\"\n", "}" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "59c13fe5", "metadata": {}, - "source": [ - "!uv run --active uipath run agent --file input.json\n" - ], "outputs": [], - "execution_count": null + "source": [ + "!uipath run agent --file input.json\n" + ] }, { "cell_type": "markdown", @@ -1263,8 +1147,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "49f9df01", "metadata": {}, + "outputs": [], "source": [ "%%writefile input.json\n", "{\n", @@ -1272,19 +1158,17 @@ " \"email\": \"eusebiu.jecan@uipath.com\",\n", " \"code\": \"4827\"\n", "}" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "b99b8fc6", "metadata": {}, - "source": [ - "!uv run --active uipath run agent --file input.json" - ], "outputs": [], - "execution_count": null + "source": [ + "!uipath run agent --file input.json" + ] }, { "cell_type": "markdown", @@ -1340,27 +1224,37 @@ }, { "cell_type": "code", + "execution_count": null, "id": "2c4d7dcb", "metadata": {}, - "source": "# Update main.py with HR Agent\n\nfrom pathlib import Path\nsrc = Path(\"resources/main4_hr.py\")\ndst = Path(\"main.py\")\ndst.write_text(src.read_text(), encoding=\"utf-8\")\nprint(\"Synchronized main.py from resources/main4_hr.py\")", "outputs": [], - "execution_count": null + "source": [ + "# Update main.py with HR Agent\n", + "\n", + "from pathlib import Path\n", + "src = Path(\"resources/main4_hr.py\")\n", + "dst = Path(\"main.py\")\n", + "dst.write_text(src.read_text(), encoding=\"utf-8\")\n", + "print(\"Synchronized main.py from resources/main4_hr.py\")" + ] }, { "cell_type": "code", + "execution_count": null, "id": "51588be7", "metadata": {}, + "outputs": [], "source": [ "# Re-initialize the project to make sure all file are up to date\n", - "!uv run --active uipath init" - ], - "outputs": [], - "execution_count": null + "!uipath init" + ] }, { "cell_type": "code", + "execution_count": null, "id": "77bc25c8", "metadata": {}, + "outputs": [], "source": [ "# See the Mermaid diagram\n", "from IPython.display import display, Markdown\n", @@ -1369,14 +1263,14 @@ " mermaid_code = f.read()\n", "\n", "display(Markdown(f\"```mermaid\\n{mermaid_code}\\n```\"))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "84cfbb86", "metadata": {}, + "outputs": [], "source": [ "%%writefile input.json\n", "{\n", @@ -1384,19 +1278,17 @@ " \"email\": \"eusebiu.jecan@uipath.com\",\n", " \"code\": \"4827\"\n", "}" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "879457a4", "metadata": {}, - "source": [ - "!uv run --active uipath run agent --file input.json" - ], "outputs": [], - "execution_count": null + "source": [ + "!uipath run agent --file input.json" + ] }, { "cell_type": "markdown", @@ -1441,27 +1333,37 @@ }, { "cell_type": "code", + "execution_count": null, "id": "cf539f3a", "metadata": {}, - "source": "# Update main.py with Permission Check for HR\n\nfrom pathlib import Path\nsrc = Path(\"resources/main5_permission_check_hr.py\")\ndst = Path(\"main.py\")\ndst.write_text(src.read_text(), encoding=\"utf-8\")\nprint(\"Synchronized main.py from resources/main5_permission_check_hr.py\")", "outputs": [], - "execution_count": null + "source": [ + "# Update main.py with Permission Check for HR\n", + "\n", + "from pathlib import Path\n", + "src = Path(\"resources/main5_permission_check_hr.py\")\n", + "dst = Path(\"main.py\")\n", + "dst.write_text(src.read_text(), encoding=\"utf-8\")\n", + "print(\"Synchronized main.py from resources/main5_permission_check_hr.py\")" + ] }, { "cell_type": "code", + "execution_count": null, "id": "765c2e5e", "metadata": {}, + "outputs": [], "source": [ "# Re-initialize the project to make sure all file are up to date\n", - "!uv run --active uipath init" - ], - "outputs": [], - "execution_count": null + "!uipath init" + ] }, { "cell_type": "code", + "execution_count": null, "id": "91b8ccd6", "metadata": {}, + "outputs": [], "source": [ "# See the Mermaid diagram\n", "from IPython.display import display, Markdown\n", @@ -1470,9 +1372,7 @@ " mermaid_code = f.read()\n", "\n", "display(Markdown(f\"```mermaid\\n{mermaid_code}\\n```\"))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "markdown", @@ -1484,8 +1384,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "13694a3f", "metadata": {}, + "outputs": [], "source": [ "# Create a local HR authorization file (allow-list)\n", "import json, os, textwrap\n", @@ -1502,14 +1404,14 @@ " json.dump(auth, f, indent=2)\n", "\n", "print(\"Created hr_auth.json with allow-list:\", auth[\"allowed_emails\"])" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "2163b6b2", "metadata": {}, + "outputs": [], "source": [ "%%writefile input.json\n", "{\n", @@ -1517,19 +1419,17 @@ " \"email\": \"eusebiu.jecan@uipath.com\",\n", " \"code\": \"4827\"\n", "}" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "e91028f9", "metadata": {}, - "source": [ - "!uv run --active uipath run agent --file input.json" - ], "outputs": [], - "execution_count": null + "source": [ + "!uipath run agent --file input.json" + ] }, { "cell_type": "markdown", @@ -1543,8 +1443,10 @@ }, { "cell_type": "code", + "execution_count": null, "id": "d03ca464", "metadata": {}, + "outputs": [], "source": [ "%%writefile input.json\n", "{\n", @@ -1552,19 +1454,17 @@ " \"email\": \"somenone@uipath.com\",\n", " \"code\": \"4827\"\n", "}" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "7bcfb714", "metadata": {}, - "source": [ - "!uv run --active uipath run agent --file input.json" - ], "outputs": [], - "execution_count": null + "source": [ + "!uipath run agent --file input.json" + ] }, { "cell_type": "markdown", @@ -1594,11 +1494,19 @@ }, { "cell_type": "code", + "execution_count": null, "id": "741940fa", "metadata": {}, - "source": "# Update main.py with Human in the loop\n\nfrom pathlib import Path\nsrc = Path(\"resources/main6_HITL.py\")\ndst = Path(\"main.py\")\ndst.write_text(src.read_text(), encoding=\"utf-8\")\nprint(\"Synchronized main.py from resources/main6_HITL.py\")", "outputs": [], - "execution_count": null + "source": [ + "# Update main.py with Human in the loop\n", + "\n", + "from pathlib import Path\n", + "src = Path(\"resources/main6_HITL.py\")\n", + "dst = Path(\"main.py\")\n", + "dst.write_text(src.read_text(), encoding=\"utf-8\")\n", + "print(\"Synchronized main.py from resources/main6_HITL.py\")" + ] }, { "cell_type": "markdown", @@ -1610,20 +1518,22 @@ }, { "cell_type": "code", + "execution_count": null, "id": "68e23bbe", "metadata": {}, + "outputs": [], "source": [ "# Re-initialize the project to make sure all file are up to date\n", "\n", - "!uv run --active uipath init" - ], - "outputs": [], - "execution_count": null + "!uipath init" + ] }, { "cell_type": "code", + "execution_count": null, "id": "6edb1216", "metadata": {}, + "outputs": [], "source": [ "# Visualize the current graph (Mermaid)\n", "from IPython.display import display, Markdown\n", @@ -1632,14 +1542,14 @@ " mermaid_code = f.read()\n", "\n", "display(Markdown(f\"```mermaid\\n{mermaid_code}\\n```\"))" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "66d07bdc", "metadata": {}, + "outputs": [], "source": [ "%%writefile input.json\n", "{\n", @@ -1647,14 +1557,14 @@ " \"email\": \"eusebiu.jecan@uipath.com\",\n", " \"code\": \"4827\"\n", "}" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "c15c4ecc", "metadata": {}, + "outputs": [], "source": [ "# Ensure only the correct UIPATH_URL is enabled in .env\n", "lines = []\n", @@ -1666,21 +1576,21 @@ " else:\n", " lines.append(line)\n", "# Add the correct UIPATH_URL at the end\n", - "lines.append(\"UIPATH_URL=https://staging.uipath.com/9b42e25e-2062-4988-ab22-9f2383bf49a2/9f4094e2-dadf-4c2c-bc16-b01217e05ca6\\n\")\n", + "lines.append(\"UIPATH_URL=https://cloud.uipath.com/722912cc-2151-46d4-812f-dd2d575f0739/e12bc62d-a788-4bfd-a29f-74b907ec6ca5\\n\")\n", "with open(\".env\", \"w\", encoding=\"utf-8\") as f:\n", " f.writelines(lines)\n", "print(\"Updated .env with the correct UIPATH_URL\")\n" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "fbf1ac6e", "metadata": {}, + "outputs": [], "source": [ "# Set the HITL assignee email \n", - "HITL_ASSIGNEE_EMAIL = \"\" # <--- Change this value with teh e-mail you signed up within UiPath\n", + "HITL_ASSIGNEE_EMAIL = \"allowed.email@provider.com\" # <--- Change this value with teh e-mail you signed up within UiPath\n", "\n", "from pathlib import Path\n", "import re\n", @@ -1700,29 +1610,46 @@ "\n", "main_path.write_text(\"\\n\".join(lines), encoding=\"utf-8\")\n", "print(f\"Updated HITL assignee email in main.py to: {HITL_ASSIGNEE_EMAIL}\")" - ], - "outputs": [], - "execution_count": null + ] }, { "cell_type": "code", + "execution_count": null, "id": "054bdf9c", "metadata": {}, - "source": [ - "!uv run --active uipath run agent --file input.json" - ], "outputs": [], - "execution_count": null + "source": [ + "!uipath run agent --file input.json" + ] }, { "cell_type": "code", + "execution_count": null, "id": "15399994", "metadata": {}, + "outputs": [], "source": [ - "!uv run --active uipath run agent --resume " - ], + "!uipath run agent --resume " + ] + }, + { + "cell_type": "markdown", + "id": "84163e0c", + "metadata": {}, + "source": [ + "## Local development\n", + "After installing the `uipath-dev` package, you can open your terminal and run the command `uipath dev` to see your agent in action, including logs and traces." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "e4885015", + "metadata": {}, "outputs": [], - "execution_count": null + "source": [ + "%pip install uipath-dev" + ] }, { "cell_type": "markdown", @@ -1730,10 +1657,6 @@ "metadata": {}, "source": [ "# Evals\n", - "# Traces\n", - "## Local Traces\n", - "## UiPath Traces\n", - "## LangSmith Traces\n", "# MCP\n", "# Vibe Coding" ] @@ -1746,7 +1669,7 @@ "notebook_metadata_filter": "-all" }, "kernelspec": { - "display_name": "FUSION2025", + "display_name": "WellsFargoLab", "language": "python", "name": "jupyter-uv-env" }, @@ -1760,7 +1683,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.13" + "version": "3.13.7" } }, "nbformat": 4, diff --git a/hello-world.ipynb b/hello-world.ipynb index d73e681..497d86e 100644 --- a/hello-world.ipynb +++ b/hello-world.ipynb @@ -25,9 +25,9 @@ "metadata": {}, "outputs": [], "source": [ - "!uv init -p 3.11\n", - "!uv add ipykernel jupyter\n", - "!uv run python -m ipykernel install --user --name=jupyter-uv-env --display-name \"FUSION2025\"" + "!py -m venv .venv\n", + "!.venv\\Scripts\\pip install ipykernel jupyter\n", + "!.venv\\Scripts\\python -m ipykernel install --user --name=jupyter-uv-env --display-name \"WellsFargoLab\"" ] }, { @@ -69,9 +69,9 @@ "id": "5f3dd477", "metadata": {}, "source": [ - "Navigate to [staging.uipath.com](https://staging.uipath.com) and login to the organization `UiPathFusionWorkshops`.\n", + "Navigate to [cloud.uipath.com](https://cloud.uipath.com/tpenlabs/AgenticILT) and login to the organization `tpenlabs`.\n", "\n", - "From the top right dropdown select the `AgentsProCode` tenant.\n", + "From the top right dropdown select the `AgenticILT` tenant.\n", "\n", "The landing page will show you the available services. Go to Orchestrator.\n", "\n", @@ -94,9 +94,9 @@ "metadata": {}, "source": [ "\n", - "You have access to the Shared folder. \n", + "You have access to the WellsFargoCodedAgents folder. \n", "\n", - "Create a subfolder using an unique name, example: `Fusion25-`.\n", + "Create a subfolder using an unique name, example: `WellsFargoCodedAgents-`.\n", "\n", "You will publish the packages to the tenant feed and define your automations in this folder.\n", "\n", @@ -107,34 +107,6 @@ "![](./resources/prerequisites/2010-create-subfolder-3.png)\n" ] }, - { - "cell_type": "markdown", - "id": "8ce26a89", - "metadata": {}, - "source": [ - "### Use the folder name in the .env file\n", - "\n", - "Copy the folder Path. Use it to configure the corresponding environment variable `UIPATH_FOLDER_PATH=Shared/Fusion25-`." - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "1542fb43", - "metadata": {}, - "outputs": [], - "source": [ - "!echo UIPATH_FOLDER_NAME=\"<<< INSERT FOLDER PATH HERE >>>\" >> .env" - ] - }, - { - "cell_type": "markdown", - "id": "a9d326c9", - "metadata": {}, - "source": [ - "![](./resources/prerequisites/0050-copy-folder-path.png)" - ] - }, { "cell_type": "markdown", "id": "7ad58ad1", @@ -158,7 +130,7 @@ "metadata": {}, "outputs": [], "source": [ - "!uv add uipath-langchain" + "%pip install uipath-langchain" ] }, { @@ -182,8 +154,7 @@ "metadata": {}, "outputs": [], "source": [ - "!uv run uipath new agent-<<< ADD YOUR NAME HERE >>>\n", - "!uv add ipykernel jupyter" + "!uipath new agent-<<< ADD YOUR NAME HERE >>>" ] }, { @@ -207,7 +178,7 @@ "metadata": {}, "outputs": [], "source": [ - "!uv run uipath auth --staging --force --tenant AgentsProCode" + "!uipath auth --tenant AgenticILT" ] }, { @@ -240,18 +211,7 @@ "source": [ "You can run the agent locally using `uipath run`.\n", "\n", - "If the predefined model (`gpt-4o-mini-2024-07-18`) is rate-limited or not available you can use another UiPath-hosted model, example: `gpt-4.1-mini-2025-04-14`, `anthropic.claude-3-7-sonnet-20250219-v1:0`. Just edit the model name in the instantiation of `UiPathChat` in `main.py`.\n", - "\n", - "You can also use your own model, by adding the `langchain-anthropic` package and using it like this.\n", - "``` python\n", - "from langchain_anthropic import ChatAnthropic\n", - "llm = ChatAnthropic(model=\"claude-3.5\")\n", - "```\n", - "\n", - "If you use your own model you need to set your API_KEY in the .env file.\n", - "```env\n", - "ANTHROPIC_API_KEY=your-anthropic-api-key\n", - "```" + "If the predefined model (`gpt-4o-mini-2024-07-18`) is rate-limited or not available you can use another UiPath-hosted model, example: `gpt-4.1-mini-2025-04-14`, `anthropic.claude-3-7-sonnet-20250219-v1:0`. Just edit the model name in the instantiation of `UiPathChat` in `main.py`." ] }, { @@ -261,18 +221,7 @@ "metadata": {}, "outputs": [], "source": [ - "!uv run uipath run agent --file input.json" - ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "e69f9151", - "metadata": {}, - "outputs": [], - "source": [ - "# if you need to use your own Anthropic model, install this package:\n", - "!uv add langchain-anthropic" + "!uipath run agent --file input.json" ] }, { @@ -296,7 +245,7 @@ "metadata": {}, "outputs": [], "source": [ - "!uv run uipath init" + "!uipath init" ] }, { @@ -339,8 +288,8 @@ "metadata": {}, "outputs": [], "source": [ - "!uv run uipath pack\n", - "!uv run uipath publish -t " + "!uipath pack\n", + "!uipath publish -f WellsFargoCodedAgents" ] }, { @@ -348,7 +297,7 @@ "id": "a1745421", "metadata": {}, "source": [ - "### Createa a process in the folder\n", + "### Create a process in the folder\n", "\n", "Use your uploaded package to create a `Process` in your folder.\n", "\n", @@ -394,10 +343,6 @@ "\n", "![](./resources/prerequisites/0071-start-job.png)\n", "\n", - "The job was queued. When a robot is ready it will pick it up.\n", - "\n", - "![](./resources/prerequisites/0072-start-job.png)\n", - "\n", "View the job details using the info button on the grid.\n", "\n", "![](./resources/prerequisites/0073-start-job.png)\n", @@ -410,7 +355,7 @@ ], "metadata": { "kernelspec": { - "display_name": "FUSION2025", + "display_name": "WellsFargoLab", "language": "python", "name": "jupyter-uv-env" }, @@ -424,7 +369,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.13" + "version": "3.13.7" } }, "nbformat": 4, diff --git a/resources/UiPath_Agent_Package_Tenant_Feed_Versions.png b/resources/UiPath_Agent_Package_Tenant_Feed_Versions.png index 636535c..6f3528f 100644 Binary files a/resources/UiPath_Agent_Package_Tenant_Feed_Versions.png and b/resources/UiPath_Agent_Package_Tenant_Feed_Versions.png differ diff --git a/resources/hr_auth.json b/resources/hr_auth.json new file mode 100644 index 0000000..e2b837e --- /dev/null +++ b/resources/hr_auth.json @@ -0,0 +1,5 @@ +{ + "allowed_emails": [ + "allowed.email@provider.com" + ] +} \ No newline at end of file diff --git a/resources/main1.py b/resources/main1.py index 479a617..01dd0de 100644 --- a/resources/main1.py +++ b/resources/main1.py @@ -1,4 +1,3 @@ -from langchain_anthropic import ChatAnthropic from langgraph.graph import END, START, MessagesState, StateGraph from langgraph.prebuilt import create_react_agent from pydantic import BaseModel @@ -88,7 +87,7 @@ async def get_context_data_async(retriever: ContextGroundingRetriever, question: async def policy_node(state: GraphInput) -> GraphOutput: retriever = ContextGroundingRetriever( index_name="company-policy-index", - folder_path="Shared", + folder_path="WellsFargoCodedAgents", number_of_results=100, ) try: diff --git a/resources/main2_multiple_agents.py b/resources/main2_multiple_agents.py index b038e3c..7be0468 100644 --- a/resources/main2_multiple_agents.py +++ b/resources/main2_multiple_agents.py @@ -1,4 +1,3 @@ -from langchain_anthropic import ChatAnthropic from langgraph.graph import END, START, StateGraph from pydantic import BaseModel from uipath_langchain.retrievers import ContextGroundingRetriever @@ -91,7 +90,7 @@ class GraphOutput(BaseModel): async def policy_node(state: GraphState) -> GraphOutput: retriever = ContextGroundingRetriever( index_name="company-policy-index", - folder_path="Shared", + folder_path="WellsFargoCodedAgents", number_of_results=100, ) try: @@ -145,7 +144,7 @@ async def procurement_node(state: GraphState) -> GraphOutput: """Procurement specialized agent (initially copied from policy).""" retriever = ContextGroundingRetriever( index_name="procurement-index", - folder_path="Shared", + folder_path="WellsFargoCodedAgents", number_of_results=100, ) try: diff --git a/resources/main3_validation.py b/resources/main3_validation.py index befc1e3..ebd0f36 100644 --- a/resources/main3_validation.py +++ b/resources/main3_validation.py @@ -1,4 +1,3 @@ -from langchain_anthropic import ChatAnthropic from langgraph.graph import END, START, StateGraph from pydantic import BaseModel from uipath_langchain.retrievers import ContextGroundingRetriever @@ -115,7 +114,7 @@ def is_valid_code(code: str | None) -> bool: async def policy_node(state: GraphState) -> GraphOutput: retriever = ContextGroundingRetriever( index_name="company-policy-index", - folder_path="Shared", + folder_path="WellsFargoCodedAgents", number_of_results=100, ) try: @@ -178,7 +177,7 @@ async def procurement_node(state: GraphState) -> GraphOutput: retriever = ContextGroundingRetriever( index_name="procurement-index", - folder_path="Shared", + folder_path="WellsFargoCodedAgents", number_of_results=100, ) try: diff --git a/resources/main4_hr.py b/resources/main4_hr.py index ba9d090..c31d471 100644 --- a/resources/main4_hr.py +++ b/resources/main4_hr.py @@ -1,4 +1,3 @@ -from langchain_anthropic import ChatAnthropic from langgraph.graph import END, START, StateGraph from pydantic import BaseModel from uipath_langchain.retrievers import ContextGroundingRetriever @@ -118,7 +117,7 @@ def is_valid_code(code: str | None) -> bool: async def policy_node(state: GraphState) -> GraphOutput: retriever = ContextGroundingRetriever( index_name="company-policy-index", - folder_path="Shared", + folder_path="WellsFargoCodedAgents", number_of_results=100, ) try: @@ -180,7 +179,7 @@ async def procurement_node(state: GraphState) -> GraphOutput: retriever = ContextGroundingRetriever( index_name="procurement-index", - folder_path="Shared", + folder_path="WellsFargoCodedAgents", number_of_results=100, ) try: diff --git a/resources/main5_permission_check_hr.py b/resources/main5_permission_check_hr.py index 0dbbc0a..4fc6a35 100644 --- a/resources/main5_permission_check_hr.py +++ b/resources/main5_permission_check_hr.py @@ -1,4 +1,3 @@ -from langchain_anthropic import ChatAnthropic from langgraph.graph import END, START, StateGraph from pydantic import BaseModel from uipath_langchain.retrievers import ContextGroundingRetriever @@ -118,7 +117,7 @@ def is_valid_code(code: str | None) -> bool: async def policy_node(state: GraphState) -> GraphOutput: retriever = ContextGroundingRetriever( index_name="company-policy-index", - folder_path="Shared", + folder_path="WellsFargoCodedAgents", number_of_results=100, ) try: @@ -180,7 +179,7 @@ async def procurement_node(state: GraphState) -> GraphOutput: retriever = ContextGroundingRetriever( index_name="procurement-index", - folder_path="Shared", + folder_path="WellsFargoCodedAgents", number_of_results=100, ) try: diff --git a/resources/main6_HITL.py b/resources/main6_HITL.py index 1d32a47..6d7882e 100644 --- a/resources/main6_HITL.py +++ b/resources/main6_HITL.py @@ -1,4 +1,3 @@ -# from langchain_anthropic import ChatAnthropic from langgraph.graph import END, START, StateGraph from pydantic import BaseModel, Field from uipath_langchain.retrievers import ContextGroundingRetriever @@ -139,7 +138,7 @@ def is_valid_code(code: str | None) -> bool: async def policy_node(state: GraphState) -> GraphOutput: retriever = ContextGroundingRetriever( index_name="company-policy-index", - folder_path="Shared", + folder_path="WellsFargoCodedAgents", number_of_results=100, ) try: @@ -185,7 +184,7 @@ async def supervisor_node(state: GraphState) -> GraphState: title="Action Required: Review classification", data={ "Content": f"I classified the question '{state.question}' \n as {result['category']} \n Is this ok? My confidence score is only {result['confidence']}"}, - app_folder_path="Shared/ApprovalApp", + app_folder_path="WellsFargoCodedAgents/wf-hitl-app", assignee="eusebiu.jecan@uipath.com" )) if not bool(action_data["Approved"]): @@ -209,7 +208,7 @@ async def procurement_node(state: GraphState) -> GraphOutput: retriever = ContextGroundingRetriever( index_name="procurement-index", - folder_path="Shared", + folder_path="WellsFargoCodedAgents", number_of_results=100, ) try: diff --git a/resources/prerequisites/0010-home-landing-page.png b/resources/prerequisites/0010-home-landing-page.png index a3cb2af..c6f2f3c 100644 Binary files a/resources/prerequisites/0010-home-landing-page.png and b/resources/prerequisites/0010-home-landing-page.png differ diff --git a/resources/prerequisites/0011-orchestrator.png b/resources/prerequisites/0011-orchestrator.png index 2c53589..fb80800 100644 Binary files a/resources/prerequisites/0011-orchestrator.png and b/resources/prerequisites/0011-orchestrator.png differ diff --git a/resources/prerequisites/0060-create-process.png b/resources/prerequisites/0060-create-process.png index ebfa8dc..70df724 100644 Binary files a/resources/prerequisites/0060-create-process.png and b/resources/prerequisites/0060-create-process.png differ diff --git a/resources/prerequisites/0061-create-process.png b/resources/prerequisites/0061-create-process.png index 39a70c0..3efa0aa 100644 Binary files a/resources/prerequisites/0061-create-process.png and b/resources/prerequisites/0061-create-process.png differ diff --git a/resources/prerequisites/0062-create-process.png b/resources/prerequisites/0062-create-process.png index d975aef..f3b4bb0 100644 Binary files a/resources/prerequisites/0062-create-process.png and b/resources/prerequisites/0062-create-process.png differ diff --git a/resources/prerequisites/0063-create-process.png b/resources/prerequisites/0063-create-process.png index 55e849f..017b11d 100644 Binary files a/resources/prerequisites/0063-create-process.png and b/resources/prerequisites/0063-create-process.png differ diff --git a/resources/prerequisites/0070-start-job.png b/resources/prerequisites/0070-start-job.png index 8688ca8..7f70273 100644 Binary files a/resources/prerequisites/0070-start-job.png and b/resources/prerequisites/0070-start-job.png differ diff --git a/resources/prerequisites/0071-start-job.png b/resources/prerequisites/0071-start-job.png index fd337ee..e5c2554 100644 Binary files a/resources/prerequisites/0071-start-job.png and b/resources/prerequisites/0071-start-job.png differ diff --git a/resources/prerequisites/0073-start-job.png b/resources/prerequisites/0073-start-job.png index e0105da..c2ee50d 100644 Binary files a/resources/prerequisites/0073-start-job.png and b/resources/prerequisites/0073-start-job.png differ diff --git a/resources/prerequisites/0074-start-job.png b/resources/prerequisites/0074-start-job.png index dd3715d..763e313 100644 Binary files a/resources/prerequisites/0074-start-job.png and b/resources/prerequisites/0074-start-job.png differ diff --git a/resources/prerequisites/2010-create-subfolder-2.png b/resources/prerequisites/2010-create-subfolder-2.png index 7e066f1..f709a81 100644 Binary files a/resources/prerequisites/2010-create-subfolder-2.png and b/resources/prerequisites/2010-create-subfolder-2.png differ diff --git a/resources/prerequisites/2010-create-subfolder-3.png b/resources/prerequisites/2010-create-subfolder-3.png index 72adf1e..70df724 100644 Binary files a/resources/prerequisites/2010-create-subfolder-3.png and b/resources/prerequisites/2010-create-subfolder-3.png differ diff --git a/resources/prerequisites/2010-create-subfolder.png b/resources/prerequisites/2010-create-subfolder.png index 6501d12..a65d438 100644 Binary files a/resources/prerequisites/2010-create-subfolder.png and b/resources/prerequisites/2010-create-subfolder.png differ diff --git a/resources/prerequisites/3060-select-kernel.png b/resources/prerequisites/3060-select-kernel.png index aff852e..d1dfc47 100644 Binary files a/resources/prerequisites/3060-select-kernel.png and b/resources/prerequisites/3060-select-kernel.png differ diff --git a/resources/prerequisites/3070-select-kernel.png b/resources/prerequisites/3070-select-kernel.png index 003da9a..b0c96d8 100644 Binary files a/resources/prerequisites/3070-select-kernel.png and b/resources/prerequisites/3070-select-kernel.png differ