uipath-openai-agents 0.0.1__py3-none-any.whl → 0.0.3__py3-none-any.whl
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_openai_agents/__init__.py +24 -3
- uipath_openai_agents/_cli/_templates/AGENTS.md.template +1 -1
- uipath_openai_agents/_cli/_templates/main.py.template +13 -7
- uipath_openai_agents/_cli/cli_new.py +2 -6
- uipath_openai_agents/chat/__init__.py +30 -3
- uipath_openai_agents/chat/supported_models.py +42 -60
- uipath_openai_agents/runtime/__init__.py +34 -8
- uipath_openai_agents/runtime/_serialize.py +4 -4
- uipath_openai_agents/runtime/agent.py +0 -17
- uipath_openai_agents/runtime/factory.py +0 -120
- uipath_openai_agents/runtime/runtime.py +21 -205
- uipath_openai_agents/runtime/schema.py +124 -172
- uipath_openai_agents-0.0.3.dist-info/METADATA +146 -0
- uipath_openai_agents-0.0.3.dist-info/RECORD +23 -0
- uipath_openai_agents/runtime/_sqlite.py +0 -190
- uipath_openai_agents/runtime/_telemetry.py +0 -32
- uipath_openai_agents/runtime/storage.py +0 -357
- uipath_openai_agents-0.0.1.dist-info/METADATA +0 -53
- uipath_openai_agents-0.0.1.dist-info/RECORD +0 -26
- {uipath_openai_agents-0.0.1.dist-info → uipath_openai_agents-0.0.3.dist-info}/WHEEL +0 -0
- {uipath_openai_agents-0.0.1.dist-info → uipath_openai_agents-0.0.3.dist-info}/entry_points.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Schema extraction utilities for OpenAI Agents."""
|
|
2
2
|
|
|
3
3
|
import inspect
|
|
4
|
-
from typing import Any, get_args, get_origin
|
|
4
|
+
from typing import Any, get_args, get_origin
|
|
5
5
|
|
|
6
6
|
from agents import Agent
|
|
7
7
|
from pydantic import BaseModel, TypeAdapter
|
|
@@ -41,106 +41,14 @@ def _is_pydantic_model(type_hint: Any) -> bool:
|
|
|
41
41
|
return False
|
|
42
42
|
|
|
43
43
|
|
|
44
|
-
def
|
|
45
|
-
"""
|
|
46
|
-
Extract input/output schemas from a callable's type annotations.
|
|
47
|
-
|
|
48
|
-
Args:
|
|
49
|
-
callable_obj: A callable object (function, async function, etc.)
|
|
50
|
-
|
|
51
|
-
Returns:
|
|
52
|
-
Dictionary with input and output schemas if type hints are found,
|
|
53
|
-
None otherwise
|
|
54
|
-
"""
|
|
55
|
-
if not callable(callable_obj):
|
|
56
|
-
return None
|
|
57
|
-
|
|
58
|
-
try:
|
|
59
|
-
# Get type hints from the callable
|
|
60
|
-
type_hints = get_type_hints(callable_obj)
|
|
61
|
-
|
|
62
|
-
if not type_hints:
|
|
63
|
-
return None
|
|
64
|
-
|
|
65
|
-
# Get function signature to identify parameters
|
|
66
|
-
sig = inspect.signature(callable_obj)
|
|
67
|
-
params = list(sig.parameters.values())
|
|
68
|
-
|
|
69
|
-
# Find the first parameter (usually the input)
|
|
70
|
-
input_type = None
|
|
71
|
-
|
|
72
|
-
for param in params:
|
|
73
|
-
if param.name in ("self", "cls"):
|
|
74
|
-
continue
|
|
75
|
-
if param.name in type_hints:
|
|
76
|
-
input_type = type_hints[param.name]
|
|
77
|
-
break
|
|
78
|
-
|
|
79
|
-
# Get return type
|
|
80
|
-
return_type = type_hints.get("return")
|
|
81
|
-
|
|
82
|
-
schema: dict[str, Any] = {
|
|
83
|
-
"input": {"type": "object", "properties": {}, "required": []},
|
|
84
|
-
"output": {"type": "object", "properties": {}, "required": []},
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
# Extract input schema from Pydantic model
|
|
88
|
-
if input_type and _is_pydantic_model(input_type):
|
|
89
|
-
adapter = TypeAdapter(input_type)
|
|
90
|
-
input_schema = adapter.json_schema()
|
|
91
|
-
unpacked_input = _resolve_refs(input_schema)
|
|
92
|
-
|
|
93
|
-
schema["input"]["properties"] = _process_nullable_types(
|
|
94
|
-
unpacked_input.get("properties", {})
|
|
95
|
-
)
|
|
96
|
-
schema["input"]["required"] = unpacked_input.get("required", [])
|
|
97
|
-
|
|
98
|
-
# Add title and description if available
|
|
99
|
-
if "title" in unpacked_input:
|
|
100
|
-
schema["input"]["title"] = unpacked_input["title"]
|
|
101
|
-
if "description" in unpacked_input:
|
|
102
|
-
schema["input"]["description"] = unpacked_input["description"]
|
|
103
|
-
|
|
104
|
-
# Extract output schema from Pydantic model
|
|
105
|
-
if return_type and _is_pydantic_model(return_type):
|
|
106
|
-
adapter = TypeAdapter(return_type)
|
|
107
|
-
output_schema = adapter.json_schema()
|
|
108
|
-
unpacked_output = _resolve_refs(output_schema)
|
|
109
|
-
|
|
110
|
-
schema["output"]["properties"] = _process_nullable_types(
|
|
111
|
-
unpacked_output.get("properties", {})
|
|
112
|
-
)
|
|
113
|
-
schema["output"]["required"] = unpacked_output.get("required", [])
|
|
114
|
-
|
|
115
|
-
# Add title and description if available
|
|
116
|
-
if "title" in unpacked_output:
|
|
117
|
-
schema["output"]["title"] = unpacked_output["title"]
|
|
118
|
-
if "description" in unpacked_output:
|
|
119
|
-
schema["output"]["description"] = unpacked_output["description"]
|
|
120
|
-
|
|
121
|
-
# Only return schema if we found at least one Pydantic model
|
|
122
|
-
if schema["input"]["properties"] or schema["output"]["properties"]:
|
|
123
|
-
return schema
|
|
124
|
-
|
|
125
|
-
except Exception:
|
|
126
|
-
# If schema extraction fails, return None to fall back to default
|
|
127
|
-
pass
|
|
128
|
-
|
|
129
|
-
return None
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
def get_entrypoints_schema(
|
|
133
|
-
agent: Agent, loaded_object: Any | None = None
|
|
134
|
-
) -> dict[str, Any]:
|
|
44
|
+
def get_entrypoints_schema(agent: Agent) -> dict[str, Any]:
|
|
135
45
|
"""
|
|
136
46
|
Extract input/output schema from an OpenAI Agent.
|
|
137
47
|
|
|
138
|
-
|
|
139
|
-
with optional fallback to wrapper function type hints (UiPath pattern).
|
|
48
|
+
Uses the agent's native output_type attribute for schema extraction.
|
|
140
49
|
|
|
141
50
|
Args:
|
|
142
51
|
agent: An OpenAI Agent instance
|
|
143
|
-
loaded_object: Optional original loaded object (function/callable) with type annotations
|
|
144
52
|
|
|
145
53
|
Returns:
|
|
146
54
|
Dictionary with input and output schemas
|
|
@@ -155,7 +63,7 @@ def get_entrypoints_schema(
|
|
|
155
63
|
schema["input"] = {
|
|
156
64
|
"type": "object",
|
|
157
65
|
"properties": {
|
|
158
|
-
"
|
|
66
|
+
"messages": {
|
|
159
67
|
"anyOf": [
|
|
160
68
|
{"type": "string"},
|
|
161
69
|
{
|
|
@@ -163,26 +71,26 @@ def get_entrypoints_schema(
|
|
|
163
71
|
"items": {"type": "object"},
|
|
164
72
|
},
|
|
165
73
|
],
|
|
166
|
-
"title": "
|
|
167
|
-
"description": "User
|
|
74
|
+
"title": "Messages",
|
|
75
|
+
"description": "User messages to send to the agent",
|
|
168
76
|
}
|
|
169
77
|
},
|
|
170
|
-
"required": ["
|
|
78
|
+
"required": ["messages"],
|
|
171
79
|
}
|
|
172
80
|
|
|
173
|
-
# Extract output schema -
|
|
81
|
+
# Extract output schema - Agent's output_type (native OpenAI Agents pattern)
|
|
174
82
|
output_type = getattr(agent, "output_type", None)
|
|
175
83
|
output_extracted = False
|
|
176
84
|
|
|
177
85
|
# Unwrap AgentOutputSchema if present (OpenAI Agents SDK wrapper)
|
|
178
|
-
#
|
|
86
|
+
# AgentOutputSchema wraps the actual Pydantic model in an 'output_type' attribute
|
|
179
87
|
if (
|
|
180
88
|
output_type is not None
|
|
181
|
-
and hasattr(output_type, "
|
|
89
|
+
and hasattr(output_type, "output_type")
|
|
182
90
|
and not isinstance(output_type, type)
|
|
183
91
|
):
|
|
184
92
|
# This is an AgentOutputSchema wrapper instance, extract the actual model
|
|
185
|
-
output_type = output_type.
|
|
93
|
+
output_type = output_type.output_type
|
|
186
94
|
|
|
187
95
|
if output_type is not None and _is_pydantic_model(output_type):
|
|
188
96
|
try:
|
|
@@ -207,15 +115,6 @@ def get_entrypoints_schema(
|
|
|
207
115
|
# Continue to fallback if extraction fails
|
|
208
116
|
pass
|
|
209
117
|
|
|
210
|
-
# Extract output schema - PRIORITY 2: Wrapper function type hints (UiPath pattern)
|
|
211
|
-
# This allows UiPath-specific patterns where agents are wrapped in typed functions
|
|
212
|
-
if not output_extracted and loaded_object is not None:
|
|
213
|
-
wrapper_schema = _extract_schema_from_callable(loaded_object)
|
|
214
|
-
if wrapper_schema is not None:
|
|
215
|
-
# Use the wrapper's output schema, but keep the default input (messages)
|
|
216
|
-
schema["output"] = wrapper_schema["output"]
|
|
217
|
-
output_extracted = True
|
|
218
|
-
|
|
219
118
|
# Fallback: Default output schema for agents without explicit output_type
|
|
220
119
|
if not output_extracted:
|
|
221
120
|
schema["output"] = {
|
|
@@ -244,8 +143,9 @@ def get_agent_schema(agent: Agent) -> UiPathRuntimeGraph:
|
|
|
244
143
|
"""
|
|
245
144
|
Extract graph structure from an OpenAI Agent.
|
|
246
145
|
|
|
247
|
-
OpenAI Agents
|
|
248
|
-
|
|
146
|
+
OpenAI Agents are represented as simple nodes. Regular tools are aggregated
|
|
147
|
+
into a single tools node per agent with metadata. Agent-tools and handoff
|
|
148
|
+
agents are represented as separate agent nodes.
|
|
249
149
|
|
|
250
150
|
Args:
|
|
251
151
|
agent: An OpenAI Agent instance
|
|
@@ -255,109 +155,161 @@ def get_agent_schema(agent: Agent) -> UiPathRuntimeGraph:
|
|
|
255
155
|
"""
|
|
256
156
|
nodes: list[UiPathRuntimeNode] = []
|
|
257
157
|
edges: list[UiPathRuntimeEdge] = []
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
158
|
+
visited: set[str] = set() # Track visited agents to avoid circular references
|
|
159
|
+
|
|
160
|
+
def _add_agent_and_tools(current_agent: Agent) -> None:
|
|
161
|
+
"""Recursively add agent, its tools, and nested agents to the graph."""
|
|
162
|
+
agent_name = getattr(current_agent, "name", "agent")
|
|
163
|
+
|
|
164
|
+
# Prevent circular references using agent name
|
|
165
|
+
if agent_name in visited:
|
|
166
|
+
return
|
|
167
|
+
visited.add(agent_name)
|
|
168
|
+
|
|
169
|
+
# Add agent node (first visit always adds the node)
|
|
170
|
+
nodes.append(
|
|
171
|
+
UiPathRuntimeNode(
|
|
172
|
+
id=agent_name,
|
|
173
|
+
name=agent_name,
|
|
174
|
+
type="node",
|
|
175
|
+
subgraph=None,
|
|
176
|
+
metadata=None,
|
|
177
|
+
)
|
|
277
178
|
)
|
|
278
|
-
)
|
|
279
179
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
target=agent_name,
|
|
285
|
-
label="input",
|
|
286
|
-
)
|
|
287
|
-
)
|
|
180
|
+
# Process tools - separate agent-tools from regular tools
|
|
181
|
+
tools = getattr(current_agent, "tools", None) or []
|
|
182
|
+
agent_tools: list[Agent] = []
|
|
183
|
+
regular_tools: list[Any] = []
|
|
288
184
|
|
|
289
|
-
# Add tool nodes if tools are available
|
|
290
|
-
tools = getattr(agent, "tools", None) or []
|
|
291
|
-
if tools:
|
|
292
185
|
for tool in tools:
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
186
|
+
if isinstance(tool, Agent):
|
|
187
|
+
agent_tools.append(tool)
|
|
188
|
+
else:
|
|
189
|
+
regular_tools.append(tool)
|
|
190
|
+
|
|
191
|
+
# Process agent-tools (agents used as tools)
|
|
192
|
+
for tool_agent in agent_tools:
|
|
193
|
+
tool_agent_name = getattr(tool_agent, "name", _get_tool_name(tool_agent))
|
|
194
|
+
if tool_agent_name and tool_agent_name not in visited:
|
|
195
|
+
# Recursively process agent-tool
|
|
196
|
+
_add_agent_and_tools(tool_agent)
|
|
197
|
+
|
|
198
|
+
# Add edges for agent-tool
|
|
199
|
+
edges.append(
|
|
200
|
+
UiPathRuntimeEdge(
|
|
201
|
+
source=agent_name,
|
|
202
|
+
target=tool_agent_name,
|
|
203
|
+
label="tool_call",
|
|
204
|
+
)
|
|
205
|
+
)
|
|
206
|
+
edges.append(
|
|
207
|
+
UiPathRuntimeEdge(
|
|
208
|
+
source=tool_agent_name,
|
|
209
|
+
target=agent_name,
|
|
210
|
+
label="tool_result",
|
|
211
|
+
)
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
# Process regular tools - aggregate into single tools node
|
|
215
|
+
if regular_tools:
|
|
216
|
+
tool_names = [_get_tool_name(tool) for tool in regular_tools]
|
|
217
|
+
tool_names = [name for name in tool_names if name] # Filter out None values
|
|
218
|
+
|
|
219
|
+
if tool_names:
|
|
220
|
+
# Create a single tools node for this agent
|
|
221
|
+
tools_node_id = f"{agent_name}_tools"
|
|
296
222
|
nodes.append(
|
|
297
223
|
UiPathRuntimeNode(
|
|
298
|
-
id=
|
|
299
|
-
name=
|
|
224
|
+
id=tools_node_id,
|
|
225
|
+
name="tools",
|
|
300
226
|
type="tool",
|
|
301
227
|
subgraph=None,
|
|
228
|
+
metadata={
|
|
229
|
+
"tool_names": tool_names,
|
|
230
|
+
"tool_count": len(tool_names),
|
|
231
|
+
},
|
|
302
232
|
)
|
|
303
233
|
)
|
|
304
|
-
|
|
234
|
+
|
|
235
|
+
# Add bidirectional edges for tools node
|
|
305
236
|
edges.append(
|
|
306
237
|
UiPathRuntimeEdge(
|
|
307
238
|
source=agent_name,
|
|
308
|
-
target=
|
|
309
|
-
label=
|
|
239
|
+
target=tools_node_id,
|
|
240
|
+
label=None,
|
|
310
241
|
)
|
|
311
242
|
)
|
|
312
243
|
edges.append(
|
|
313
244
|
UiPathRuntimeEdge(
|
|
314
|
-
source=
|
|
245
|
+
source=tools_node_id,
|
|
315
246
|
target=agent_name,
|
|
316
|
-
label=
|
|
247
|
+
label=None,
|
|
317
248
|
)
|
|
318
249
|
)
|
|
319
250
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
if handoffs:
|
|
251
|
+
# Process handoff agents
|
|
252
|
+
handoffs = getattr(current_agent, "handoffs", None) or []
|
|
323
253
|
for handoff_agent in handoffs:
|
|
324
254
|
handoff_name = getattr(handoff_agent, "name", None)
|
|
325
|
-
if handoff_name:
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
type="model",
|
|
331
|
-
subgraph=None, # Handoff agents are peers, not subgraphs
|
|
332
|
-
)
|
|
333
|
-
)
|
|
334
|
-
# Handoff edges
|
|
255
|
+
if handoff_name and handoff_name not in visited:
|
|
256
|
+
# Recursively process handoff agent
|
|
257
|
+
_add_agent_and_tools(handoff_agent)
|
|
258
|
+
|
|
259
|
+
# Add handoff edges without labels
|
|
335
260
|
edges.append(
|
|
336
261
|
UiPathRuntimeEdge(
|
|
337
262
|
source=agent_name,
|
|
338
263
|
target=handoff_name,
|
|
339
|
-
label=
|
|
264
|
+
label=None,
|
|
340
265
|
)
|
|
341
266
|
)
|
|
342
267
|
edges.append(
|
|
343
268
|
UiPathRuntimeEdge(
|
|
344
269
|
source=handoff_name,
|
|
345
270
|
target=agent_name,
|
|
346
|
-
label=
|
|
271
|
+
label=None,
|
|
347
272
|
)
|
|
348
273
|
)
|
|
349
274
|
|
|
350
|
-
#
|
|
275
|
+
# Add __start__ node
|
|
276
|
+
nodes.append(
|
|
277
|
+
UiPathRuntimeNode(
|
|
278
|
+
id="__start__",
|
|
279
|
+
name="__start__",
|
|
280
|
+
type="__start__",
|
|
281
|
+
subgraph=None,
|
|
282
|
+
metadata=None,
|
|
283
|
+
)
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
# Recursively build graph starting from main agent
|
|
287
|
+
_add_agent_and_tools(agent)
|
|
288
|
+
|
|
289
|
+
# Get the main agent name
|
|
290
|
+
agent_name = getattr(agent, "name", "agent")
|
|
291
|
+
|
|
292
|
+
# Add __end__ node
|
|
351
293
|
nodes.append(
|
|
352
294
|
UiPathRuntimeNode(
|
|
353
295
|
id="__end__",
|
|
354
296
|
name="__end__",
|
|
355
297
|
type="__end__",
|
|
356
298
|
subgraph=None,
|
|
299
|
+
metadata=None,
|
|
300
|
+
)
|
|
301
|
+
)
|
|
302
|
+
|
|
303
|
+
# Connect start to main agent
|
|
304
|
+
edges.append(
|
|
305
|
+
UiPathRuntimeEdge(
|
|
306
|
+
source="__start__",
|
|
307
|
+
target=agent_name,
|
|
308
|
+
label="input",
|
|
357
309
|
)
|
|
358
310
|
)
|
|
359
311
|
|
|
360
|
-
# Connect agent to end
|
|
312
|
+
# Connect main agent to end
|
|
361
313
|
edges.append(
|
|
362
314
|
UiPathRuntimeEdge(
|
|
363
315
|
source=agent_name,
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: uipath-openai-agents
|
|
3
|
+
Version: 0.0.3
|
|
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 Python SDK
|
|
23
|
+
|
|
24
|
+
[](https://pypi.org/project/uipath-openai-agents/)
|
|
25
|
+
[](https://pypi.org/project/uipath-openai-agents/)
|
|
26
|
+
[](https://pypi.org/project/uipath-openai-agents/)
|
|
27
|
+
|
|
28
|
+
A Python SDK that enables developers to build and deploy OpenAI Agents to the UiPath Cloud Platform. It provides programmatic interaction with UiPath Cloud Platform services.
|
|
29
|
+
|
|
30
|
+
This package is an extension to the [UiPath Python SDK](https://github.com/UiPath/uipath-python) and implements the [UiPath Runtime Protocol](https://github.com/UiPath/uipath-runtime-python).
|
|
31
|
+
|
|
32
|
+
Check out these [sample projects](https://github.com/UiPath/uipath-integrations-python/tree/main/packages/uipath-openai-agents/samples) to see the SDK in action.
|
|
33
|
+
|
|
34
|
+
## Requirements
|
|
35
|
+
|
|
36
|
+
- Python 3.11 or higher
|
|
37
|
+
- UiPath Automation Cloud account
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install uipath-openai-agents
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
using `uv`:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
uv add uipath-openai-agents
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Configuration
|
|
52
|
+
|
|
53
|
+
### Environment Variables
|
|
54
|
+
|
|
55
|
+
Create a `.env` file in your project root with the following variables:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
UIPATH_URL=https://cloud.uipath.com/ACCOUNT_NAME/TENANT_NAME
|
|
59
|
+
UIPATH_ACCESS_TOKEN=YOUR_TOKEN_HERE
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Command Line Interface (CLI)
|
|
63
|
+
|
|
64
|
+
The SDK provides a command-line interface for creating, packaging, and deploying OpenAI Agents:
|
|
65
|
+
|
|
66
|
+
### Authentication
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
uipath auth
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
This command opens a browser for authentication and creates/updates your `.env` file with the proper credentials.
|
|
73
|
+
|
|
74
|
+
### Initialize a Project
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
uipath init
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Running `uipath init` will process the agent definitions in the `openai_agents.json` file and create the corresponding `entry-points.json` file needed for deployment.
|
|
81
|
+
|
|
82
|
+
For more details on the configuration format, see the [UiPath configuration specifications](https://github.com/UiPath/uipath-python/blob/main/specs/README.md).
|
|
83
|
+
|
|
84
|
+
### Debug a Project
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
uipath run AGENT [INPUT]
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Executes the agent with the provided JSON input arguments.
|
|
91
|
+
|
|
92
|
+
### Package a Project
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
uipath pack
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Packages your project into a `.nupkg` file that can be deployed to UiPath.
|
|
99
|
+
|
|
100
|
+
**Note:** Your `pyproject.toml` must include:
|
|
101
|
+
|
|
102
|
+
- A description field (avoid characters: &, <, >, ", ', ;)
|
|
103
|
+
- Author information
|
|
104
|
+
|
|
105
|
+
Example:
|
|
106
|
+
|
|
107
|
+
```toml
|
|
108
|
+
description = "Your package description"
|
|
109
|
+
authors = [{name = "Your Name", email = "your.email@example.com"}]
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Publish a Package
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
uipath publish
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Publishes the most recently created package to your UiPath Orchestrator.
|
|
119
|
+
|
|
120
|
+
## Project Structure
|
|
121
|
+
|
|
122
|
+
To properly use the CLI for packaging and publishing, your project should include:
|
|
123
|
+
|
|
124
|
+
- A `pyproject.toml` file with project metadata
|
|
125
|
+
- A `openai_agents.json` file with your agent definitions (e.g., `"agents": {"agent": "main.py:agent"}`)
|
|
126
|
+
- A `entry-points.json` file (generated by `uipath init`)
|
|
127
|
+
- A `bindings.json` file (generated by `uipath init`) to configure resource overrides
|
|
128
|
+
- Any Python files needed for your automation
|
|
129
|
+
|
|
130
|
+
## Development
|
|
131
|
+
|
|
132
|
+
### Developer Tools
|
|
133
|
+
|
|
134
|
+
Check out [uipath-dev](https://github.com/uipath/uipath-dev-python) - an interactive terminal application for building, testing, and debugging UiPath Python runtimes, agents, and automation scripts.
|
|
135
|
+
|
|
136
|
+
### Setting Up a Development Environment
|
|
137
|
+
|
|
138
|
+
Please read our [contribution guidelines](https://github.com/UiPath/uipath-integrations-python/packages/uipath-openai-agents/blob/main/CONTRIBUTING.md) before submitting a pull request.
|
|
139
|
+
|
|
140
|
+
### Special Thanks
|
|
141
|
+
|
|
142
|
+
A huge thank-you to the open-source community and the maintainers of the libraries that make this project possible:
|
|
143
|
+
|
|
144
|
+
- [OpenAI](https://github.com/openai/openai-python) for providing a powerful framework for building AI agents.
|
|
145
|
+
- [OpenInference](https://github.com/Arize-ai/openinference) for observability and instrumentation support.
|
|
146
|
+
- [Pydantic](https://github.com/pydantic/pydantic) for reliable, typed configuration and validation.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
uipath_openai_agents/__init__.py,sha256=vCe5Vtfzg-19KYbm7vHVCH2fThuQPNvAPYez-7lZrrQ,794
|
|
2
|
+
uipath_openai_agents/middlewares.py,sha256=TMZAwdBh4gUMfgUZPhhxVDWf3pl-GBaeLlmCtipa-WM,299
|
|
3
|
+
uipath_openai_agents/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
+
uipath_openai_agents/_cli/__init__.py,sha256=juqd9PbXs4yg45zMJ7BHAOPQjb7sgEbWE9InBtGZhfo,24
|
|
5
|
+
uipath_openai_agents/_cli/cli_new.py,sha256=uWyxEh5CGKsKYbS9WQrp2cGTA90cGKUG_ijrV-Z71YQ,2794
|
|
6
|
+
uipath_openai_agents/_cli/_templates/AGENTS.md.template,sha256=9byz_03hXpD3EcUdXk9QgXjAKG-S-3z-sYGDWORBoic,1293
|
|
7
|
+
uipath_openai_agents/_cli/_templates/main.py.template,sha256=6YQ4PWMNt7ErVBMw28KGxcc87x040DmJYK5ztdzWcIM,1002
|
|
8
|
+
uipath_openai_agents/_cli/_templates/openai_agents.json.template,sha256=MH1nK-wZ-GMfFmCW5-pD8zUNFaEmlQUfZKiNXDqUgGM,51
|
|
9
|
+
uipath_openai_agents/chat/__init__.py,sha256=0snFcSmeuhI9F7IV4LZGfdJ265XMD2Wo8uq8tBbkmFI,855
|
|
10
|
+
uipath_openai_agents/chat/openai.py,sha256=KjbDKS_tUKYjuvjUYbouSsoJsOmzbtdHUzuDarDpFYM,8640
|
|
11
|
+
uipath_openai_agents/chat/supported_models.py,sha256=Y3DtpulywaKZ8_BIA1xxfStLPSoVsyzR2zufUJaHkrM,1837
|
|
12
|
+
uipath_openai_agents/runtime/__init__.py,sha256=lF58N6HDei6ntF34ke14hmvTSB-VE96TObLPNLem8oA,1916
|
|
13
|
+
uipath_openai_agents/runtime/_serialize.py,sha256=EyTy1I-BR1FxfsSDdju2AbxVEauHmmzeXbhxRDR-sn8,1594
|
|
14
|
+
uipath_openai_agents/runtime/agent.py,sha256=DxoT5SqeI0BEb3bVCs52e237muwtc9qt1Wr4SnNfUMo,6994
|
|
15
|
+
uipath_openai_agents/runtime/config.py,sha256=gtDCIMB1fcAry9Tj_xJSR1xVaARMNmrr5HmwSn4Nh-w,1808
|
|
16
|
+
uipath_openai_agents/runtime/errors.py,sha256=AgUmbikoM53O02CktbZAKVjVmK1ZCl9-EG0gWaYtrn0,1333
|
|
17
|
+
uipath_openai_agents/runtime/factory.py,sha256=rCw521lvUDGLtjrOYn2WwNQ05oxmWjuAxCmoJ_HTzkg,7595
|
|
18
|
+
uipath_openai_agents/runtime/runtime.py,sha256=NJIuIMKNaK3nraEZvYu_1Dkh1CZ0nfBfybEKVgNe090,11229
|
|
19
|
+
uipath_openai_agents/runtime/schema.py,sha256=yV5sDHamKKXKm6zUwPiHZTJofnut0lrzuEJY3YCF0cg,13793
|
|
20
|
+
uipath_openai_agents-0.0.3.dist-info/METADATA,sha256=rzfkDeZyHGv97Dbu4WPn5kDNKWZhYX5kTkM1EL1T27M,4938
|
|
21
|
+
uipath_openai_agents-0.0.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
22
|
+
uipath_openai_agents-0.0.3.dist-info/entry_points.txt,sha256=2tY1wvop4ulDwWMUXFZzOREIKyIf5cFYsefLWNA2-9w,183
|
|
23
|
+
uipath_openai_agents-0.0.3.dist-info/RECORD,,
|