Conversation
There was a problem hiding this comment.
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
EndpointManagerto detect and cache AgentHub availability and choose the correct endpoint paths. - Refactor
UiPathOpenAIServiceand related methods to useEndpointManagerfor embeddings and chat completions. - Remove old
*_usagemethods 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_realmethod 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_realmethod 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()) |
There was a problem hiding this comment.
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()) |
f2e890c to
9fedeab
Compare
edis-uipath
approved these changes
Jul 7, 2025
radu-mocanu
approved these changes
Jul 7, 2025
7f04639 to
23e0ed7
Compare
23e0ed7 to
8434bee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add agenthub llm endpoint
Development Package