Repository navigation
feat(agenthub): [2/5] opt into retired models on LLM model discovery [PC-5211] #1942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
aaf39b3
feat(agenthub): opt into retired models on LLM model discovery
tudormatei1 6e7a771
chore(uipath): lock the editable uipath-platform at 0.2.37
tudormatei1 32e7f52
docs(uipath): list include_deprecated_models in the SDK reference
tudormatei1 dd300db
chore(agenthub): keep the discovery docstrings as they were on main
tudormatei1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
74 changes: 74 additions & 0 deletions
74
packages/uipath-platform/tests/services/test_agenthub_service.py
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| import pytest | ||
| from pytest_httpx import HTTPXMock | ||
|
|
||
| from uipath.platform import UiPathApiConfig, UiPathExecutionContext | ||
| from uipath.platform.agenthub._agenthub_service import AgentHubService | ||
| from uipath.platform.orchestrator._folder_service import FolderService | ||
|
|
||
| RETIRED_MODEL = { | ||
| "modelName": "gpt-4o-2024-05-13", | ||
| "vendor": "OpenAi", | ||
| "effectiveModel": "gpt-5.1-2025-11-13", | ||
| "isDeprecated": True, | ||
| "deprecationDetails": { | ||
| "usageEndDate": "2026-09-30", | ||
| "replacedBy": "gpt-5.1-2025-11-13", | ||
| }, | ||
| } | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def service( | ||
| config: UiPathApiConfig, execution_context: UiPathExecutionContext | ||
| ) -> AgentHubService: | ||
| return AgentHubService( | ||
| config=config, | ||
| execution_context=execution_context, | ||
| folder_service=FolderService( | ||
| config=config, execution_context=execution_context | ||
| ), | ||
| ) | ||
|
|
||
|
|
||
| @pytest.fixture | ||
| def discovery_url(base_url: str, org: str, tenant: str) -> str: | ||
| return f"{base_url}{org}{tenant}/agenthub_/llm/api/discovery" | ||
|
|
||
|
|
||
| class TestGetAvailableLlmModels: | ||
| def test_does_not_request_deprecated_models_by_default( | ||
| self, httpx_mock: HTTPXMock, service: AgentHubService, discovery_url: str | ||
| ) -> None: | ||
| httpx_mock.add_response(url=discovery_url, json=[]) | ||
|
|
||
| service.get_available_llm_models() | ||
|
|
||
| request = httpx_mock.get_request() | ||
| assert request is not None | ||
| assert "includeDeprecatedModels" not in request.url.params | ||
|
|
||
| def test_requests_deprecated_models_when_asked( | ||
| self, httpx_mock: HTTPXMock, service: AgentHubService, discovery_url: str | ||
| ) -> None: | ||
| httpx_mock.add_response( | ||
| url=f"{discovery_url}?includeDeprecatedModels=true", | ||
| json=[RETIRED_MODEL], | ||
| ) | ||
|
|
||
| models = service.get_available_llm_models(include_deprecated_models=True) | ||
|
|
||
| assert [m.model_dump(by_alias=True) for m in models] == [RETIRED_MODEL] | ||
|
|
||
| async def test_async_requests_deprecated_models_when_asked( | ||
| self, httpx_mock: HTTPXMock, service: AgentHubService, discovery_url: str | ||
| ) -> None: | ||
| httpx_mock.add_response( | ||
| url=f"{discovery_url}?includeDeprecatedModels=true", | ||
| json=[RETIRED_MODEL], | ||
| ) | ||
|
|
||
| models = await service.get_available_llm_models_async( | ||
| include_deprecated_models=True | ||
| ) | ||
|
|
||
| assert [m.model_dump(by_alias=True) for m in models] == [RETIRED_MODEL] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.