uipath-langchain 0.0.94__tar.gz → 0.0.96__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.

Potentially problematic release.


This version of uipath-langchain might be problematic. Click here for more details.

Files changed (151) hide show
  1. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/PKG-INFO +2 -2
  2. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/pyproject.toml +2 -2
  3. uipath_langchain-0.0.96/src/uipath_langchain/_cli/_templates/langgraph.json.template +7 -0
  4. uipath_langchain-0.0.96/src/uipath_langchain/_cli/_templates/main.py.template +33 -0
  5. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_cli/cli_init.py +14 -21
  6. uipath_langchain-0.0.96/src/uipath_langchain/_cli/cli_new.py +71 -0
  7. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/middlewares.py +2 -0
  8. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/uv.lock +1425 -1425
  9. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.cursorrules +0 -0
  10. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.editorconfig +0 -0
  11. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.gitattributes +0 -0
  12. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.github/workflows/build.yml +0 -0
  13. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.github/workflows/cd.yml +0 -0
  14. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.github/workflows/ci.yml +0 -0
  15. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.github/workflows/commitlint.yml +0 -0
  16. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.github/workflows/lint.yml +0 -0
  17. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.github/workflows/test.yml +0 -0
  18. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.gitignore +0 -0
  19. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.pre-commit-config.yaml +0 -0
  20. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.python-version +0 -0
  21. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.vscode/extensions.json +0 -0
  22. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/.vscode/settings.json +0 -0
  23. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/CONTRIBUTING.md +0 -0
  24. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/LICENSE +0 -0
  25. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/README.md +0 -0
  26. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/chat_models.md +0 -0
  27. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/context_grounding_retriever.md +0 -0
  28. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/context_grounding_vector_store.md +0 -0
  29. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/interrupt_models.md +0 -0
  30. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/multi-agent-distributed/coder-agent-package-overview.png +0 -0
  31. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/multi-agent-distributed/coder-agent-process-configuration.png +0 -0
  32. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/multi-agent-distributed/planner-agent-package-overview.png +0 -0
  33. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/multi-agent-distributed/planner-agent-process-configuration.png +0 -0
  34. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/multi-agent-distributed/researcher-agent-package-overview.png +0 -0
  35. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/multi-agent-distributed/researcher-agent-process-configuration.png +0 -0
  36. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/ticket-classification/activate-apps.png +0 -0
  37. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/ticket-classification/activate-deployment.png +0 -0
  38. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/ticket-classification/copy-folder-path.png +0 -0
  39. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/ticket-classification/deploy-solution-package-wizard.png +0 -0
  40. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/ticket-classification/deploy-solution-package.png +0 -0
  41. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/ticket-classification/monitor-agent.png +0 -0
  42. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/ticket-classification/navigate-to-solution-folder.png +0 -0
  43. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/ticket-classification/resume-condition.png +0 -0
  44. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/ticket-classification/run-agent.png +0 -0
  45. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/ticket-classification/solution-destination-folder.png +0 -0
  46. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/ticket-classification/start-job.png +0 -0
  47. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/docs/sample_images/ticket-classification/upload-solution-package.png +0 -0
  48. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/company-research-agent/.env.example +0 -0
  49. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/company-research-agent/agent.mermaid +0 -0
  50. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/company-research-agent/graph.py +0 -0
  51. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/company-research-agent/langgraph.json +0 -0
  52. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/company-research-agent/pyproject.toml +0 -0
  53. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/company-research-agent/uipath.json +0 -0
  54. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/company-research-agent/uv.lock +0 -0
  55. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/hitl-inbox-server/database.py +0 -0
  56. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/hitl-inbox-server/main.py +0 -0
  57. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/hitl-inbox-server/models.py +0 -0
  58. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/hitl-inbox-server/pyproject.toml +0 -0
  59. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/hitl-inbox-server/schemas.py +0 -0
  60. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/hitl-inbox-server/templates/index.html +0 -0
  61. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/hitl-inbox-server/uv.lock +0 -0
  62. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-planner-researcher-coder-distributed/.env.example +0 -0
  63. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-planner-researcher-coder-distributed/README.md +0 -0
  64. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-planner-researcher-coder-distributed/coder.mermaid +0 -0
  65. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-planner-researcher-coder-distributed/langgraph.json +0 -0
  66. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-planner-researcher-coder-distributed/planner.mermaid +0 -0
  67. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-planner-researcher-coder-distributed/pyproject.toml +0 -0
  68. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-planner-researcher-coder-distributed/researcher.mermaid +0 -0
  69. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-planner-researcher-coder-distributed/src/multi-agent-distributed/coder.py +0 -0
  70. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-planner-researcher-coder-distributed/src/multi-agent-distributed/planner.py +0 -0
  71. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-planner-researcher-coder-distributed/src/multi-agent-distributed/researcher.py +0 -0
  72. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-planner-researcher-coder-distributed/uipath.json +0 -0
  73. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-planner-researcher-coder-distributed/uv.lock +0 -0
  74. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-supervisor-researcher-coder/.env.example +0 -0
  75. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-supervisor-researcher-coder/README.md +0 -0
  76. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-supervisor-researcher-coder/agent.mermaid +0 -0
  77. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-supervisor-researcher-coder/graph.py +0 -0
  78. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-supervisor-researcher-coder/langgraph.json +0 -0
  79. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-supervisor-researcher-coder/pyproject.toml +0 -0
  80. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-supervisor-researcher-coder/uipath.json +0 -0
  81. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/multi-agent-supervisor-researcher-coder/uv.lock +0 -0
  82. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/retrieval-chain/.env.example +0 -0
  83. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/retrieval-chain/README.md +0 -0
  84. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/retrieval-chain/main.py +0 -0
  85. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/retrieval-chain/pyproject.toml +0 -0
  86. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/retrieval-chain/uv.lock +0 -0
  87. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-local-mcp/.env.example +0 -0
  88. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-local-mcp/README.md +0 -0
  89. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-local-mcp/agent.mermaid +0 -0
  90. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-local-mcp/langgraph.json +0 -0
  91. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-local-mcp/pyproject.toml +0 -0
  92. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-local-mcp/src/simple-local-mcp/graph.py +0 -0
  93. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-local-mcp/src/simple-local-mcp/math_server.py +0 -0
  94. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-local-mcp/src/simple-local-mcp/weather_server.py +0 -0
  95. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-local-mcp/uipath.json +0 -0
  96. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-local-mcp/uv.lock +0 -0
  97. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-remote-mcp/.env.example +0 -0
  98. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-remote-mcp/README.md +0 -0
  99. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-remote-mcp/agent.mermaid +0 -0
  100. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-remote-mcp/langgraph.json +0 -0
  101. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-remote-mcp/main.py +0 -0
  102. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-remote-mcp/pyproject.toml +0 -0
  103. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-remote-mcp/uipath.json +0 -0
  104. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/simple-remote-mcp/uv.lock +0 -0
  105. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/ticket-classification/.env.example +0 -0
  106. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/ticket-classification/README.md +0 -0
  107. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/ticket-classification/agent.mermaid +0 -0
  108. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/ticket-classification/escalation_app_solution/generic-escalation-app-solution-1.0.0.zip +0 -0
  109. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/ticket-classification/langgraph.json +0 -0
  110. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/ticket-classification/main.py +0 -0
  111. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/ticket-classification/pyproject.toml +0 -0
  112. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/ticket-classification/uipath.json +0 -0
  113. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/samples/ticket-classification/uv.lock +0 -0
  114. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/__init__.py +0 -0
  115. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_cli/__init__.py +0 -0
  116. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_cli/_runtime/_context.py +0 -0
  117. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_cli/_runtime/_escalation.py +0 -0
  118. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_cli/_runtime/_exception.py +0 -0
  119. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_cli/_runtime/_input.py +0 -0
  120. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_cli/_runtime/_output.py +0 -0
  121. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_cli/_runtime/_runtime.py +0 -0
  122. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_cli/_utils/_graph.py +0 -0
  123. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_cli/cli_run.py +0 -0
  124. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_utils/__init__.py +0 -0
  125. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_utils/_request_mixin.py +0 -0
  126. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_utils/_settings.py +0 -0
  127. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/_utils/_sleep_policy.py +0 -0
  128. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/chat/__init__.py +0 -0
  129. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/chat/models.py +0 -0
  130. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/chat/utils/__init__.py +0 -0
  131. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/chat/utils/_chat_types.py +0 -0
  132. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/embeddings/__init__.py +0 -0
  133. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/embeddings/embeddings.py +0 -0
  134. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/retrievers/__init__.py +0 -0
  135. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/retrievers/context_grounding_retriever.py +0 -0
  136. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/tracers/AsyncUiPathTracer.py +0 -0
  137. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/tracers/UiPathTracer.py +0 -0
  138. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/tracers/__init__.py +0 -0
  139. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/tracers/_events.py +0 -0
  140. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/tracers/_instrument_traceable.py +0 -0
  141. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/tracers/_utils.py +0 -0
  142. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/utils/__init__.py +0 -0
  143. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/utils/_request_mixin.py +0 -0
  144. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/utils/_settings.py +0 -0
  145. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/utils/_sleep_policy.py +0 -0
  146. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/src/uipath_langchain/vectorstores/context_grounding_vectorstore.py +0 -0
  147. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/tests/__init__.py +0 -0
  148. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/tests/test_dummy.py +0 -0
  149. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/tests/test_langchain_client.py +0 -0
  150. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/tests/tracers/__init__.py +0 -0
  151. {uipath_langchain-0.0.94 → uipath_langchain-0.0.96}/tests/tracers/test_instrument_traceable.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: uipath-langchain
3
- Version: 0.0.94
3
+ Version: 0.0.96
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
@@ -25,7 +25,7 @@ Requires-Dist: pydantic-settings>=2.6.0
25
25
  Requires-Dist: python-dotenv>=1.0.1
26
26
  Requires-Dist: requests>=2.23.3
27
27
  Requires-Dist: types-requests>=2.32.0.20241016
28
- Requires-Dist: uipath<2.1.0,>=2.0.23
28
+ Requires-Dist: uipath<2.1.0,>=2.0.28
29
29
  Provides-Extra: langchain
30
30
  Description-Content-Type: text/markdown
31
31
 
@@ -1,11 +1,11 @@
1
1
  [project]
2
2
  name = "uipath-langchain"
3
- version = "0.0.94"
3
+ version = "0.0.96"
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.0.23, <2.1.0",
8
+ "uipath>=2.0.28, <2.1.0",
9
9
  "langgraph>=0.2.70",
10
10
  "langchain-core>=0.3.34",
11
11
  "langgraph-checkpoint-sqlite>=2.0.3",
@@ -0,0 +1,7 @@
1
+ {
2
+ "dependencies": ["."],
3
+ "graphs": {
4
+ "agent": "./main.py:graph"
5
+ },
6
+ "env": ".env"
7
+ }
@@ -0,0 +1,33 @@
1
+ from langchain_anthropic import ChatAnthropic
2
+ from langchain_core.messages import HumanMessage, SystemMessage
3
+ from langchain_openai import ChatOpenAI
4
+ from langgraph.graph import START, StateGraph, END
5
+ from pydantic import BaseModel
6
+ import os
7
+
8
+ class GraphInput(BaseModel):
9
+ topic: str
10
+
11
+ class GraphOutput(BaseModel):
12
+ report: str
13
+
14
+ async def generate_report(state: GraphInput) -> GraphOutput:
15
+ if os.getenv("ANTHROPIC_API_KEY"):
16
+ llm_model = ChatAnthropic(model="claude-3-5-sonnet-latest")
17
+ elif os.getenv("OPENAI_API_KEY"):
18
+ llm_model = ChatOpenAI(model="gpt-4o-mini", temperature=0)
19
+ else:
20
+ raise Exception("Error: Missing API Key. Please define either ANTHROPIC_API_KEY or OPENAI_API_KEY.")
21
+
22
+ system_prompt = "You are a report generator. Please provide a brief report based on the given topic."
23
+ output = await llm_model.ainvoke([SystemMessage(system_prompt), HumanMessage(state.topic)])
24
+ return GraphOutput(report=output.content)
25
+
26
+ builder = StateGraph(input=GraphInput, output=GraphOutput)
27
+
28
+ builder.add_node("generate_report", generate_report)
29
+
30
+ builder.add_edge(START, "generate_report")
31
+ builder.add_edge("generate_report", END)
32
+
33
+ graph = builder.compile()
@@ -4,14 +4,15 @@ import os
4
4
  import uuid
5
5
  from typing import Any, Dict
6
6
 
7
- import click
8
7
  from langgraph.graph.state import CompiledStateGraph
8
+ from uipath._cli._utils._console import ConsoleLogger
9
9
  from uipath._cli._utils._parse_ast import generate_bindings_json # type: ignore
10
10
  from uipath._cli.middlewares import MiddlewareResult
11
- from uipath._cli.spinner import Spinner
12
11
 
13
12
  from ._utils._graph import LangGraphConfig
14
13
 
14
+ console = ConsoleLogger()
15
+
15
16
 
16
17
  def resolve_refs(schema, root=None):
17
18
  """Recursively resolves $ref references in a JSON schema."""
@@ -95,7 +96,6 @@ def generate_schema_from_graph(graph: CompiledStateGraph) -> Dict[str, Any]:
95
96
 
96
97
  async def langgraph_init_middleware_async(entrypoint: str) -> MiddlewareResult:
97
98
  """Middleware to check for langgraph.json and create uipath.json with schemas"""
98
- spinner = Spinner("Initializing UiPath project...")
99
99
  config = LangGraphConfig()
100
100
  if not config.exists:
101
101
  return MiddlewareResult(
@@ -103,7 +103,6 @@ async def langgraph_init_middleware_async(entrypoint: str) -> MiddlewareResult:
103
103
  ) # Continue with normal flow if no langgraph.json
104
104
 
105
105
  try:
106
- spinner.start()
107
106
  config.load_config()
108
107
  entrypoints = []
109
108
  all_bindings = {"version": "2.0", "resources": []}
@@ -134,8 +133,8 @@ async def langgraph_init_middleware_async(entrypoint: str) -> MiddlewareResult:
134
133
  if "resources" in file_bindings:
135
134
  all_bindings["resources"] = file_bindings["resources"]
136
135
  except Exception as e:
137
- print(
138
- f"⚠️ Warning: Could not generate bindings for {graph.file_path}: {str(e)}"
136
+ console.warning(
137
+ f"Warning: Could not generate bindings for {graph.file_path}: {str(e)}"
139
138
  )
140
139
 
141
140
  new_entrypoint: dict[str, Any] = {
@@ -148,21 +147,18 @@ async def langgraph_init_middleware_async(entrypoint: str) -> MiddlewareResult:
148
147
  entrypoints.append(new_entrypoint)
149
148
 
150
149
  except Exception as e:
151
- spinner.stop()
152
- print(f"Error during graph load: {e}")
150
+ console.error(f"Error during graph load: {e}")
153
151
  return MiddlewareResult(
154
152
  should_continue=False,
155
- error_message=f"❌ Failed to load graph '{graph.name}': {str(e)}",
156
153
  should_include_stacktrace=True,
157
154
  )
158
155
  finally:
159
156
  await graph.cleanup()
160
157
 
161
158
  if entrypoint and not entrypoints:
162
- spinner.stop()
159
+ console.error(f"Error: No graph found with name '{entrypoint}'")
163
160
  return MiddlewareResult(
164
161
  should_continue=False,
165
- error_message=f"❌ Error: No graph found with name '{entrypoint}'",
166
162
  )
167
163
 
168
164
  uipath_config = {"entryPoints": entrypoints, "bindings": all_bindings}
@@ -177,25 +173,22 @@ async def langgraph_init_middleware_async(entrypoint: str) -> MiddlewareResult:
177
173
  try:
178
174
  with open(mermaid_file_path, "w") as f:
179
175
  f.write(mermaid_content)
176
+ console.success(f" Created '{mermaid_file_path}' file.")
180
177
  except Exception as write_error:
181
- spinner.stop()
178
+ console.error(
179
+ f"Error writing mermaid file for '{graph_name}': {str(write_error)}"
180
+ )
182
181
  return MiddlewareResult(
183
182
  should_continue=False,
184
- error_message=f"❌ Error writing mermaid file for '{graph_name}': {str(write_error)}",
185
183
  should_include_stacktrace=True,
186
184
  )
187
- spinner.stop()
188
- return MiddlewareResult(
189
- should_continue=False,
190
- info_message=click.style("✓ ", fg="green", bold=True)
191
- + f" Configuration file {config_path} created successfully.",
192
- )
185
+ console.success(f" Created '{config_path}' file.")
186
+ return MiddlewareResult(should_continue=False)
193
187
 
194
188
  except Exception as e:
195
- spinner.stop()
189
+ console.error(f"Error processing langgraph configuration: {str(e)}")
196
190
  return MiddlewareResult(
197
191
  should_continue=False,
198
- error_message=f"❌ Error processing langgraph configuration: {str(e)}",
199
192
  should_include_stacktrace=True,
200
193
  )
201
194
 
@@ -0,0 +1,71 @@
1
+ import os
2
+ import shutil
3
+
4
+ import click
5
+ from uipath._cli._utils._console import ConsoleLogger
6
+ from uipath._cli.middlewares import MiddlewareResult
7
+
8
+ console = ConsoleLogger()
9
+
10
+
11
+ def generate_script(target_directory):
12
+ template_script_path = os.path.join(
13
+ os.path.dirname(__file__), "_templates/main.py.template"
14
+ )
15
+ target_path = os.path.join(target_directory, "main.py")
16
+
17
+ shutil.copyfile(template_script_path, target_path)
18
+
19
+ template_langgraph_json_path = os.path.join(
20
+ os.path.dirname(__file__), "_templates/langgraph.json.template"
21
+ )
22
+ target_path = os.path.join(target_directory, "langgraph.json")
23
+ shutil.copyfile(template_langgraph_json_path, target_path)
24
+
25
+
26
+ def generate_pyproject(target_directory, project_name):
27
+ project_toml_path = os.path.join(target_directory, "pyproject.toml")
28
+ toml_content = f"""[project]
29
+ name = "{project_name}"
30
+ version = "0.0.1"
31
+ description = "{project_name}"
32
+ authors = [{{ name = "John Doe", email = "john.doe@myemail.com" }}]
33
+ dependencies = [
34
+ "uipath-langchain>=0.0.95",
35
+ "langchain-anthropic>=0.3.8",
36
+ ]
37
+ requires-python = ">=3.10"
38
+ """
39
+
40
+ with open(project_toml_path, "w") as f:
41
+ f.write(toml_content)
42
+
43
+
44
+ def langgraph_new_middleware(name: str) -> MiddlewareResult:
45
+ """Middleware to create demo langchain agent"""
46
+
47
+ directory = os.getcwd()
48
+
49
+ try:
50
+ with console.spinner(f"Creating new agent {name} in current directory ..."):
51
+ generate_pyproject(directory, name)
52
+ generate_script(directory)
53
+ console.success("Created 'main.py' file.")
54
+ console.success("Created 'langgraph.json' file.")
55
+ generate_pyproject(directory, name)
56
+ console.success("Created 'pyproject.toml' file.")
57
+ os.system("uv sync")
58
+ ctx = click.get_current_context()
59
+ init_cmd = ctx.parent.command.get_command(ctx, "init") # type: ignore
60
+ ctx.invoke(init_cmd)
61
+ console.config(
62
+ " Please ensure to define either ANTHROPIC_API_KEY or OPENAI_API_KEY in your .env file."
63
+ )
64
+ console.hint(""" Run agent: uipath run agent '{"topic": "UiPath"}'""")
65
+ return MiddlewareResult(should_continue=False)
66
+ except Exception as e:
67
+ console.error(f"Error creating demo agent {str(e)}")
68
+ return MiddlewareResult(
69
+ should_continue=False,
70
+ should_include_stacktrace=True,
71
+ )
@@ -1,6 +1,7 @@
1
1
  from uipath._cli.middlewares import Middlewares
2
2
 
3
3
  from ._cli.cli_init import langgraph_init_middleware
4
+ from ._cli.cli_new import langgraph_new_middleware
4
5
  from ._cli.cli_run import langgraph_run_middleware
5
6
 
6
7
 
@@ -8,3 +9,4 @@ def register_middleware():
8
9
  """This function will be called by the entry point system when uipath_langchain is installed"""
9
10
  Middlewares.register("init", langgraph_init_middleware)
10
11
  Middlewares.register("run", langgraph_run_middleware)
12
+ Middlewares.register("new", langgraph_new_middleware)