uipath-openai-agents 0.0.1__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.
Files changed (97) hide show
  1. uipath_openai_agents-0.0.1/.gitignore +184 -0
  2. uipath_openai_agents-0.0.1/.python-version +1 -0
  3. uipath_openai_agents-0.0.1/CONTRIBUTING.md +42 -0
  4. uipath_openai_agents-0.0.1/PKG-INFO +53 -0
  5. uipath_openai_agents-0.0.1/README.md +32 -0
  6. uipath_openai_agents-0.0.1/docs/quick_start.md +301 -0
  7. uipath_openai_agents-0.0.1/pyproject.toml +99 -0
  8. uipath_openai_agents-0.0.1/samples/agent-as-tools/.agent/CLI_REFERENCE.md +563 -0
  9. uipath_openai_agents-0.0.1/samples/agent-as-tools/.agent/REQUIRED_STRUCTURE.md +64 -0
  10. uipath_openai_agents-0.0.1/samples/agent-as-tools/.agent/SDK_REFERENCE.md +643 -0
  11. uipath_openai_agents-0.0.1/samples/agent-as-tools/.env.example +5 -0
  12. uipath_openai_agents-0.0.1/samples/agent-as-tools/AGENTS.md +21 -0
  13. uipath_openai_agents-0.0.1/samples/agent-as-tools/CLAUDE.md +1 -0
  14. uipath_openai_agents-0.0.1/samples/agent-as-tools/README.md +117 -0
  15. uipath_openai_agents-0.0.1/samples/agent-as-tools/agent.mermaid +15 -0
  16. uipath_openai_agents-0.0.1/samples/agent-as-tools/bindings.json +4 -0
  17. uipath_openai_agents-0.0.1/samples/agent-as-tools/input.json +3 -0
  18. uipath_openai_agents-0.0.1/samples/agent-as-tools/main.py +133 -0
  19. uipath_openai_agents-0.0.1/samples/agent-as-tools/openai_agents.json +5 -0
  20. uipath_openai_agents-0.0.1/samples/agent-as-tools/pyproject.toml +19 -0
  21. uipath_openai_agents-0.0.1/samples/agent-as-tools/uipath.json +14 -0
  22. uipath_openai_agents-0.0.1/samples/agent-as-tools/uv.lock +2282 -0
  23. uipath_openai_agents-0.0.1/samples/rag-assistant/.agent/CLI_REFERENCE.md +227 -0
  24. uipath_openai_agents-0.0.1/samples/rag-assistant/.agent/REQUIRED_STRUCTURE.md +64 -0
  25. uipath_openai_agents-0.0.1/samples/rag-assistant/.agent/SDK_REFERENCE.md +643 -0
  26. uipath_openai_agents-0.0.1/samples/rag-assistant/AGENTS.md +21 -0
  27. uipath_openai_agents-0.0.1/samples/rag-assistant/CLAUDE.md +1 -0
  28. uipath_openai_agents-0.0.1/samples/rag-assistant/agent.mermaid +6 -0
  29. uipath_openai_agents-0.0.1/samples/rag-assistant/bindings.json +4 -0
  30. uipath_openai_agents-0.0.1/samples/rag-assistant/entry-points.json +94 -0
  31. uipath_openai_agents-0.0.1/samples/rag-assistant/input.json +3 -0
  32. uipath_openai_agents-0.0.1/samples/rag-assistant/main.py +76 -0
  33. uipath_openai_agents-0.0.1/samples/rag-assistant/openai_agents.json +5 -0
  34. uipath_openai_agents-0.0.1/samples/rag-assistant/pyproject.toml +18 -0
  35. uipath_openai_agents-0.0.1/samples/rag-assistant/uipath.json +14 -0
  36. uipath_openai_agents-0.0.1/samples/rag-assistant/uv.lock +2280 -0
  37. uipath_openai_agents-0.0.1/samples/triage-agent/.agent/CLI_REFERENCE.md +563 -0
  38. uipath_openai_agents-0.0.1/samples/triage-agent/.agent/REQUIRED_STRUCTURE.md +64 -0
  39. uipath_openai_agents-0.0.1/samples/triage-agent/.agent/SDK_REFERENCE.md +643 -0
  40. uipath_openai_agents-0.0.1/samples/triage-agent/AGENTS.md +21 -0
  41. uipath_openai_agents-0.0.1/samples/triage-agent/CLAUDE.md +1 -0
  42. uipath_openai_agents-0.0.1/samples/triage-agent/README.md +101 -0
  43. uipath_openai_agents-0.0.1/samples/triage-agent/agent.mermaid +15 -0
  44. uipath_openai_agents-0.0.1/samples/triage-agent/bindings.json +4 -0
  45. uipath_openai_agents-0.0.1/samples/triage-agent/entry-points.json +142 -0
  46. uipath_openai_agents-0.0.1/samples/triage-agent/input.json +3 -0
  47. uipath_openai_agents-0.0.1/samples/triage-agent/main.py +106 -0
  48. uipath_openai_agents-0.0.1/samples/triage-agent/openai_agents.json +5 -0
  49. uipath_openai_agents-0.0.1/samples/triage-agent/pyproject.toml +19 -0
  50. uipath_openai_agents-0.0.1/samples/triage-agent/uipath.json +16 -0
  51. uipath_openai_agents-0.0.1/samples/triage-agent/uv.lock +2260 -0
  52. uipath_openai_agents-0.0.1/src/uipath_openai_agents/__init__.py +7 -0
  53. uipath_openai_agents-0.0.1/src/uipath_openai_agents/_cli/__init__.py +1 -0
  54. uipath_openai_agents-0.0.1/src/uipath_openai_agents/_cli/_templates/AGENTS.md.template +21 -0
  55. uipath_openai_agents-0.0.1/src/uipath_openai_agents/_cli/_templates/main.py.template +28 -0
  56. uipath_openai_agents-0.0.1/src/uipath_openai_agents/_cli/_templates/openai_agents.json.template +5 -0
  57. uipath_openai_agents-0.0.1/src/uipath_openai_agents/_cli/cli_new.py +81 -0
  58. uipath_openai_agents-0.0.1/src/uipath_openai_agents/chat/__init__.py +5 -0
  59. uipath_openai_agents-0.0.1/src/uipath_openai_agents/chat/openai.py +242 -0
  60. uipath_openai_agents-0.0.1/src/uipath_openai_agents/chat/supported_models.py +78 -0
  61. uipath_openai_agents-0.0.1/src/uipath_openai_agents/middlewares.py +8 -0
  62. uipath_openai_agents-0.0.1/src/uipath_openai_agents/py.typed +0 -0
  63. uipath_openai_agents-0.0.1/src/uipath_openai_agents/runtime/__init__.py +40 -0
  64. uipath_openai_agents-0.0.1/src/uipath_openai_agents/runtime/_serialize.py +51 -0
  65. uipath_openai_agents-0.0.1/src/uipath_openai_agents/runtime/_sqlite.py +190 -0
  66. uipath_openai_agents-0.0.1/src/uipath_openai_agents/runtime/_telemetry.py +32 -0
  67. uipath_openai_agents-0.0.1/src/uipath_openai_agents/runtime/agent.py +201 -0
  68. uipath_openai_agents-0.0.1/src/uipath_openai_agents/runtime/config.py +55 -0
  69. uipath_openai_agents-0.0.1/src/uipath_openai_agents/runtime/errors.py +48 -0
  70. uipath_openai_agents-0.0.1/src/uipath_openai_agents/runtime/factory.py +353 -0
  71. uipath_openai_agents-0.0.1/src/uipath_openai_agents/runtime/runtime.py +532 -0
  72. uipath_openai_agents-0.0.1/src/uipath_openai_agents/runtime/schema.py +490 -0
  73. uipath_openai_agents-0.0.1/src/uipath_openai_agents/runtime/storage.py +357 -0
  74. uipath_openai_agents-0.0.1/testcases/common/validate_output.sh +35 -0
  75. uipath_openai_agents-0.0.1/testcases/triage-agent/input.json +3 -0
  76. uipath_openai_agents-0.0.1/testcases/triage-agent/openai_agents.json +5 -0
  77. uipath_openai_agents-0.0.1/testcases/triage-agent/pyproject.toml +12 -0
  78. uipath_openai_agents-0.0.1/testcases/triage-agent/run.sh +18 -0
  79. uipath_openai_agents-0.0.1/testcases/triage-agent/src/assert.py +78 -0
  80. uipath_openai_agents-0.0.1/testcases/triage-agent/src/main.py +42 -0
  81. uipath_openai_agents-0.0.1/tests/__init__.py +1 -0
  82. uipath_openai_agents-0.0.1/tests/cli/__init__.py +1 -0
  83. uipath_openai_agents-0.0.1/tests/cli/conftest.py +36 -0
  84. uipath_openai_agents-0.0.1/tests/cli/test_init.py +146 -0
  85. uipath_openai_agents-0.0.1/tests/cli/test_run.py +128 -0
  86. uipath_openai_agents-0.0.1/tests/conftest.py +32 -0
  87. uipath_openai_agents-0.0.1/tests/demo_schema_inference.py +112 -0
  88. uipath_openai_agents-0.0.1/tests/mocks/openai_agents.json +6 -0
  89. uipath_openai_agents-0.0.1/tests/mocks/simple_agent_basic.py +9 -0
  90. uipath_openai_agents-0.0.1/tests/mocks/simple_agent_translation.py +20 -0
  91. uipath_openai_agents-0.0.1/tests/test_agent_as_tools_schema.py +105 -0
  92. uipath_openai_agents-0.0.1/tests/test_integration.py +166 -0
  93. uipath_openai_agents-0.0.1/tests/test_placeholder.py +6 -0
  94. uipath_openai_agents-0.0.1/tests/test_schema_inference.py +112 -0
  95. uipath_openai_agents-0.0.1/tests/test_serialization.py +262 -0
  96. uipath_openai_agents-0.0.1/tests/test_storage.py +479 -0
  97. uipath_openai_agents-0.0.1/uv.lock +2642 -0
@@ -0,0 +1,184 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ .idea/
169
+
170
+ # Ruff stuff:
171
+ .ruff_cache/
172
+
173
+ # PyPI configuration file
174
+ .pypirc
175
+
176
+ **/uipath.db
177
+ **/.uipath
178
+ **/**.nupkg
179
+ **/__uipath/
180
+ .claude/settings.local.json
181
+
182
+ /.vscode/launch.json
183
+
184
+ playground.py
@@ -0,0 +1 @@
1
+ 3.11
@@ -0,0 +1,42 @@
1
+ # Contributing to UiPath SDK
2
+
3
+ ## Local Development Setup
4
+
5
+ ### Prerequisites
6
+
7
+ 1. **Install Python 3.13**:
8
+ - Download and install Python 3.13 from the official [Python website](https://www.python.org/downloads/)
9
+ - Verify the installation by running:
10
+ ```sh
11
+ python3.13 --version
12
+ ```
13
+
14
+ Alternative: [mise](https://mise.jdx.dev/lang/python.html)
15
+
16
+ 2. **Install [uv](https://docs.astral.sh/uv/)**:
17
+ ```sh
18
+ pip install uv
19
+ ```
20
+
21
+ 3. **Create a virtual environment in the current working directory**:
22
+ ```sh
23
+ uv venv
24
+ ```
25
+
26
+ 4. **Install dependencies**:
27
+ ```sh
28
+ uv sync --all-extras
29
+ ```
30
+
31
+ See `just --list` for linting, formatting and build commands.
32
+
33
+
34
+ ### Use SDK Locally
35
+ 1. Create a folder on your own device `mkdir project; cd project`
36
+ 2. Initialize the python project `uv` `uv init . --python 3.11`
37
+ 3. Obtain the project path `PATH_TO_SDK=/Users/YOU_USER/uipath-integrations-python/packages/uipath-openai-agents/`
38
+ 4. Install the sdk in editable mode `uv add --editable ${PATH_TO_SDK}`
39
+
40
+ :information_source: Instead of cloning the project into `.venv/lib/python3.11/site-packages/uipath-openai-agents`, this mode creates a file named `_uipath-openai-agents.pth` inside `.venv/lib/python3.11/site-packages`. This file contains the value of `PATH_TO_SDK`, which is added to `sys.path`—the list of directories where python searches for packages. (Run `python -c 'import sys; print(sys.path)'` to see the entries.)
41
+
42
+
@@ -0,0 +1,53 @@
1
+ Metadata-Version: 2.4
2
+ Name: uipath-openai-agents
3
+ Version: 0.0.1
4
+ Summary: UiPath OpenAI Agents SDK
5
+ Project-URL: Homepage, https://uipath.com
6
+ Project-URL: Repository, https://github.com/UiPath/uipath-llamaindex-python
7
+ Maintainer-email: Marius Cosareanu <marius.cosareanu@uipath.com>, Cristian Pufu <cristian.pufu@uipath.com>
8
+ Classifier: Intended Audience :: Developers
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Topic :: Software Development :: Build Tools
13
+ Requires-Python: >=3.11
14
+ Requires-Dist: aiosqlite>=0.20.0
15
+ Requires-Dist: openai-agents>=0.6.5
16
+ Requires-Dist: openai>=1.0.0
17
+ Requires-Dist: openinference-instrumentation-openai-agents>=1.4.0
18
+ Requires-Dist: uipath-runtime<0.6.0,>=0.5.0
19
+ Requires-Dist: uipath<2.6.0,>=2.5.0
20
+ Description-Content-Type: text/markdown
21
+
22
+ # UiPath OpenAI Agents SDK
23
+
24
+ Build intelligent AI agents with OpenAI's Agents framework and UiPath.
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ pip install uipath-openai-agents
30
+ ```
31
+
32
+ ## Quick Start
33
+
34
+ See the [main repository documentation](../../docs/) for getting started guides and examples.
35
+
36
+ ## Features
37
+
38
+ - **OpenAI Agents Integration**: Build agents using OpenAI's native Agents framework
39
+ - **Agent Orchestration**: Multi-agent coordination and communication
40
+ - **State Management**: Persistent agent state with SQLite sessions
41
+ - **UiPath Integration**: Seamless integration with UiPath runtime and tooling
42
+
43
+ ## Status
44
+
45
+ ⚠️ **Early Development**: This package is in early development (v0.1.0). APIs may change as the OpenAI Agents framework evolves.
46
+
47
+ ## Documentation
48
+
49
+ Full documentation is available in the [main repository](https://github.com/UiPath/uipath-llamaindex-python).
50
+
51
+ ## License
52
+
53
+ See [LICENSE](../../LICENSE) in the repository root.
@@ -0,0 +1,32 @@
1
+ # UiPath OpenAI Agents SDK
2
+
3
+ Build intelligent AI agents with OpenAI's Agents framework and UiPath.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ pip install uipath-openai-agents
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ See the [main repository documentation](../../docs/) for getting started guides and examples.
14
+
15
+ ## Features
16
+
17
+ - **OpenAI Agents Integration**: Build agents using OpenAI's native Agents framework
18
+ - **Agent Orchestration**: Multi-agent coordination and communication
19
+ - **State Management**: Persistent agent state with SQLite sessions
20
+ - **UiPath Integration**: Seamless integration with UiPath runtime and tooling
21
+
22
+ ## Status
23
+
24
+ ⚠️ **Early Development**: This package is in early development (v0.1.0). APIs may change as the OpenAI Agents framework evolves.
25
+
26
+ ## Documentation
27
+
28
+ Full documentation is available in the [main repository](https://github.com/UiPath/uipath-llamaindex-python).
29
+
30
+ ## License
31
+
32
+ See [LICENSE](../../LICENSE) in the repository root.
@@ -0,0 +1,301 @@
1
+ # Quickstart Guide: UiPath OpenAI Agents
2
+
3
+ ## Introduction
4
+
5
+ This guide provides step-by-step instructions for setting up, creating, publishing, and running your first UiPath OpenAI Agent.
6
+
7
+ ## Prerequisites
8
+
9
+ Before proceeding, ensure you have the following installed:
10
+
11
+ - Python 3.11 or higher
12
+ - `pip` or `uv` package manager
13
+ - A UiPath Automation Cloud account with appropriate permissions
14
+ - An OpenAI API key
15
+
16
+ /// info
17
+ **OpenAI** - Generate an OpenAI API key [here](https://platform.openai.com).
18
+ ///
19
+
20
+ ## Creating a New Project
21
+
22
+ We recommend using `uv` for package management. To create a new project:
23
+
24
+ //// tab | Linux, macOS, Windows Bash
25
+
26
+ <!-- termynal -->
27
+
28
+ ```shell
29
+ > mkdir example
30
+ > cd example
31
+ ```
32
+
33
+ ////
34
+
35
+ //// tab | Windows PowerShell
36
+
37
+ <!-- termynal -->
38
+
39
+ ```powershell
40
+ > New-Item -ItemType Directory -Path example
41
+ > Set-Location example
42
+ ```
43
+
44
+ ////
45
+
46
+ //// tab | uv
47
+ new: true
48
+
49
+ <!-- termynal -->
50
+
51
+ ```shell
52
+ # Initialize a new uv project in the current directory
53
+ > uv init . --python 3.11
54
+
55
+ # Create a new virtual environment
56
+ # By default, uv creates a virtual environment in a directory called .venv
57
+ > uv venv
58
+ Using CPython 3.11.16 interpreter at: [PATH]
59
+ Creating virtual environment at: .venv
60
+ Activate with: source .venv/bin/activate
61
+
62
+ # Activate the virtual environment
63
+ # For Windows PowerShell/ Windows CMD: .venv\Scripts\activate
64
+ # For Windows Bash: source .venv/Scripts/activate
65
+ > source .venv/bin/activate
66
+
67
+ # Install the uipath package
68
+ > uv add uipath-openai-agents
69
+ ```
70
+
71
+ ////
72
+
73
+ //// tab | pip
74
+
75
+ <!-- termynal -->
76
+
77
+ ```shell
78
+ # Create a new virtual environment
79
+ > python -m venv .venv
80
+
81
+ # Activate the virtual environment
82
+ # For Windows PowerShell: .venv\Scripts\Activate.ps1
83
+ # For Windows Bash: source .venv/Scripts/activate
84
+ > source .venv/bin/activate
85
+
86
+ # Upgrade pip to the latest version
87
+ > python -m pip install --upgrade pip
88
+
89
+ # Install the uipath package
90
+ > pip install uipath-openai-agents
91
+ ```
92
+
93
+ ////
94
+
95
+ ## Create Your First UiPath Agent
96
+
97
+ Generate your first UiPath OpenAI agent:
98
+
99
+ <!-- termynal -->
100
+
101
+ ```shell
102
+ > uipath new my-agent
103
+ ⠋ Creating new agent my-agent in current directory ...
104
+ ✓ Created 'main.py' file.
105
+ ✓ Created 'openai_agents.json' file.
106
+ ✓ Created 'pyproject.toml' file.
107
+ 🔧 Please ensure to define OPENAI_API_KEY in your .env file.
108
+ 💡 Initialize project: uipath init
109
+ 💡 Run agent: uipath run agent '{"message": "Hello"}'
110
+ ```
111
+
112
+ This command creates the following files:
113
+
114
+ | File Name | Description |
115
+ |------------------|----------------------------------------------------------------------------------------------------------------------------------|
116
+ | `main.py` | OpenAI Agents code. |
117
+ | `openai_agents.json` | OpenAI Agents specific configuration file. |
118
+ | `pyproject.toml` | Project metadata and dependencies as per [PEP 518](https://peps.python.org/pep-0518/). |
119
+
120
+
121
+ ## Initialize Project
122
+
123
+ <!-- termynal -->
124
+
125
+ ```shell
126
+ > uipath init
127
+ ⠋ Initializing UiPath project ...
128
+ ✓ Created '.env' file.
129
+ ✓ Created 'agent.mermaid' file.
130
+ ✓ Created 'entry-points.json' file.
131
+ ```
132
+
133
+ This command creates the following files:
134
+
135
+ | File Name | Description |
136
+ | ---------------- | --------------------------------------------------------------------------------------------------------------------------------- |
137
+ | `.env` | Environment variables and secrets (this file will not be packed & published). |
138
+ | `uipath.json` | Input/output JSON schemas and bindings. |
139
+ | `agent.mermaid` | Graph visual representation. |
140
+
141
+ ## Set Up Environment Variables
142
+
143
+ Before running the agent, configure `OPENAI_API_KEY` in the `.env` file:
144
+
145
+ //// tab | Open AI
146
+
147
+ ```
148
+ OPENAI_API_KEY=sk-proj-......
149
+ ```
150
+
151
+ ////
152
+
153
+ ## Authenticate With UiPath
154
+
155
+ <!-- termynal -->
156
+
157
+ ```shell
158
+ > uipath auth
159
+ ⠋ Authenticating with UiPath ...
160
+ 🔗 If a browser window did not open, please open the following URL in your browser: [LINK]
161
+ 👇 Select tenant:
162
+ 0: Tenant1
163
+ 1: Tenant2
164
+ Select tenant number: 0
165
+ Selected tenant: Tenant1
166
+ ✓ Authentication successful.
167
+ ```
168
+
169
+ ## Run The Agent Locally
170
+
171
+ Execute the agent with a sample input:
172
+
173
+ <!-- termynal -->
174
+
175
+ ```shell
176
+ > uipath run agent '{"message": "Hello"}'
177
+ {'response': 'Hello! How can I help you today?', 'agent_used': 'main'}
178
+ ✓ Successful execution.
179
+ ```
180
+
181
+ This command runs your agent locally and displays the output in the standard output.
182
+
183
+ /// warning
184
+ Depending on the shell you are using, it may be necessary to escape the input json:
185
+
186
+ /// tab | Bash/ZSH/PowerShell
187
+ ```console
188
+ uipath run agent '{"message": "Hello"}'
189
+ ```
190
+ ///
191
+
192
+ /// tab | Windows CMD
193
+ ```console
194
+ uipath run agent "{""message"": ""Hello""}"
195
+ ```
196
+ ///
197
+
198
+ /// tab | Windows PowerShell
199
+ ```console
200
+ uipath run agent '{\"message\":\"Hello\"}'
201
+ ```
202
+ ///
203
+
204
+ ///
205
+
206
+ /// attention
207
+
208
+ For a shell agnostic option, please refer to the next section.
209
+
210
+ ///
211
+
212
+ ### (Optional) Run The Agent with a json File as Input
213
+
214
+ The `run` command can also take a .json file as an input. You can create a file named `input.json` having the following content:
215
+
216
+ ```json
217
+ {
218
+ "message": "Hello"
219
+ }
220
+ ```
221
+
222
+ Use this file as agent input:
223
+
224
+ ```shell
225
+ > uipath run agent --file input.json
226
+ ```
227
+
228
+ ## Deploy the Agent to UiPath Automation Cloud
229
+
230
+ Follow these steps to publish and run your agent to UiPath Automation Cloud:
231
+
232
+ ### (Optional) Customize the Package
233
+
234
+ Update author details in `pyproject.toml`:
235
+
236
+ ```toml
237
+ authors = [{ name = "Your Name", email = "your.name@example.com" }]
238
+ ```
239
+
240
+ ### Package Your Project
241
+
242
+ <!-- termynal -->
243
+
244
+ ```shell
245
+ > uipath pack
246
+ ⠋ Packaging project ...
247
+ Name : test
248
+ Version : 0.1.0
249
+ Description: Add your description here
250
+ Authors : Your Name
251
+ ✓ Project successfully packaged.
252
+ ```
253
+
254
+ ### Publish To My Workspace
255
+
256
+ <!-- termynal -->
257
+
258
+ ```shell
259
+ > uipath publish --my-workspace
260
+ ⠙ Publishing most recent package: my-agent.0.0.1.nupkg ...
261
+ ✓ Package published successfully!
262
+ ⠦ Getting process information ...
263
+ 🔗 Process configuration link: [LINK]
264
+ 💡 Use the link above to configure any environment variables
265
+ ```
266
+
267
+ /// info
268
+ Please note that a process will be auto-created only upon publishing to **my-workspace** package feed.
269
+ ///
270
+
271
+ Set the environment variables using the provided link.
272
+
273
+ ## Invoke the Agent on UiPath Automation Cloud
274
+
275
+ <!-- termynal -->
276
+
277
+ ```shell
278
+ > uipath invoke agent '{"message": "Hello"}'
279
+ ⠴ Loading configuration ...
280
+ ⠴ Starting job ...
281
+ ✨ Job started successfully!
282
+ 🔗 Monitor your job here: [LINK]
283
+ ```
284
+
285
+ Use the provided link to monitor your job and view detailed traces.
286
+
287
+ ### (Optional) Invoke The Agent with a json File as Input
288
+
289
+ The `invoke` command operates similarly to the `run` command, allowing you to use the same .json file defined
290
+ in the [(Optional) Run the agent with a .json file as input](#optional-run-the-agent-with-a-json-file-as-input)
291
+ section, as agent input:
292
+
293
+ ```shell
294
+ > uipath invoke agent --file input.json
295
+ ```
296
+
297
+ ## Next Steps
298
+
299
+ Congratulations! You have successfully set up, created, published, and run a UiPath OpenAI Agent. 🚀
300
+
301
+ For more advanced agents and agent samples, please refer to our [samples section](https://github.com/UiPath/uipath-integrations-python/tree/main/packages/uipath-openai-agents/samples) in GitHub.
@@ -0,0 +1,99 @@
1
+ [project]
2
+ name = "uipath-openai-agents"
3
+ version = "0.0.1"
4
+ description = "UiPath OpenAI Agents SDK"
5
+ readme = "README.md"
6
+ requires-python = ">=3.11"
7
+ dependencies = [
8
+ "aiosqlite>=0.20.0",
9
+ "openai>=1.0.0",
10
+ "openai-agents>=0.6.5",
11
+ "openinference-instrumentation-openai-agents>=1.4.0",
12
+ "uipath>=2.5.0, <2.6.0",
13
+ "uipath-runtime>=0.5.0, <0.6.0",
14
+ ]
15
+ classifiers = [
16
+ "Intended Audience :: Developers",
17
+ "Topic :: Software Development :: Build Tools",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ ]
22
+ maintainers = [
23
+ { name = "Marius Cosareanu", email = "marius.cosareanu@uipath.com" },
24
+ { name = "Cristian Pufu", email = "cristian.pufu@uipath.com" }
25
+ ]
26
+
27
+ [project.entry-points."uipath.middlewares"]
28
+ register = "uipath_openai_agents.middlewares:register_middleware"
29
+
30
+ [project.entry-points."uipath.runtime.factories"]
31
+ openai-agents = "uipath_openai_agents.runtime:register_runtime_factory"
32
+
33
+ [project.urls]
34
+ Homepage = "https://uipath.com"
35
+ Repository = "https://github.com/UiPath/uipath-llamaindex-python"
36
+
37
+ [build-system]
38
+ requires = ["hatchling"]
39
+ build-backend = "hatchling.build"
40
+
41
+ [dependency-groups]
42
+ dev = [
43
+ "mypy>=1.14.1",
44
+ "ruff>=0.9.4",
45
+ "pytest>=7.4.0",
46
+ "pytest-cov>=4.1.0",
47
+ "pytest-mock>=3.11.1",
48
+ "pre-commit>=4.1.0",
49
+ "pytest-asyncio>=1.0.0",
50
+ ]
51
+
52
+ [tool.ruff]
53
+ line-length = 88
54
+ indent-width = 4
55
+
56
+ [tool.ruff.lint]
57
+ select = ["E", "F", "B", "I"]
58
+
59
+ [tool.ruff.lint.per-file-ignores]
60
+ "*" = ["E501"]
61
+
62
+ [tool.ruff.format]
63
+ quote-style = "double"
64
+ indent-style = "space"
65
+ skip-magic-trailing-comma = false
66
+ line-ending = "auto"
67
+
68
+ [tool.mypy]
69
+ plugins = [
70
+ "pydantic.mypy"
71
+ ]
72
+ exclude = [
73
+ "samples/.*"
74
+ ]
75
+ follow_imports = "silent"
76
+ warn_redundant_casts = true
77
+ warn_unused_ignores = false
78
+ disallow_any_generics = true
79
+ check_untyped_defs = true
80
+ no_implicit_reexport = true
81
+ disallow_untyped_defs = false
82
+
83
+ [[tool.mypy.overrides]]
84
+ module = "agents"
85
+ ignore_missing_imports = true
86
+ ignore_errors = true
87
+
88
+ [tool.pytest.ini_options]
89
+ testpaths = ["tests"]
90
+ python_files = "test_*.py"
91
+ addopts = "-ra -q"
92
+ asyncio_default_fixture_loop_scope = "function"
93
+ asyncio_mode = "auto"
94
+
95
+ [[tool.uv.index]]
96
+ name = "testpypi"
97
+ url = "https://test.pypi.org/simple/"
98
+ publish-url = "https://test.pypi.org/legacy/"
99
+ explicit = true