You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: make AsyncOgxClient functional by inheriting from sync ApiClient
The AsyncOgxClient was completely broken because AsyncApiClient was a
standalone class missing 15+ methods (select_header_accept,
param_serialize, call_api, response_deserialize, etc.) that the
generated API classes depend on. Any call through AsyncOgxClient would
immediately crash with AttributeError. Additionally, all API methods
were synchronous — they could not be awaited.
Root causes:
- AsyncApiClient reimplemented only HTTP transport but omitted all
serialization, deserialization, and parameter handling methods
- Generated API classes (e.g. InspectApi) were shared between sync
and async clients but only had sync method signatures
- Nested API wiring (e.g. client.chat.completions) was only applied
to OgxClient, not AsyncOgxClient
Fix AsyncApiClient by making it inherit from ApiClient, overriding
only __init__ (creates httpx.AsyncClient), call_api (async HTTP
transport), close (async cleanup), and context managers. All
serialization and deserialization methods are inherited unchanged.
Generate proper async API subclasses (e.g. AsyncInspectApi) in the
same file as their sync counterparts via the api.mustache template.
These inherit the _serialize methods and override the three operation
method variants to use async def with await on call_api and aread.
Update AsyncOgxClient to wire Async*Api classes instead of sync ones,
and fix patch_hierarchy.py to apply nested API wiring to both
OgxClient and AsyncOgxClient.
Add RESTResponse.aread() for async response body reading, and update
all export templates to include the new Async*Api classes.
# Child API attributes (set by AsyncOgxClient based on x-nesting-path)
361
+
{{#operation}}{{#vendorExtensions.x-nesting-path}}{{#-first}}{{#tags}}{{#-first}}{{#vendorExtensions.x-nesting-path}}{{^-last}} self.{{.}}: Any | None = None # Next in nesting path
0 commit comments