Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added samples/openai-sdk-agent/.DS_Store
Binary file not shown.
560 changes: 560 additions & 0 deletions samples/openai-sdk-agent/.agent/CLI_REFERENCE.md

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions samples/openai-sdk-agent/.agent/REQUIRED_STRUCTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
## Required Agent Structure

**IMPORTANT**: All UiPath coded agents MUST follow this standard structure unless explicitly specified otherwise by the user.

### Required Components

Every agent implementation MUST include these two Pydantic models:

```python
from pydantic import BaseModel

class Input(BaseModel):
"""Define input fields that the agent accepts"""
# Add your input fields here
pass

class Output(BaseModel):
"""Define output fields that the agent returns"""
# Add your output fields here
pass
```

### SDK Initialization

```python
from uipath.platform import UiPath

# Initialize with environment variables
uipath = UiPath()

# With explicit credentials
uipath = UiPath(base_url="https://cloud.uipath.com/...", secret="your_token")

# Or with client_id and client_secret
uipath = UiPath(
client_id=UIPATH_CLIENT_ID,
client_secret=UIPATH_CLIENT_SECRET,
scope=UIPATH_SCOPE,
base_url=UIPATH_URL
)
```

### Standard Agent Template

Every agent should follow this basic structure:

```python
from uipath.platform import UiPath
from pydantic import BaseModel

# 1. Define Input, and Output models
class Input(BaseModel):
field: str

class Output(BaseModel):
result: str

# 2. Initialize with environment variables
uipath = UiPath()

# 3. Define the main function (the main function can be named "main", "run" or "execute")
def main(input_data: Input) -> Output:
pass
```
637 changes: 637 additions & 0 deletions samples/openai-sdk-agent/.agent/SDK_REFERENCE.md

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions samples/openai-sdk-agent/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Agent Code Patterns Reference

This document provides practical code patterns for building UiPath coded agents using the UiPath Python SDK.

---

## Documentation Structure

This documentation is split into multiple files for efficient context loading. Load only the files you need:

1. **@.agent/REQUIRED_STRUCTURE.md** - Agent structure patterns and templates
- **When to load:** Creating a new agent or understanding required patterns
- **Contains:** Required Pydantic models (Input, Output), SDK initialization patterns, standard agent template

2. **@.agent/SDK_REFERENCE.md** - Complete SDK API reference
- **When to load:** Calling UiPath SDK methods, working with services (actions, assets, jobs, etc.)
- **Contains:** All SDK services and methods with full signatures and type annotations

3. **@.agent/CLI_REFERENCE.md** - CLI commands documentation
- **When to load:** Working with `uipath init`, `uipath run`, or `uipath eval` commands
- **Contains:** Command syntax, options, usage examples, and workflows
1 change: 1 addition & 0 deletions samples/openai-sdk-agent/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
Empty file.
4 changes: 4 additions & 0 deletions samples/openai-sdk-agent/bindings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"version": "2.0",
"resources": []
}
15 changes: 15 additions & 0 deletions samples/openai-sdk-agent/entry-points.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://cloud.uipath.com/draft/2024-12/entry-point",
"$id": "entry-points.json",
"entryPoints": [
{
"filePath": "main",
"uniqueId": "3b556e17-b54b-4b5f-b734-0ebee4fa3f82",
"type": "agent",
"input": {},
"output": {
"type": "object"
}
}
]
}
3 changes: 3 additions & 0 deletions samples/openai-sdk-agent/input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"query": "Show me all jobs"
}
Loading