uipath-langchain 0.0.143__tar.gz → 0.0.145__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/PKG-INFO +2 -2
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/pyproject.toml +2 -2
- uipath_langchain-0.0.145/src/uipath_langchain/_cli/_runtime/_exception.py +43 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/_runtime/_graph_resolver.py +10 -12
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/_runtime/_input.py +2 -2
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/_runtime/_output.py +5 -8
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/_runtime/_runtime.py +31 -6
- uipath_langchain-0.0.145/src/uipath_langchain/_cli/_utils/_schema.py +85 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/cli_eval.py +3 -9
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/cli_init.py +3 -83
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_utils/_request_mixin.py +5 -2
- uipath_langchain-0.0.145/src/uipath_langchain/agent/react/__init__.py +12 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/react/agent.py +76 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/react/constants.py +2 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/react/exceptions.py +11 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/react/init_node.py +16 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/react/llm_node.py +44 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/react/router.py +97 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/react/state.py +18 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/react/terminate_node.py +53 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/react/tools/__init__.py +7 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/react/tools/tools.py +50 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/react/utils.py +39 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/tools/__init__.py +8 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/tools/context_tool.py +42 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/tools/process_tool.py +51 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/tools/tool_factory.py +39 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/tools/tool_node.py +22 -0
- uipath_langchain-0.0.145/src/uipath_langchain/agent/tools/utils.py +11 -0
- uipath_langchain-0.0.145/src/uipath_langchain/runtime_factories.py +21 -0
- uipath_langchain-0.0.145/tests/agent/react/__init__.py +1 -0
- uipath_langchain-0.0.145/tests/agent/react/test_utils.py +135 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/uv.lock +6 -6
- uipath_langchain-0.0.143/src/uipath_langchain/_cli/_runtime/_exception.py +0 -17
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.cursorrules +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.editorconfig +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.gitattributes +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.github/workflows/cd.yml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.github/workflows/ci.yml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.github/workflows/commitlint.yml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.github/workflows/integration_tests.yml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.github/workflows/lint-custom-version.yml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.github/workflows/lint.yml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.github/workflows/publish-dev.yml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.github/workflows/publish-docs.yml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.github/workflows/publish-prior-stable-version.yml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.github/workflows/slack.yml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.github/workflows/test-custom-version.yml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.github/workflows/test.yml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.gitignore +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.pre-commit-config.yaml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.python-version +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.vscode/extensions.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/.vscode/settings.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/CONTRIBUTING.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/LICENSE +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/README.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/chat_models.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/context_grounding.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/human_in_the_loop.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/quick_start.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/quick_start_images/cloud_env_var_dark.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/quick_start_images/cloud_env_var_light.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/quick_start_images/invoke_output_dark.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/quick_start_images/invoke_output_light.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/click-storage-bucket.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/create-index-1.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/create-index-2.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/create-process.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/create-quiz-generator.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/create-storage-bucket-1.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/create-storage-bucket-2.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/folder-path.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/job-info.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/output.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/process-page.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/researcher-1.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/researcher-2.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/run-process-1.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/run-process-2.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/RAG/storage-bucket-content.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/multi-agent-distributed/coder-agent-package-overview.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/multi-agent-distributed/coder-agent-process-configuration.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/multi-agent-distributed/planner-agent-package-overview.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/multi-agent-distributed/planner-agent-process-configuration.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/multi-agent-distributed/researcher-agent-package-overview.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/multi-agent-distributed/researcher-agent-process-configuration.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/ticket-classification/activate-apps.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/ticket-classification/activate-deployment.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/ticket-classification/copy-folder-path.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/ticket-classification/deploy-solution-package-wizard.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/ticket-classification/deploy-solution-package.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/ticket-classification/monitor-agent.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/ticket-classification/navigate-to-solution-folder.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/ticket-classification/resume-condition.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/ticket-classification/run-agent.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/ticket-classification/solution-destination-folder.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/ticket-classification/start-job.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/docs/sample_images/ticket-classification/upload-solution-package.png +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/RAG-quiz-generator/README.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/RAG-quiz-generator/env.example +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/RAG-quiz-generator/input.example/quiz-generator-debug-input.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/RAG-quiz-generator/input.example/researcher-debug-input.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/RAG-quiz-generator/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/RAG-quiz-generator/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/RAG-quiz-generator/quiz-generator-RAG-agent.mermaid +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/RAG-quiz-generator/researcher-RAG-agent.mermaid +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/RAG-quiz-generator/src/agents/quiz-generator-RAG-agent.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/RAG-quiz-generator/src/agents/researcher-RAG-agent.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/RAG-quiz-generator/uipath.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/RAG-quiz-generator/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/README.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/calculator-agent/graph.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/calculator-agent/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/calculator-agent/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/calculator-agent/uipath.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/calculator-agent/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/chat-agent/.env.example +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/chat-agent/agent.mermaid +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/chat-agent/graph.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/chat-agent/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/chat-agent/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/chat-agent/uipath.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/chat-agent/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/company-research-agent/.env.example +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/company-research-agent/agent.mermaid +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/company-research-agent/graph.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/company-research-agent/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/company-research-agent/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/company-research-agent/uipath.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/company-research-agent/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/email-organizer-agent/.env.template +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/email-organizer-agent/.python-version +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/email-organizer-agent/.vscode/launch.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/email-organizer-agent/README.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/email-organizer-agent/agent.mermaid +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/email-organizer-agent/input.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/email-organizer-agent/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/email-organizer-agent/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/email-organizer-agent/src/email_organizer/__init__.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/email-organizer-agent/src/email_organizer/main.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/email-organizer-agent/src/email_organizer/outlook_client.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/email-organizer-agent/uipath.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/email-organizer-agent/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/hitl-inbox-server/database.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/hitl-inbox-server/main.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/hitl-inbox-server/models.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/hitl-inbox-server/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/hitl-inbox-server/schemas.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/hitl-inbox-server/templates/index.html +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/hitl-inbox-server/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-planner-researcher-coder-distributed/.env.example +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-planner-researcher-coder-distributed/README.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-planner-researcher-coder-distributed/coder.mermaid +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-planner-researcher-coder-distributed/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-planner-researcher-coder-distributed/planner.mermaid +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-planner-researcher-coder-distributed/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-planner-researcher-coder-distributed/researcher.mermaid +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-planner-researcher-coder-distributed/src/multi-agent-distributed/coder.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-planner-researcher-coder-distributed/src/multi-agent-distributed/planner.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-planner-researcher-coder-distributed/src/multi-agent-distributed/researcher.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-planner-researcher-coder-distributed/uipath.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-planner-researcher-coder-distributed/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-supervisor-researcher-coder/.env.example +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-supervisor-researcher-coder/README.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-supervisor-researcher-coder/agent.mermaid +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-supervisor-researcher-coder/graph.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-supervisor-researcher-coder/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-supervisor-researcher-coder/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-supervisor-researcher-coder/uipath.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/multi-agent-supervisor-researcher-coder/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/oauth-external-apps-agent/.env.example +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/oauth-external-apps-agent/README.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/oauth-external-apps-agent/input.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/oauth-external-apps-agent/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/oauth-external-apps-agent/main.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/oauth-external-apps-agent/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/oauth-external-apps-agent/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/retrieval-chain/.env.example +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/retrieval-chain/README.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/retrieval-chain/main.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/retrieval-chain/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/retrieval-chain/uipath.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/retrieval-chain/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-local-mcp/.env.example +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-local-mcp/README.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-local-mcp/agent.mermaid +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-local-mcp/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-local-mcp/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-local-mcp/src/simple-local-mcp/graph.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-local-mcp/src/simple-local-mcp/math_server.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-local-mcp/src/simple-local-mcp/weather_server.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-local-mcp/uipath.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-local-mcp/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-remote-mcp/.env.example +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-remote-mcp/README.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-remote-mcp/agent.mermaid +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-remote-mcp/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-remote-mcp/main.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-remote-mcp/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-remote-mcp/uipath.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/simple-remote-mcp/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/ticket-classification/.env.example +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/ticket-classification/README.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/ticket-classification/agent.mermaid +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/ticket-classification/escalation_app_solution/generic-escalation-app-solution-1.0.0.zip +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/ticket-classification/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/ticket-classification/main.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/ticket-classification/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/ticket-classification/uipath.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/samples/ticket-classification/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/__init__.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/__init__.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/_runtime/_context.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/_runtime/_conversation.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/_templates/langgraph.json.template +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/_templates/main.py.template +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/_utils/_graph.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/cli_debug.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/cli_dev.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/cli_new.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/cli_run.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_resources/AGENTS.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_resources/REQUIRED_STRUCTURE.md +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_tracing/__init__.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_tracing/_instrument_traceable.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_tracing/_utils.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_utils/__init__.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_utils/_settings.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_utils/_sleep_policy.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/chat/__init__.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/chat/models.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/embeddings/__init__.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/embeddings/embeddings.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/middlewares.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/py.typed +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/retrievers/__init__.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/retrievers/context_grounding_retriever.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/tools/__init__.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/tools/preconfigured.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/vectorstores/__init__.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/vectorstores/context_grounding_vectorstore.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/common/trace_assert.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/common/validate_output.sh +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/company-research-agent/expected_raw.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/company-research-agent/expected_traces.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/company-research-agent/input.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/company-research-agent/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/company-research-agent/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/company-research-agent/run.sh +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/company-research-agent/src/assert.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/company-research-agent/src/graph.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/company-research-agent/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/init-flow/expected_traces.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/init-flow/input.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/init-flow/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/init-flow/run.sh +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/init-flow/src/assert.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/simple-local-mcp/expected_traces.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/simple-local-mcp/input.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/simple-local-mcp/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/simple-local-mcp/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/simple-local-mcp/run.sh +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/simple-local-mcp/src/assert.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/simple-local-mcp/src/simple-local-mcp/graph.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/simple-local-mcp/src/simple-local-mcp/math_server.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/simple-local-mcp/src/simple-local-mcp/weather_server.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/simple-local-mcp/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/ticket-classification/expected_traces.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/ticket-classification/input.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/ticket-classification/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/ticket-classification/pyproject.toml +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/ticket-classification/raw_traces.jsonl +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/ticket-classification/run.sh +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/ticket-classification/src/assert.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/ticket-classification/src/main.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/testcases/ticket-classification/uv.lock +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/__init__.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/cli/conftest.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/cli/mocks/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/cli/mocks/simple_agent.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/cli/mocks/uipath.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/cli/test_init.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/cli/test_run.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/hitl/__init__.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/hitl/conftest.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/hitl/mocks/action_trigger_hitl.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/hitl/mocks/api_trigger_hitl.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/hitl/mocks/job_trigger_hitl.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/hitl/mocks/langgraph.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/hitl/mocks/uipath-default-escalation.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/hitl/mocks/uipath.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/hitl/test_action_trigger.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/hitl/test_hitl_api_trigger.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/hitl/test_hitl_default_escalation.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/hitl/test_hitl_job_trigger.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/test_dummy.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/tools/__init__.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/tools/conftest.py +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/tools/mocks/agent_definition.json +0 -0
- {uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/tests/tools/test_preconfigured.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: uipath-langchain
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.145
|
|
4
4
|
Summary: UiPath Langchain
|
|
5
5
|
Project-URL: Homepage, https://uipath.com
|
|
6
6
|
Project-URL: Repository, https://github.com/UiPath/uipath-langchain-python
|
|
@@ -26,7 +26,7 @@ Requires-Dist: openai>=1.65.5
|
|
|
26
26
|
Requires-Dist: openinference-instrumentation-langchain>=0.1.50
|
|
27
27
|
Requires-Dist: pydantic-settings>=2.6.0
|
|
28
28
|
Requires-Dist: python-dotenv>=1.0.1
|
|
29
|
-
Requires-Dist: uipath<2.2.0,>=2.1.
|
|
29
|
+
Requires-Dist: uipath<2.2.0,>=2.1.110
|
|
30
30
|
Provides-Extra: langchain
|
|
31
31
|
Description-Content-Type: text/markdown
|
|
32
32
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "uipath-langchain"
|
|
3
|
-
version = "0.0.
|
|
3
|
+
version = "0.0.145"
|
|
4
4
|
description = "UiPath Langchain"
|
|
5
5
|
readme = { file = "README.md", content-type = "text/markdown" }
|
|
6
6
|
requires-python = ">=3.10"
|
|
7
7
|
dependencies = [
|
|
8
|
-
"uipath>=2.1.
|
|
8
|
+
"uipath>=2.1.110, <2.2.0",
|
|
9
9
|
"langgraph>=0.5.0, <0.7.0",
|
|
10
10
|
"langchain-core>=0.3.34",
|
|
11
11
|
"langgraph-checkpoint-sqlite>=2.0.3",
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from enum import Enum
|
|
2
|
+
from typing import Optional, Union
|
|
3
|
+
|
|
4
|
+
from uipath._cli._runtime._contracts import (
|
|
5
|
+
UiPathBaseRuntimeError,
|
|
6
|
+
UiPathErrorCategory,
|
|
7
|
+
UiPathErrorCode,
|
|
8
|
+
)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class LangGraphErrorCode(Enum):
|
|
12
|
+
CONFIG_MISSING = "CONFIG_MISSING"
|
|
13
|
+
CONFIG_INVALID = "CONFIG_INVALID"
|
|
14
|
+
|
|
15
|
+
GRAPH_NOT_FOUND = "GRAPH_NOT_FOUND"
|
|
16
|
+
GRAPH_IMPORT_ERROR = "GRAPH_IMPORT_ERROR"
|
|
17
|
+
GRAPH_TYPE_ERROR = "GRAPH_TYPE_ERROR"
|
|
18
|
+
GRAPH_VALUE_ERROR = "GRAPH_VALUE_ERROR"
|
|
19
|
+
GRAPH_LOAD_ERROR = "GRAPH_LOAD_ERROR"
|
|
20
|
+
GRAPH_INVALID_UPDATE = "GRAPH_INVALID_UPDATE"
|
|
21
|
+
GRAPH_EMPTY_INPUT = "GRAPH_EMPTY_INPUT"
|
|
22
|
+
|
|
23
|
+
DB_QUERY_FAILED = "DB_QUERY_FAILED"
|
|
24
|
+
DB_TABLE_CREATION_FAILED = "DB_TABLE_CREATION_FAILED"
|
|
25
|
+
HITL_EVENT_CREATION_FAILED = "HITL_EVENT_CREATION_FAILED"
|
|
26
|
+
DB_INSERT_FAILED = "DB_INSERT_FAILED"
|
|
27
|
+
LICENSE_NOT_AVAILABLE = "LICENSE_NOT_AVAILABLE"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class LangGraphRuntimeError(UiPathBaseRuntimeError):
|
|
31
|
+
"""Custom exception for LangGraph runtime errors with structured error information."""
|
|
32
|
+
|
|
33
|
+
def __init__(
|
|
34
|
+
self,
|
|
35
|
+
code: Union[LangGraphErrorCode, UiPathErrorCode],
|
|
36
|
+
title: str,
|
|
37
|
+
detail: str,
|
|
38
|
+
category: UiPathErrorCategory = UiPathErrorCategory.UNKNOWN,
|
|
39
|
+
status: Optional[int] = None,
|
|
40
|
+
):
|
|
41
|
+
super().__init__(
|
|
42
|
+
code.value, title, detail, category, status, prefix="LANGGRAPH"
|
|
43
|
+
)
|
|
@@ -2,12 +2,10 @@ import asyncio
|
|
|
2
2
|
from typing import Any, Awaitable, Callable, Optional
|
|
3
3
|
|
|
4
4
|
from langgraph.graph.state import CompiledStateGraph, StateGraph
|
|
5
|
-
from uipath._cli._runtime._contracts import
|
|
6
|
-
UiPathErrorCategory,
|
|
7
|
-
)
|
|
5
|
+
from uipath._cli._runtime._contracts import UiPathErrorCategory, UiPathErrorCode
|
|
8
6
|
|
|
9
7
|
from .._utils._graph import GraphConfig, LangGraphConfig
|
|
10
|
-
from ._exception import LangGraphRuntimeError
|
|
8
|
+
from ._exception import LangGraphErrorCode, LangGraphRuntimeError
|
|
11
9
|
|
|
12
10
|
|
|
13
11
|
class LangGraphJsonResolver:
|
|
@@ -36,7 +34,7 @@ class LangGraphJsonResolver:
|
|
|
36
34
|
config = LangGraphConfig()
|
|
37
35
|
if not config.exists:
|
|
38
36
|
raise LangGraphRuntimeError(
|
|
39
|
-
|
|
37
|
+
LangGraphErrorCode.CONFIG_MISSING,
|
|
40
38
|
"Invalid configuration",
|
|
41
39
|
"Failed to load configuration",
|
|
42
40
|
UiPathErrorCategory.DEPLOYMENT,
|
|
@@ -46,7 +44,7 @@ class LangGraphJsonResolver:
|
|
|
46
44
|
config.load_config()
|
|
47
45
|
except Exception as e:
|
|
48
46
|
raise LangGraphRuntimeError(
|
|
49
|
-
|
|
47
|
+
LangGraphErrorCode.CONFIG_INVALID,
|
|
50
48
|
"Invalid configuration",
|
|
51
49
|
f"Failed to load configuration: {str(e)}",
|
|
52
50
|
UiPathErrorCategory.DEPLOYMENT,
|
|
@@ -59,7 +57,7 @@ class LangGraphJsonResolver:
|
|
|
59
57
|
elif not entrypoint:
|
|
60
58
|
graph_names = ", ".join(g.name for g in graphs)
|
|
61
59
|
raise LangGraphRuntimeError(
|
|
62
|
-
|
|
60
|
+
UiPathErrorCode.ENTRYPOINT_MISSING,
|
|
63
61
|
"Entrypoint required",
|
|
64
62
|
f"Multiple graphs available. Please specify one of: {graph_names}.",
|
|
65
63
|
UiPathErrorCategory.DEPLOYMENT,
|
|
@@ -69,7 +67,7 @@ class LangGraphJsonResolver:
|
|
|
69
67
|
self.graph_config = config.get_graph(entrypoint)
|
|
70
68
|
if not self.graph_config:
|
|
71
69
|
raise LangGraphRuntimeError(
|
|
72
|
-
|
|
70
|
+
LangGraphErrorCode.GRAPH_NOT_FOUND,
|
|
73
71
|
"Graph not found",
|
|
74
72
|
f"Graph '{entrypoint}' not found.",
|
|
75
73
|
UiPathErrorCategory.DEPLOYMENT,
|
|
@@ -83,28 +81,28 @@ class LangGraphJsonResolver:
|
|
|
83
81
|
)
|
|
84
82
|
except ImportError as e:
|
|
85
83
|
raise LangGraphRuntimeError(
|
|
86
|
-
|
|
84
|
+
LangGraphErrorCode.GRAPH_IMPORT_ERROR,
|
|
87
85
|
"Graph import failed",
|
|
88
86
|
f"Failed to import graph '{entrypoint}': {str(e)}",
|
|
89
87
|
UiPathErrorCategory.USER,
|
|
90
88
|
) from e
|
|
91
89
|
except TypeError as e:
|
|
92
90
|
raise LangGraphRuntimeError(
|
|
93
|
-
|
|
91
|
+
LangGraphErrorCode.GRAPH_TYPE_ERROR,
|
|
94
92
|
"Invalid graph type",
|
|
95
93
|
f"Graph '{entrypoint}' is not a valid StateGraph or CompiledStateGraph: {str(e)}",
|
|
96
94
|
UiPathErrorCategory.USER,
|
|
97
95
|
) from e
|
|
98
96
|
except ValueError as e:
|
|
99
97
|
raise LangGraphRuntimeError(
|
|
100
|
-
|
|
98
|
+
LangGraphErrorCode.GRAPH_VALUE_ERROR,
|
|
101
99
|
"Invalid graph value",
|
|
102
100
|
f"Invalid value in graph '{entrypoint}': {str(e)}",
|
|
103
101
|
UiPathErrorCategory.USER,
|
|
104
102
|
) from e
|
|
105
103
|
except Exception as e:
|
|
106
104
|
raise LangGraphRuntimeError(
|
|
107
|
-
|
|
105
|
+
LangGraphErrorCode.GRAPH_LOAD_ERROR,
|
|
108
106
|
"Failed to load graph",
|
|
109
107
|
f"Unexpected error loading graph '{entrypoint}': {str(e)}",
|
|
110
108
|
UiPathErrorCategory.USER,
|
{uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/_runtime/_input.py
RENAMED
|
@@ -13,7 +13,7 @@ from uipath._cli._runtime._hitl import HitlReader
|
|
|
13
13
|
|
|
14
14
|
from ._context import LangGraphRuntimeContext
|
|
15
15
|
from ._conversation import uipath_to_human_messages
|
|
16
|
-
from ._exception import LangGraphRuntimeError
|
|
16
|
+
from ._exception import LangGraphErrorCode, LangGraphRuntimeError
|
|
17
17
|
|
|
18
18
|
logger = logging.getLogger(__name__)
|
|
19
19
|
|
|
@@ -140,7 +140,7 @@ async def _get_latest_trigger(
|
|
|
140
140
|
return cast(tuple[str, str, str, str, str], tuple(result))
|
|
141
141
|
except Exception as e:
|
|
142
142
|
raise LangGraphRuntimeError(
|
|
143
|
-
|
|
143
|
+
LangGraphErrorCode.DB_QUERY_FAILED,
|
|
144
144
|
"Database query failed",
|
|
145
145
|
f"Error querying resume trigger information: {str(e)}",
|
|
146
146
|
UiPathErrorCategory.SYSTEM,
|
{uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/_runtime/_output.py
RENAMED
|
@@ -3,13 +3,10 @@ import logging
|
|
|
3
3
|
from typing import Any
|
|
4
4
|
|
|
5
5
|
from langgraph.checkpoint.sqlite.aio import AsyncSqliteSaver
|
|
6
|
-
from uipath._cli._runtime._contracts import
|
|
7
|
-
UiPathErrorCategory,
|
|
8
|
-
UiPathResumeTrigger,
|
|
9
|
-
)
|
|
6
|
+
from uipath._cli._runtime._contracts import UiPathErrorCategory, UiPathResumeTrigger
|
|
10
7
|
from uipath._cli._runtime._hitl import HitlProcessor
|
|
11
8
|
|
|
12
|
-
from ._exception import LangGraphRuntimeError
|
|
9
|
+
from ._exception import LangGraphErrorCode, LangGraphRuntimeError
|
|
13
10
|
|
|
14
11
|
logger = logging.getLogger(__name__)
|
|
15
12
|
|
|
@@ -93,7 +90,7 @@ async def create_and_save_resume_trigger(
|
|
|
93
90
|
""")
|
|
94
91
|
except Exception as e:
|
|
95
92
|
raise LangGraphRuntimeError(
|
|
96
|
-
|
|
93
|
+
LangGraphErrorCode.DB_TABLE_CREATION_FAILED,
|
|
97
94
|
"Failed to create resume triggers table",
|
|
98
95
|
f"Database error while creating table: {str(e)}",
|
|
99
96
|
UiPathErrorCategory.SYSTEM,
|
|
@@ -104,7 +101,7 @@ async def create_and_save_resume_trigger(
|
|
|
104
101
|
resume_trigger = await hitl_processor.create_resume_trigger()
|
|
105
102
|
except Exception as e:
|
|
106
103
|
raise LangGraphRuntimeError(
|
|
107
|
-
|
|
104
|
+
LangGraphErrorCode.HITL_EVENT_CREATION_FAILED,
|
|
108
105
|
"Failed to process HITL request",
|
|
109
106
|
f"Error while trying to process HITL request: {str(e)}",
|
|
110
107
|
UiPathErrorCategory.SYSTEM,
|
|
@@ -139,7 +136,7 @@ async def create_and_save_resume_trigger(
|
|
|
139
136
|
await memory.conn.commit()
|
|
140
137
|
except Exception as e:
|
|
141
138
|
raise LangGraphRuntimeError(
|
|
142
|
-
|
|
139
|
+
LangGraphErrorCode.DB_INSERT_FAILED,
|
|
143
140
|
"Failed to save resume trigger",
|
|
144
141
|
f"Database error while saving resume trigger: {str(e)}",
|
|
145
142
|
UiPathErrorCategory.SYSTEM,
|
{uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_cli/_runtime/_runtime.py
RENAMED
|
@@ -2,28 +2,33 @@ import logging
|
|
|
2
2
|
import os
|
|
3
3
|
from contextlib import asynccontextmanager
|
|
4
4
|
from typing import Any, AsyncGenerator, AsyncIterator, Optional, Sequence
|
|
5
|
+
from uuid import uuid4
|
|
5
6
|
|
|
6
7
|
from langchain_core.runnables.config import RunnableConfig
|
|
7
8
|
from langgraph.checkpoint.sqlite.aio import AsyncSqliteSaver
|
|
8
9
|
from langgraph.errors import EmptyInputError, GraphRecursionError, InvalidUpdateError
|
|
9
10
|
from langgraph.graph.state import CompiledStateGraph, StateGraph
|
|
10
11
|
from langgraph.types import Interrupt, StateSnapshot
|
|
12
|
+
from typing_extensions import override
|
|
11
13
|
from uipath._cli._runtime._contracts import (
|
|
12
14
|
UiPathBaseRuntime,
|
|
13
15
|
UiPathBreakpointResult,
|
|
14
16
|
UiPathErrorCategory,
|
|
17
|
+
UiPathErrorCode,
|
|
15
18
|
UiPathResumeTrigger,
|
|
16
19
|
UiPathRuntimeResult,
|
|
17
20
|
UiPathRuntimeStatus,
|
|
18
21
|
)
|
|
22
|
+
from uipath._cli.models.runtime_schema import Entrypoint
|
|
19
23
|
from uipath._events._events import (
|
|
20
24
|
UiPathAgentMessageEvent,
|
|
21
25
|
UiPathAgentStateEvent,
|
|
22
26
|
UiPathRuntimeEvent,
|
|
23
27
|
)
|
|
24
28
|
|
|
29
|
+
from .._utils._schema import generate_schema_from_graph
|
|
25
30
|
from ._context import LangGraphRuntimeContext
|
|
26
|
-
from ._exception import LangGraphRuntimeError
|
|
31
|
+
from ._exception import LangGraphErrorCode, LangGraphRuntimeError
|
|
27
32
|
from ._graph_resolver import AsyncResolver, LangGraphJsonResolver
|
|
28
33
|
from ._input import get_graph_input
|
|
29
34
|
from ._output import create_and_save_resume_trigger, serialize_output
|
|
@@ -79,7 +84,11 @@ class LangGraphRuntime(UiPathBaseRuntime):
|
|
|
79
84
|
graph_config = self._get_graph_config()
|
|
80
85
|
|
|
81
86
|
# Execute without streaming
|
|
82
|
-
graph_output = await compiled_graph.ainvoke(
|
|
87
|
+
graph_output = await compiled_graph.ainvoke(
|
|
88
|
+
graph_input,
|
|
89
|
+
graph_config,
|
|
90
|
+
interrupt_before=self.context.breakpoints,
|
|
91
|
+
)
|
|
83
92
|
|
|
84
93
|
# Get final state and create result
|
|
85
94
|
self.context.result = await self._create_runtime_result(
|
|
@@ -140,6 +149,7 @@ class LangGraphRuntime(UiPathBaseRuntime):
|
|
|
140
149
|
async for stream_chunk in compiled_graph.astream(
|
|
141
150
|
graph_input,
|
|
142
151
|
graph_config,
|
|
152
|
+
interrupt_before=self.context.breakpoints,
|
|
143
153
|
stream_mode=["messages", "updates"],
|
|
144
154
|
subgraphs=True,
|
|
145
155
|
):
|
|
@@ -426,7 +436,7 @@ class LangGraphRuntime(UiPathBaseRuntime):
|
|
|
426
436
|
|
|
427
437
|
if isinstance(e, GraphRecursionError):
|
|
428
438
|
return LangGraphRuntimeError(
|
|
429
|
-
|
|
439
|
+
LangGraphErrorCode.GRAPH_LOAD_ERROR,
|
|
430
440
|
"Graph recursion limit exceeded",
|
|
431
441
|
detail,
|
|
432
442
|
UiPathErrorCategory.USER,
|
|
@@ -434,7 +444,7 @@ class LangGraphRuntime(UiPathBaseRuntime):
|
|
|
434
444
|
|
|
435
445
|
if isinstance(e, InvalidUpdateError):
|
|
436
446
|
return LangGraphRuntimeError(
|
|
437
|
-
|
|
447
|
+
LangGraphErrorCode.GRAPH_INVALID_UPDATE,
|
|
438
448
|
str(e),
|
|
439
449
|
detail,
|
|
440
450
|
UiPathErrorCategory.USER,
|
|
@@ -442,14 +452,14 @@ class LangGraphRuntime(UiPathBaseRuntime):
|
|
|
442
452
|
|
|
443
453
|
if isinstance(e, EmptyInputError):
|
|
444
454
|
return LangGraphRuntimeError(
|
|
445
|
-
|
|
455
|
+
LangGraphErrorCode.GRAPH_EMPTY_INPUT,
|
|
446
456
|
"The input data is empty",
|
|
447
457
|
detail,
|
|
448
458
|
UiPathErrorCategory.USER,
|
|
449
459
|
)
|
|
450
460
|
|
|
451
461
|
return LangGraphRuntimeError(
|
|
452
|
-
|
|
462
|
+
UiPathErrorCode.EXECUTION_ERROR,
|
|
453
463
|
"Graph execution failed",
|
|
454
464
|
detail,
|
|
455
465
|
UiPathErrorCategory.USER,
|
|
@@ -475,6 +485,21 @@ class LangGraphScriptRuntime(LangGraphRuntime):
|
|
|
475
485
|
self.resolver = LangGraphJsonResolver(entrypoint=entrypoint)
|
|
476
486
|
super().__init__(context, self.resolver)
|
|
477
487
|
|
|
488
|
+
@override
|
|
489
|
+
async def get_entrypoint(self) -> Entrypoint:
|
|
490
|
+
"""Get entrypoint for this LangGraph runtime."""
|
|
491
|
+
graph = await self.resolver()
|
|
492
|
+
compiled_graph = graph.compile()
|
|
493
|
+
schema = generate_schema_from_graph(compiled_graph)
|
|
494
|
+
|
|
495
|
+
return Entrypoint(
|
|
496
|
+
file_path=self.context.entrypoint, # type: ignore[call-arg]
|
|
497
|
+
unique_id=str(uuid4()),
|
|
498
|
+
type="agent",
|
|
499
|
+
input=schema["input"],
|
|
500
|
+
output=schema["output"],
|
|
501
|
+
)
|
|
502
|
+
|
|
478
503
|
async def cleanup(self) -> None:
|
|
479
504
|
"""Cleanup runtime resources including resolver."""
|
|
480
505
|
await super().cleanup()
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
from typing import Any, Dict
|
|
2
|
+
|
|
3
|
+
from langgraph.graph.state import CompiledStateGraph
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def resolve_refs(schema, root=None):
|
|
7
|
+
"""Recursively resolves $ref references in a JSON schema."""
|
|
8
|
+
if root is None:
|
|
9
|
+
root = schema # Store the root schema to resolve $refs
|
|
10
|
+
|
|
11
|
+
if isinstance(schema, dict):
|
|
12
|
+
if "$ref" in schema:
|
|
13
|
+
ref_path = schema["$ref"].lstrip("#/").split("/")
|
|
14
|
+
ref_schema = root
|
|
15
|
+
for part in ref_path:
|
|
16
|
+
ref_schema = ref_schema.get(part, {})
|
|
17
|
+
return resolve_refs(ref_schema, root)
|
|
18
|
+
|
|
19
|
+
return {k: resolve_refs(v, root) for k, v in schema.items()}
|
|
20
|
+
|
|
21
|
+
elif isinstance(schema, list):
|
|
22
|
+
return [resolve_refs(item, root) for item in schema]
|
|
23
|
+
|
|
24
|
+
return schema
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def process_nullable_types(
|
|
28
|
+
schema: Dict[str, Any] | list[Any] | Any,
|
|
29
|
+
) -> Dict[str, Any] | list[Any]:
|
|
30
|
+
"""Process the schema to handle nullable types by removing anyOf with null and keeping the base type."""
|
|
31
|
+
if isinstance(schema, dict):
|
|
32
|
+
if "anyOf" in schema and len(schema["anyOf"]) == 2:
|
|
33
|
+
types = [t.get("type") for t in schema["anyOf"]]
|
|
34
|
+
if "null" in types:
|
|
35
|
+
non_null_type = next(
|
|
36
|
+
t for t in schema["anyOf"] if t.get("type") != "null"
|
|
37
|
+
)
|
|
38
|
+
return non_null_type
|
|
39
|
+
|
|
40
|
+
return {k: process_nullable_types(v) for k, v in schema.items()}
|
|
41
|
+
elif isinstance(schema, list):
|
|
42
|
+
return [process_nullable_types(item) for item in schema]
|
|
43
|
+
return schema
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
def generate_schema_from_graph(
|
|
47
|
+
graph: CompiledStateGraph[Any, Any, Any],
|
|
48
|
+
) -> Dict[str, Any]:
|
|
49
|
+
"""Extract input/output schema from a LangGraph graph"""
|
|
50
|
+
schema = {
|
|
51
|
+
"input": {"type": "object", "properties": {}, "required": []},
|
|
52
|
+
"output": {"type": "object", "properties": {}, "required": []},
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if hasattr(graph, "input_schema"):
|
|
56
|
+
if hasattr(graph.input_schema, "model_json_schema"):
|
|
57
|
+
input_schema = graph.input_schema.model_json_schema()
|
|
58
|
+
unpacked_ref_def_properties = resolve_refs(input_schema)
|
|
59
|
+
|
|
60
|
+
# Process the schema to handle nullable types
|
|
61
|
+
processed_properties = process_nullable_types(
|
|
62
|
+
unpacked_ref_def_properties.get("properties", {})
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
schema["input"]["properties"] = processed_properties
|
|
66
|
+
schema["input"]["required"] = unpacked_ref_def_properties.get(
|
|
67
|
+
"required", []
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
if hasattr(graph, "output_schema"):
|
|
71
|
+
if hasattr(graph.output_schema, "model_json_schema"):
|
|
72
|
+
output_schema = graph.output_schema.model_json_schema()
|
|
73
|
+
unpacked_ref_def_properties = resolve_refs(output_schema)
|
|
74
|
+
|
|
75
|
+
# Process the schema to handle nullable types
|
|
76
|
+
processed_properties = process_nullable_types(
|
|
77
|
+
unpacked_ref_def_properties.get("properties", {})
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
schema["output"]["properties"] = processed_properties
|
|
81
|
+
schema["output"]["required"] = unpacked_ref_def_properties.get(
|
|
82
|
+
"required", []
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
return schema
|
|
@@ -6,8 +6,9 @@ from openinference.instrumentation.langchain import (
|
|
|
6
6
|
get_current_span,
|
|
7
7
|
)
|
|
8
8
|
from uipath._cli._evals._console_progress_reporter import ConsoleProgressReporter
|
|
9
|
+
from uipath._cli._evals._evaluate import evaluate
|
|
9
10
|
from uipath._cli._evals._progress_reporter import StudioWebProgressReporter
|
|
10
|
-
from uipath._cli._evals._runtime import UiPathEvalContext
|
|
11
|
+
from uipath._cli._evals._runtime import UiPathEvalContext
|
|
11
12
|
from uipath._cli._runtime._contracts import (
|
|
12
13
|
UiPathRuntimeFactory,
|
|
13
14
|
)
|
|
@@ -82,14 +83,7 @@ def langgraph_eval_middleware(
|
|
|
82
83
|
|
|
83
84
|
runtime_factory.add_instrumentor(LangChainInstrumentor, get_current_span)
|
|
84
85
|
|
|
85
|
-
|
|
86
|
-
async with UiPathEvalRuntime.from_eval_context(
|
|
87
|
-
factory=runtime_factory, context=eval_context, event_bus=event_bus
|
|
88
|
-
) as eval_runtime:
|
|
89
|
-
await eval_runtime.execute()
|
|
90
|
-
await event_bus.wait_for_all()
|
|
91
|
-
|
|
92
|
-
asyncio.run(execute())
|
|
86
|
+
asyncio.run(evaluate(runtime_factory, eval_context, event_bus))
|
|
93
87
|
return MiddlewareResult(should_continue=False)
|
|
94
88
|
|
|
95
89
|
except Exception as e:
|
|
@@ -6,7 +6,7 @@ import shutil
|
|
|
6
6
|
import uuid
|
|
7
7
|
from collections.abc import Generator
|
|
8
8
|
from enum import Enum
|
|
9
|
-
from typing import Any, Callable,
|
|
9
|
+
from typing import Any, Callable, overload
|
|
10
10
|
|
|
11
11
|
import click
|
|
12
12
|
from langgraph.graph.state import CompiledStateGraph
|
|
@@ -14,6 +14,8 @@ from uipath._cli._utils._console import ConsoleLogger
|
|
|
14
14
|
from uipath._cli._utils._parse_ast import generate_bindings_json # type: ignore
|
|
15
15
|
from uipath._cli.middlewares import MiddlewareResult
|
|
16
16
|
|
|
17
|
+
from uipath_langchain._cli._utils._schema import generate_schema_from_graph
|
|
18
|
+
|
|
17
19
|
from ._utils._graph import LangGraphConfig
|
|
18
20
|
|
|
19
21
|
console = ConsoleLogger()
|
|
@@ -27,88 +29,6 @@ class FileOperationStatus(str, Enum):
|
|
|
27
29
|
SKIPPED = "skipped"
|
|
28
30
|
|
|
29
31
|
|
|
30
|
-
def resolve_refs(schema, root=None):
|
|
31
|
-
"""Recursively resolves $ref references in a JSON schema."""
|
|
32
|
-
if root is None:
|
|
33
|
-
root = schema # Store the root schema to resolve $refs
|
|
34
|
-
|
|
35
|
-
if isinstance(schema, dict):
|
|
36
|
-
if "$ref" in schema:
|
|
37
|
-
ref_path = schema["$ref"].lstrip("#/").split("/")
|
|
38
|
-
ref_schema = root
|
|
39
|
-
for part in ref_path:
|
|
40
|
-
ref_schema = ref_schema.get(part, {})
|
|
41
|
-
return resolve_refs(ref_schema, root)
|
|
42
|
-
|
|
43
|
-
return {k: resolve_refs(v, root) for k, v in schema.items()}
|
|
44
|
-
|
|
45
|
-
elif isinstance(schema, list):
|
|
46
|
-
return [resolve_refs(item, root) for item in schema]
|
|
47
|
-
|
|
48
|
-
return schema
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def process_nullable_types(
|
|
52
|
-
schema: Dict[str, Any] | list[Any] | Any,
|
|
53
|
-
) -> Dict[str, Any] | list[Any]:
|
|
54
|
-
"""Process the schema to handle nullable types by removing anyOf with null and keeping the base type."""
|
|
55
|
-
if isinstance(schema, dict):
|
|
56
|
-
if "anyOf" in schema and len(schema["anyOf"]) == 2:
|
|
57
|
-
types = [t.get("type") for t in schema["anyOf"]]
|
|
58
|
-
if "null" in types:
|
|
59
|
-
non_null_type = next(
|
|
60
|
-
t for t in schema["anyOf"] if t.get("type") != "null"
|
|
61
|
-
)
|
|
62
|
-
return non_null_type
|
|
63
|
-
|
|
64
|
-
return {k: process_nullable_types(v) for k, v in schema.items()}
|
|
65
|
-
elif isinstance(schema, list):
|
|
66
|
-
return [process_nullable_types(item) for item in schema]
|
|
67
|
-
return schema
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
def generate_schema_from_graph(
|
|
71
|
-
graph: CompiledStateGraph[Any, Any, Any],
|
|
72
|
-
) -> Dict[str, Any]:
|
|
73
|
-
"""Extract input/output schema from a LangGraph graph"""
|
|
74
|
-
schema = {
|
|
75
|
-
"input": {"type": "object", "properties": {}, "required": []},
|
|
76
|
-
"output": {"type": "object", "properties": {}, "required": []},
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if hasattr(graph, "input_schema"):
|
|
80
|
-
if hasattr(graph.input_schema, "model_json_schema"):
|
|
81
|
-
input_schema = graph.input_schema.model_json_schema()
|
|
82
|
-
unpacked_ref_def_properties = resolve_refs(input_schema)
|
|
83
|
-
|
|
84
|
-
# Process the schema to handle nullable types
|
|
85
|
-
processed_properties = process_nullable_types(
|
|
86
|
-
unpacked_ref_def_properties.get("properties", {})
|
|
87
|
-
)
|
|
88
|
-
|
|
89
|
-
schema["input"]["properties"] = processed_properties
|
|
90
|
-
schema["input"]["required"] = unpacked_ref_def_properties.get(
|
|
91
|
-
"required", []
|
|
92
|
-
)
|
|
93
|
-
|
|
94
|
-
if hasattr(graph, "output_schema"):
|
|
95
|
-
if hasattr(graph.output_schema, "model_json_schema"):
|
|
96
|
-
output_schema = graph.output_schema.model_json_schema()
|
|
97
|
-
unpacked_ref_def_properties = resolve_refs(output_schema)
|
|
98
|
-
|
|
99
|
-
# Process the schema to handle nullable types
|
|
100
|
-
processed_properties = process_nullable_types(
|
|
101
|
-
unpacked_ref_def_properties.get("properties", {})
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
schema["output"]["properties"] = processed_properties
|
|
105
|
-
schema["output"]["required"] = unpacked_ref_def_properties.get(
|
|
106
|
-
"required", []
|
|
107
|
-
)
|
|
108
|
-
|
|
109
|
-
return schema
|
|
110
|
-
|
|
111
|
-
|
|
112
32
|
def generate_agent_md_file(
|
|
113
33
|
target_directory: str,
|
|
114
34
|
file_name: str,
|
{uipath_langchain-0.0.143 → uipath_langchain-0.0.145}/src/uipath_langchain/_utils/_request_mixin.py
RENAMED
|
@@ -20,7 +20,10 @@ from tenacity import (
|
|
|
20
20
|
from uipath._cli._runtime._contracts import UiPathErrorCategory, UiPathRuntimeError
|
|
21
21
|
from uipath._utils._ssl_context import get_httpx_client_kwargs
|
|
22
22
|
|
|
23
|
-
from uipath_langchain._cli._runtime._exception import
|
|
23
|
+
from uipath_langchain._cli._runtime._exception import (
|
|
24
|
+
LangGraphErrorCode,
|
|
25
|
+
LangGraphRuntimeError,
|
|
26
|
+
)
|
|
24
27
|
from uipath_langchain._utils._settings import (
|
|
25
28
|
UiPathClientFactorySettings,
|
|
26
29
|
UiPathClientSettings,
|
|
@@ -371,7 +374,7 @@ class UiPathRequestMixin(BaseModel):
|
|
|
371
374
|
title = body.get("title", "").lower()
|
|
372
375
|
if title == "license not available":
|
|
373
376
|
raise LangGraphRuntimeError(
|
|
374
|
-
code=
|
|
377
|
+
code=LangGraphErrorCode.LICENSE_NOT_AVAILABLE,
|
|
375
378
|
title=body.get("title", "License Not Available"),
|
|
376
379
|
detail=body.get(
|
|
377
380
|
"detail", "License not available for this service"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""UiPath ReAct Agent implementation"""
|
|
2
|
+
|
|
3
|
+
from .agent import create_agent
|
|
4
|
+
from .state import AgentGraphNode, AgentGraphState
|
|
5
|
+
from .utils import resolve_output_model
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"create_agent",
|
|
9
|
+
"AgentGraphState",
|
|
10
|
+
"AgentGraphNode",
|
|
11
|
+
"resolve_output_model",
|
|
12
|
+
]
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from typing import Sequence, Type
|
|
3
|
+
|
|
4
|
+
from langchain_core.language_models import BaseChatModel
|
|
5
|
+
from langchain_core.messages import HumanMessage, SystemMessage
|
|
6
|
+
from langchain_core.tools import BaseTool
|
|
7
|
+
from langgraph.constants import END, START
|
|
8
|
+
from langgraph.graph import StateGraph
|
|
9
|
+
from pydantic import BaseModel
|
|
10
|
+
|
|
11
|
+
from ..tools import create_tool_node
|
|
12
|
+
from .init_node import (
|
|
13
|
+
create_init_node,
|
|
14
|
+
)
|
|
15
|
+
from .llm_node import (
|
|
16
|
+
create_llm_node,
|
|
17
|
+
)
|
|
18
|
+
from .router import (
|
|
19
|
+
route_agent,
|
|
20
|
+
)
|
|
21
|
+
from .state import AgentGraphNode, AgentGraphState
|
|
22
|
+
from .terminate_node import (
|
|
23
|
+
create_terminate_node,
|
|
24
|
+
)
|
|
25
|
+
from .tools import create_flow_control_tools
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def create_agent(
|
|
29
|
+
model: BaseChatModel,
|
|
30
|
+
tools: Sequence[BaseTool],
|
|
31
|
+
messages: Sequence[SystemMessage | HumanMessage],
|
|
32
|
+
*,
|
|
33
|
+
state_schema: Type[AgentGraphState] = AgentGraphState,
|
|
34
|
+
response_format: type[BaseModel] | None = None,
|
|
35
|
+
recursion_limit: int = 50,
|
|
36
|
+
) -> StateGraph[AgentGraphState]:
|
|
37
|
+
"""Build agent graph with INIT -> AGENT <-> TOOLS loop, terminated by control flow tools.
|
|
38
|
+
|
|
39
|
+
Control flow tools (end_execution, raise_error) are auto-injected alongside regular tools.
|
|
40
|
+
"""
|
|
41
|
+
os.environ["LANGCHAIN_RECURSION_LIMIT"] = str(recursion_limit)
|
|
42
|
+
|
|
43
|
+
agent_tools = list(tools)
|
|
44
|
+
flow_control_tools: list[BaseTool] = create_flow_control_tools(response_format)
|
|
45
|
+
llm_tools: list[BaseTool] = [*agent_tools, *flow_control_tools]
|
|
46
|
+
|
|
47
|
+
init_node = create_init_node(messages)
|
|
48
|
+
agent_node = create_llm_node(model, llm_tools)
|
|
49
|
+
tool_nodes = create_tool_node(agent_tools)
|
|
50
|
+
terminate_node = create_terminate_node(response_format)
|
|
51
|
+
|
|
52
|
+
builder: StateGraph[AgentGraphState] = StateGraph(state_schema)
|
|
53
|
+
builder.add_node(AgentGraphNode.INIT, init_node)
|
|
54
|
+
builder.add_node(AgentGraphNode.AGENT, agent_node)
|
|
55
|
+
|
|
56
|
+
for tool_name, tool_node in tool_nodes.items():
|
|
57
|
+
builder.add_node(tool_name, tool_node)
|
|
58
|
+
|
|
59
|
+
builder.add_node(AgentGraphNode.TERMINATE, terminate_node)
|
|
60
|
+
|
|
61
|
+
builder.add_edge(START, AgentGraphNode.INIT)
|
|
62
|
+
builder.add_edge(AgentGraphNode.INIT, AgentGraphNode.AGENT)
|
|
63
|
+
|
|
64
|
+
tool_node_names = list(tool_nodes.keys())
|
|
65
|
+
builder.add_conditional_edges(
|
|
66
|
+
AgentGraphNode.AGENT,
|
|
67
|
+
route_agent,
|
|
68
|
+
[AgentGraphNode.AGENT, *tool_node_names, AgentGraphNode.TERMINATE],
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
for tool_name in tool_node_names:
|
|
72
|
+
builder.add_edge(tool_name, AgentGraphNode.AGENT)
|
|
73
|
+
|
|
74
|
+
builder.add_edge(AgentGraphNode.TERMINATE, END)
|
|
75
|
+
|
|
76
|
+
return builder
|