refactor(entities): migrate entities consumers to typed EntitiesClient - #1494
Open
maxdubrinsky wants to merge 5 commits into
Open
refactor(entities): migrate entities consumers to typed EntitiesClient#1494maxdubrinsky wants to merge 5 commits into
maxdubrinsky wants to merge 5 commits into
Conversation
…ent compat layer Add 8 new typed HTTP clients in nemo_platform_plugin, following the proven files/models pattern (types.py + endpoints.py + client.py): - workspaces: WorkspacesClient (workspace + members CRUD) - guardrail: GuardrailClient (config CRUD + check) - projects: ProjectsClient (CRUD) - agents: AgentsClient (agent + deployment CRUD + invoke) - auditor: AuditorClient (config/target CRUD + submit + job list/get) - iron_swarm: IronSwarmClient (manifest CRUD + refresh + run CRUD + validate_model) - evaluator: EvaluatorClient (submit jobs + results + metrics CRUD) - data_designer: DataDesignerClient (preview stream + job CRUD) Add convenience properties to BaseNemoClient so sdk.files, sdk.models, sdk.workspaces, etc. each return the corresponding typed client via from_client(self). Add _InferenceNamespace compat shim dispatching sdk.inference.providers/deployments/virtual_models to the existing ModelsClient/VirtualModelsClient. Add NemoResponse.__getattr__ proxy delegating unknown attribute access to the parsed body, so callers use result.name instead of result.data().name (eliminates .data() unwrapping at ~980 call sites during consumer migration). Purely additive: no existing code changed, only additions. The Stainless SDK remains in place; this builds the landing pad for the per-area consumer migration PRs. AIRCORE-1058 Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>
Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>
…lient Add _client property (returns the underlying httpx transport) and default_headers property (returns the default headers dict) to BaseNemoClient. Plugin SDK resources (auditor, evaluator, anonymizer, data-designer, customizer, safe-synthesizer, insights) access platform._client and platform.default_headers to make raw HTTP calls. These properties let them work with NemoClient after the spine flip. AIRCORE-1058 Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>
Add __getattr__ to BaseNemoClient that mirrors NeMoPlatform's plugin SDK discovery: discovers plugin SDK resources via entry points (discover_sdk) and instantiates them with self as the platform. Handles sdk.auditor, sdk.evaluator, sdk.agents, sdk.iron_swarm, sdk.anonymizer, sdk.customizer, and any other plugin-level resource not covered by convenience properties. Combined with the _client property (previous commit), this lets plugin SDK resources work with NemoClient after the spine flip without any changes to the plugin code. AIRCORE-1058 Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>
maxdubrinsky
force-pushed
the
aircore-827-migrate-entities/mdubrinsky
branch
2 times, most recently
from
August 24, 2026 21:04
849334f to
25c6f0a
Compare
Migrate entities API call sites from sdk.entities.* (Stainless SDK) to client_from_platform(sdk, EntitiesClient).* (typed HTTP client), following the pattern established in #1277. Changes: - e2e/test_entities.py: create/get_entity_by_name/update_entity_by_name/ delete_entity_by_name -> create_entity/get_entity_by_name/ update_entity_by_name/delete_entity_by_name with EntityCreateInput/ EntityUpdate body models + .data() - nmp_testing/client.py: docstring example updated - 4 iron-swarm files: entities.create/get_entity_by_name/update_entity_by_name/ list -> create_entity/get_entity_by_name/update_entity_by_name/ list_entities with body models + .data() - services/core/entities/tests/integration/test_workspaces_crud_with_auth.py: entities.create -> create_entity with EntityCreateInput - 2 agentic-use test files: entities.list/get_entity_by_name -> list_entities/get_entity_by_name + .data() Skipped: - services/core/entities/e2e/test_e2e.py: uses sdk.v2.entities (entity_id-based v2 API, no typed client equivalent) - 3 controller files (agents, deployments, insights): already migrated to client_from_platform + AsyncEntitiesClient - 5 evaluator test files: self.entities is a local dict, not SDK calls - services/studio/tests/unit/test_assistant.py: self.entities is a local dict AIRCORE-827 Signed-off-by: Max Dubrinsky <mdubrinsky@nvidia.com>
maxdubrinsky
force-pushed
the
aircore-827-migrate-entities/mdubrinsky
branch
from
August 24, 2026 22:08
25c6f0a to
16ecccd
Compare
maxdubrinsky
marked this pull request as ready for review
August 24, 2026 22:21
maxdubrinsky
force-pushed
the
mdubrinsky/aircore-1058-add-typed-clients-for-remaining-service-areas-nemoclient
branch
from
August 25, 2026 16:35
2070a49 to
c8aeb8a
Compare
Base automatically changed from
mdubrinsky/aircore-1058-add-typed-clients-for-remaining-service-areas-nemoclient
to
main
August 25, 2026 20:56
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.
Summary
Migrate entities API call sites from
sdk.entities.*(Stainless SDK) toclient_from_platform(sdk, TypedClient).*(typed HTTP client), following the pattern established in #1277.Related Issue
AIRCORE-827
Type of Change
Quality Gates
Verification
Signed-off-by:traileruv run pre-commit run -apasses, or any blocked checks are identified below