Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

BUG-380: Use user API key to list models when provided #397

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Use user API key to list models when provided
  • Loading branch information
thiago-aixplain committed Feb 10, 2025
commit e5ed7c60564129c98b135d1fe6bf105411491d06
4 changes: 2 additions & 2 deletions aixplain/factories/model_factory/utils.py
Original file line number Diff line number Diff line change
@@ -167,8 +167,8 @@ def get_model_from_ids(model_ids: List[str], api_key: Optional[str] = None) -> L
resp = None
try:
url = urljoin(config.BACKEND_URL, f"sdk/models?ids={','.join(model_ids)}")

headers = {"Authorization": f"Token {config.TEAM_API_KEY}", "Content-Type": "application/json"}
api_key = config.TEAM_API_KEY if api_key is None else api_key
headers = {"Authorization": f"Token {api_key}", "Content-Type": "application/json"}
logging.info(f"Start service for GET Model - {url} - {headers}")
r = _request_with_retry("get", url, headers=headers)
resp = r.json()