Skip to content

Commit

Permalink
Merge branch 'master' into refactor/SK-1194
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminastrand committed Nov 26, 2024
2 parents e407967 + 9d3431d commit cd15cc3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fedn/network/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,13 @@ def start_session(
:return: A dict with success or failure message and session config.
:rtype: dict
"""
if model_id is None:
response = requests.get(self._get_url_api_v1("models/active"), verify=self.verify, headers=self.headers)
if response.status_code == 200:
model_id = response.json()
else:
return response.json()

response = requests.post(
self._get_url_api_v1("sessions"),
json={
Expand All @@ -638,6 +645,9 @@ def start_session(
headers=self.headers,
)

if id is None:
id = response.json()["session_id"]

if response.status_code == 201:
response = requests.post(
self._get_url_api_v1("sessions/start"),
Expand Down

0 comments on commit cd15cc3

Please sign in to comment.