Skip to content

Commit

Permalink
fix(client): include ability to getitem for sync client
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron <[email protected]>
  • Loading branch information
aarnphm committed Nov 26, 2023
1 parent 739eff3 commit 7bb53a7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions openllm-client/src/openllm_client/_http.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ def _build_auth_headers(self) -> t.Dict[str, str]:
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:
Expand Down

0 comments on commit 7bb53a7

Please sign in to comment.