Skip to content

feat(client): add listLLMProviders() — closes provider-listing parity gap#145

Merged
saurabhjain1592 merged 1 commit into
mainfrom
feature/qf-sdk-parity
Apr 28, 2026
Merged

feat(client): add listLLMProviders() — closes provider-listing parity gap#145
saurabhjain1592 merged 1 commit into
mainfrom
feature/qf-sdk-parity

Conversation

@saurabhjain1592

Copy link
Copy Markdown
Member

Summary

Adds `listLLMProviders()` to the Java SDK (with optional `type` and `enabled` filters and an async variant), closing the parity gap with the Python SDK's `list_providers()`, the Go SDK's `ListProviders()`, and the TypeScript SDK's `listProviders()`. Caught by the Phase 1 quality-freeze sweep.

What changed

  • New types in `com.getaxonflow.sdk.types`: `LLMProvider`, `LLMProviderHealth` (Jackson-bound to the platform's wire shape with `@JsonIgnoreProperties(ignoreUnknown = true)`)
  • Three new methods on `AxonFlow`:
    • `List listLLMProviders()` — no filters
    • `List listLLMProviders(String type, Boolean enabled)` — pass null for either to skip
    • `CompletableFuture<List> listLLMProvidersAsync()` — async variant
  • 4 unit tests in `AxonFlowTest` covering: dict shape with health, type filter passes query, enabled filter passes query, async variant

Test plan

  • `mvn test -Dtest='AxonFlowTest#listLLMProviders*'` — 4/4 pass
  • `mvn compile` clean
  • Pre-existing `AxonFlowIntegrationTest.generatePlanShouldReturnPlan` failure observed locally is unrelated (a 404 from generatePlan against the local stack); not caused by these additions

@saurabhjain1592 saurabhjain1592 merged commit 27efb3e into main Apr 28, 2026
12 checks passed
saurabhjain1592 added a commit that referenced this pull request Apr 28, 2026
…nation, encoding (#148)

* fix(client): close review gaps on listLLMProviders — full shape, pagination, encoding

Six review-driven fixes on the just-shipped listLLMProviders (PR #145):

1. Wire-shape: LLMProvider was silently dropping endpoint, model, region,
   rate_limit, timeout_seconds, and settings — every provider config the
   SDK couldn't introspect. Surfaced all six fields. enabled/priority/
   weight/hasApiKey are now boxed (Boolean/Integer) so a missing JSON
   value is distinguishable from explicit false/0.

2. Pagination: GET /api/v1/llm-providers is paginated (server cap 100,
   default 20). The 2-arg listLLMProviders ignored that and would silently
   truncate results in any deployment with >20 providers. Added:
   - listLLMProviders(type, enabled, page, pageSize) — single page
   - listLLMProvidersPaged(...) — single page + LLMProviderListResponse
     (with PaginationMeta)
   - listAllLLMProviders(type, enabled[, pageSize]) — walks every page

3. URL encoding: query string is now built with HttpUrl.Builder instead
   of manual StringBuilder concat. Reserved chars in `type` filter
   (e.g. "&") are now properly URL-encoded.

4. Duplicate @JsonProperty: removed the redundant annotation on
   LLMProviderHealth.getLastChecked() — the constructor parameter
   annotation is sufficient.

5. Boxed booleans: LLMProvider.getEnabled() / getHasApiKey() return
   Boolean (nullable) so callers can distinguish "explicitly false"
   from "field omitted by older platform". Convenience isEnabled() /
   hasApiKey() return primitive boolean (false on null).

6. New types: LLMProviderListResponse, PaginationMeta in types/ package.

7 new regression tests in AxonFlowTest cover: full-shape round-trip,
pagination metadata, multi-page walk, combined filters (type+enabled),
URL encoding for reserved chars, null health field, omitted-enabled
boxed-Boolean behaviour. 163 total tests pass.

* chore(wire-shape): refresh baseline for new LLMProvider/PaginationMeta fields
@saurabhjain1592 saurabhjain1592 deleted the feature/qf-sdk-parity branch May 12, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant