Skip to content

Commit 764860f

Browse files
committed
fix(client-sdks): add api_key attribute to OgxClient for stainless SDK compatibility
Langchain and langgraph integrations access client.api_key to configure themselves. The stainless SDK OgxClient had this as a class attribute. Add api_key as an optional constructor parameter to both OgxClient and AsyncOgxClient templates, stored as an instance attribute for compatibility. Signed-off-by: E Geiger <egeiger@redhat.com>
1 parent cad56ef commit 764860f

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

client-sdks/openapi/templates/python/ogx_client.mustache

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class OgxClient:
4343
cookie: str | None = None,
4444
default_headers: Mapping[str, str] | None = None,
4545
provider_data: Mapping[str, Any] | None = None,
46+
api_key: str | None = None,
4647
**kwargs,
4748
) -> None:
4849
"""
@@ -54,7 +55,10 @@ class OgxClient:
5455
header_name: Optional header name for authentication.
5556
header_value: Optional header value for authentication.
5657
cookie: Optional cookie string for authentication.
58+
api_key: Optional API key (stored for compatibility with stainless SDK consumers).
5759
"""
60+
self.api_key = api_key
61+
5862
# Handle string URL as configuration
5963
if isinstance(configuration, str):
6064
configuration = Configuration(host=configuration)
@@ -136,6 +140,7 @@ class AsyncOgxClient:
136140
header_name: str | None = None,
137141
header_value: str | None = None,
138142
cookie: str | None = None,
143+
api_key: str | None = None,
139144
**kwargs,
140145
) -> None:
141146
"""
@@ -147,7 +152,10 @@ class AsyncOgxClient:
147152
header_name: Optional header name for authentication.
148153
header_value: Optional header value for authentication.
149154
cookie: Optional cookie string for authentication.
155+
api_key: Optional API key (stored for compatibility with stainless SDK consumers).
150156
"""
157+
self.api_key = api_key
158+
151159
# Handle string URL as configuration
152160
if isinstance(configuration, str):
153161
configuration = Configuration(host=configuration)

0 commit comments

Comments
 (0)