Skip to content
Closed
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath"
version = "2.5.11"
version = "2.5.12"
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
2 changes: 2 additions & 0 deletions src/uipath/platform/chat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from ._llm_gateway_service import (
ChatModels,
EmbeddingModels,
LlmDiscoveryService,
UiPathLlmChatService,
UiPathOpenAIService,
)
Expand Down Expand Up @@ -38,6 +39,7 @@
# LLM Gateway Services
"ChatModels",
"EmbeddingModels",
"LlmDiscoveryService",
"UiPathLlmChatService",
"UiPathOpenAIService",
# LLM Throttling
Expand Down
28 changes: 28 additions & 0 deletions src/uipath/platform/chat/_llm_gateway_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
offering both OpenAI-compatible and normalized API interfaces for chat completions and embeddings.

The module includes:
- LlmDiscoveryService: Service for discovering available LLM models
- UiPathOpenAIService: OpenAI-compatible API for chat completions and embeddings
- UiPathLlmChatService: UiPath's normalized API with advanced features like tool calling
- ChatModels: Constants for available chat models
Expand All @@ -12,6 +13,7 @@
Classes:
ChatModels: Container for supported chat model identifiers
EmbeddingModels: Container for supported embedding model identifiers
LlmDiscoveryService: Service for discovering available LLM models
UiPathOpenAIService: Service using OpenAI-compatible API format
UiPathLlmChatService: Service using UiPath's normalized API format
"""
Expand Down Expand Up @@ -47,6 +49,32 @@
}


class LlmDiscoveryService(BaseService):
"""Service for discovering available LLM models from the LLM Gateway."""

def __init__(
self, config: UiPathApiConfig, execution_context: UiPathExecutionContext
) -> None:
"""Initialize the LLM discovery service."""
super().__init__(config=config, execution_context=execution_context)

def get_available_models(self, agenthub_config: str) -> list[dict[str, Any]]:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@radu-mocanu maybe we should make AgentHub service a first-level service? reference #1151

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, good idea

"""Fetch available models from LLM Gateway discovery endpoint.

Args:
agenthub_config: The AgentHub configuration identifier

Returns:
List of available models and their configurations.
"""
response = self.request(
"GET",
url=Endpoint("/agenthub_/llm/api/discovery"),
headers={"X-UiPath-AgentHub-Config": agenthub_config},
)
return response.json()


class ChatModels(object):
"""Available chat models for LLM Gateway services.

Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.