mirror of
https://github.com/bentoml/OpenLLM.git
synced 2026-03-04 23:26:16 -05:00
fix(client): include ability to getitem for sync client
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
@@ -46,6 +46,13 @@ class HTTPClient(Client):
|
||||
return {'Authorization': f'Bearer {env}'}
|
||||
return super()._build_auth_headers()
|
||||
|
||||
def __getitem__(self, item):
|
||||
if hasattr(self._metadata, item):
|
||||
return getattr(self._metadata, item)
|
||||
elif item in self._config:
|
||||
return self._config[item]
|
||||
raise KeyError(f'No attributes: {item}')
|
||||
|
||||
@property
|
||||
def _metadata(self):
|
||||
if self.__metadata is None:
|
||||
|
||||
Reference in New Issue
Block a user