Skip to content
Merged
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
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ All packages extend the [UiPath Python SDK](https://github.com/UiPath/uipath-pyt
| [LlamaIndex](https://www.llamaindex.ai/) | [![PyPI](https://img.shields.io/pypi/v/uipath-llamaindex)](https://pypi.org/project/uipath-llamaindex/) | [![Downloads](https://img.shields.io/pypi/dm/uipath-llamaindex.svg)](https://pypi.org/project/uipath-llamaindex/) | [README](packages/uipath-llamaindex/README.md) · [Docs](https://uipath.github.io/uipath-python/llamaindex/quick_start/) · [Samples](packages/uipath-llamaindex/samples/) |
| [Microsoft Agent Framework](https://github.com/microsoft/agent-framework) | [![PyPI](https://img.shields.io/pypi/v/uipath-agent-framework)](https://pypi.org/project/uipath-agent-framework/) | [![Downloads](https://img.shields.io/pypi/dm/uipath-agent-framework.svg)](https://pypi.org/project/uipath-agent-framework/) | [README](packages/uipath-agent-framework/README.md) · [Samples](packages/uipath-agent-framework/samples/) |
| [OpenAI Agents](https://github.com/openai/openai-agents-python) | [![PyPI](https://img.shields.io/pypi/v/uipath-openai-agents)](https://pypi.org/project/uipath-openai-agents/) | [![Downloads](https://img.shields.io/pypi/dm/uipath-openai-agents.svg)](https://pypi.org/project/uipath-openai-agents/) | [README](packages/uipath-openai-agents/README.md) · [Docs](https://uipath.github.io/uipath-python/openai-agents/quick_start/) · [Samples](packages/uipath-openai-agents/samples/) |
| [PydanticAI](https://github.com/pydantic/pydantic-ai) | [![PyPI](https://img.shields.io/pypi/v/uipath-pydantic-ai)](https://pypi.org/project/uipath-pydantic-ai/) | [![Downloads](https://img.shields.io/pypi/dm/uipath-pydantic-ai.svg)](https://pypi.org/project/uipath-pydantic-ai/) | [README](packages/uipath-pydantic-ai/README.md) · [Samples](packages/uipath-pydantic-ai/samples/) |


## Structure
Expand All @@ -25,7 +26,8 @@ uipath-integrations-python/
├── uipath-llamaindex/ # LlamaIndex runtime
├── uipath-openai-agents/ # OpenAI Agents runtime
├── uipath-google-adk/ # Google ADK runtime
└── uipath-agent-framework/ # Microsoft Agent Framework runtime
├── uipath-agent-framework/ # Microsoft Agent Framework runtime
└── uipath-pydantic-ai/ # PydanticAI runtime
```

## Development
Expand Down
2 changes: 1 addition & 1 deletion packages/uipath-pydantic-ai/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-pydantic-ai"
version = "0.0.1"
version = "0.0.2"
description = "Python SDK that enables developers to build and deploy PydanticAI agents to the UiPath Cloud Platform"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
2 changes: 1 addition & 1 deletion packages/uipath-pydantic-ai/samples/graph-flow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ flowchart TB
## Run

```
uipath run agent '{"messages": "Write a blog post about the future of AI agents"}'
uipath run agent '{"messages": [{"contentParts": [{"data": {"inline": "Write a blog post about the future of AI agents"}}], "role": "user"}]}'
```

## Debug
Expand Down
2 changes: 1 addition & 1 deletion packages/uipath-pydantic-ai/samples/multi-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ flowchart TB
## Run

```
uipath run agent '{"messages": "Write a report about machine learning"}'
uipath run agent '{"messages": [{"contentParts": [{"data": {"inline": "Write a report about machine learning"}}], "role": "user"}]}'
```

## Debug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ flowchart TB
## Run

```
uipath run agent '{"messages": "I was charged twice for my subscription last month"}'
uipath run agent '{"messages": [{"contentParts": [{"data": {"inline": "I was charged twice for my subscription last month"}}], "role": "user"}]}'
```

## Debug
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ flowchart TB
## Run

```
uipath run agent '{"messages": "What is the weather in San Francisco?"}'
uipath run agent '{"messages": [{"contentParts": [{"data": {"inline": "What is the weather in San Francisco?"}}], "role": "user"}]}'
```

## Debug

```
uipath dev web
uipath dev
```
4 changes: 2 additions & 2 deletions packages/uipath-pydantic-ai/samples/quickstart-agent/main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import httpx
from pydantic_ai import Agent
from pydantic_ai import Agent, RunContext

from uipath_pydantic_ai.chat import UiPathChatOpenAI


def get_weather(ctx, location: str) -> str:
def get_weather(ctx: RunContext[None], location: str) -> str:
"""Get the current weather for a location using the Open-Meteo API.

Args:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ requires-python = ">=3.11"
dependencies = [
"uipath",
"uipath-pydantic-ai",
"pydantic-ai>=0.1.0",
"pydantic-ai>=1.63.0",
]

[dependency-groups]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import httpx
from openai import AsyncOpenAI, OpenAI
from pydantic_ai.models.openai import OpenAIModel
from pydantic_ai.models.openai import OpenAIChatModel
from pydantic_ai.providers.openai import OpenAIProvider
from uipath._utils._ssl_context import get_httpx_client_kwargs
from uipath.utils import EndpointManager
Expand Down Expand Up @@ -74,7 +74,7 @@ class UiPathChatOpenAI:

This client wraps the OpenAI SDK and configures it to use UiPath's
LLM Gateway endpoints with proper authentication and headers.
Returns PydanticAI-compatible OpenAIModel instances.
Returns PydanticAI-compatible OpenAIChatModel instances.

Example:
```python
Expand Down Expand Up @@ -173,7 +173,7 @@ def __init__(
)

# Create PydanticAI-compatible model
self._model = OpenAIModel(
self._model = OpenAIChatModel(
self._model_name,
provider=OpenAIProvider(openai_client=self._async_client),
)
Expand Down Expand Up @@ -225,8 +225,8 @@ def _build_base_url(self) -> str:
raise ValueError("UIPATH_URL environment variable is required")

@property
def model(self) -> OpenAIModel:
"""Get the PydanticAI-compatible OpenAIModel."""
def model(self) -> OpenAIChatModel:
"""Get the PydanticAI-compatible OpenAIChatModel."""
return self._model

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def _setup_instrumentation(self) -> None:
self.context.trace_manager.add_span_processor(
OpenInferenceSpanProcessor()
)
Agent.instrument_all()
except Exception:
pass

Expand Down
Loading