Skip to content

feat(agenthub): add agenthub llm#434

Merged
ionmincu merged 1 commit intomainfrom
feature/add_agent_hub_llm
Jul 7, 2025
Merged

feat(agenthub): add agenthub llm#434
ionmincu merged 1 commit intomainfrom
feature/add_agent_hub_llm

Conversation

@ionmincu
Copy link
Copy Markdown
Contributor

@ionmincu ionmincu commented Jul 4, 2025

Description

Add agenthub llm endpoint

Development Package

  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath==2.0.75.dev1004340540",

  # Any version from PR
  "uipath>=2.0.75.dev1004340000,<2.0.75.dev1004350000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath = { index = "testpypi" }

@ionmincu ionmincu self-assigned this Jul 4, 2025
@ionmincu ionmincu added the build:dev Create a dev build from the pr label Jul 4, 2025
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces an AgentHub-capable LLM endpoint by adding an EndpointManager that routes calls based on AgentHub availability, refactors existing LLM service methods to use the new manager, and removes legacy usage-only methods and their tests.

  • Add EndpointManager to detect and cache AgentHub availability and choose the correct endpoint paths.
  • Refactor UiPathOpenAIService and related methods to use EndpointManager for embeddings and chat completions.
  • Remove old *_usage methods and corresponding integration tests.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
tests/sdk/services/test_llm_integration.py Removed legacy embeddings_usage and chat_completions_usage tests.
src/uipath/_utils/_endpoints_manager.py Added EndpointManager with AgentHub detection and endpoint getters.
src/uipath/_utils/init.py Exported EndpointManager in module exports.
src/uipath/_services/llm_gateway_service.py Refactored embeddings and chat completion methods to use EndpointManager; removed old usage methods.
Comments suppressed due to low confidence (2)

tests/sdk/services/test_llm_integration.py:77

  • Removing the test_embeddings_usage_real method eliminates coverage for the embeddings usage endpoint. Consider adding or updating tests for the new AgentHub-based embeddings usage workflow.
    @pytest.mark.asyncio

tests/sdk/services/test_llm_integration.py:104

  • The test_chat_completions_usage_real method was removed, leaving no validation for chat completions usage. Please add or revise tests to cover the updated usage metrics endpoint.
    @pytest.mark.asyncio

)

return UsageInfo.model_validate(response.json())
return ChatCompletion.model_validate(response.json())
Copy link

Copilot AI Jul 4, 2025

Choose a reason for hiding this comment

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

The chat_completions_usage method is returning ChatCompletion instead of usage information. It should return a usage-specific model (e.g., UsageInfo.model_validate) or rename the method accordingly.

Suggested change
return ChatCompletion.model_validate(response.json())
return UsageInfo.model_validate(response.json())

Copilot uses AI. Check for mistakes.
Comment thread src/uipath/_utils/_endpoints_manager.py Outdated
Comment thread src/uipath/_utils/_endpoints_manager.py
@ionmincu ionmincu force-pushed the feature/add_agent_hub_llm branch 14 times, most recently from f2e890c to 9fedeab Compare July 7, 2025 11:43
@ionmincu ionmincu force-pushed the feature/add_agent_hub_llm branch 3 times, most recently from 7f04639 to 23e0ed7 Compare July 7, 2025 12:34
@ionmincu ionmincu force-pushed the feature/add_agent_hub_llm branch from 23e0ed7 to 8434bee Compare July 7, 2025 14:44
@ionmincu ionmincu merged commit 709d5ea into main Jul 7, 2025
16 checks passed
@ionmincu ionmincu deleted the feature/add_agent_hub_llm branch July 7, 2025 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build:dev Create a dev build from the pr

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants