Skip to content

feat: restore provider_data constructor kwarg#343

Merged
cdoern merged 1 commit intoogx-ai:mainfrom
cdoern:restore-provider-data
May 1, 2026
Merged

feat: restore provider_data constructor kwarg#343
cdoern merged 1 commit intoogx-ai:mainfrom
cdoern:restore-provider-data

Conversation

@cdoern
Copy link
Copy Markdown
Collaborator

@cdoern cdoern commented May 1, 2026

Summary

Adds back the provider_data: Mapping[str, Any] | None kwarg on OgxClient and AsyncOgxClient that was present in the previous llama-stack-client SDK but lost during the rename to ogx-client. When provided, it is JSON-serialized and merged into default_headers under X-OGX-Provider-Data — the header the OGX server reads to thread per-request provider credentials through.

Why

Without this kwarg, every caller upgrading from llama-stack-client has to construct the header themselves on every client instantiation:

OgxClient(
    base_url=...,
    default_headers={"X-OGX-Provider-Data": json.dumps(get_provider_data())},
)

That breaks a large surface of OGX integration tests and downstream code on upgrade. Restoring the affordance keeps the migration to ogx-client source-compatible for the constructor signature.

Behavior matches the old SDK

The previous implementation in llama-stack-client v0.7.2-alpha.3 was:

custom_headers = default_headers or {}
if provider_data is not None:
    custom_headers["X-LlamaStack-Provider-Data"] = json.dumps(provider_data)

This PR mirrors that, with the only intentional difference being the header name (X-OGX-Provider-Data, matching the renamed server).

Test plan

  • OgxClient(base_url=..., provider_data={"k": "v"}) accepts the kwarg
  • client.default_headers["X-OGX-Provider-Data"] contains {"k": "v"} JSON-encoded
  • Same for AsyncOgxClient

Adds back the provider_data Mapping[str, Any] kwarg on OgxClient and
AsyncOgxClient that was present in the previous llama-stack-client
SDK but lost during the rename to ogx-client. When provided, it is
serialized as JSON and merged into default_headers under
X-OGX-Provider-Data, matching the header the OGX server reads.

Without this, callers had to construct the header themselves on every
client instantiation, which broke a large surface of OGX integration
tests and downstream code on upgrade from llama-stack-client.

Signed-off-by: Charlie Doern <cdoern@redhat.com>
@cdoern cdoern force-pushed the restore-provider-data branch from 29ffba9 to 56130fc Compare May 1, 2026 18:46
@cdoern cdoern merged commit 81516c6 into ogx-ai:main May 1, 2026
53 checks passed
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