Skip to content

Commit 5e6b355

Browse files
added the methods to call APIs for configs
1 parent 2713662 commit 5e6b355

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

mindsdb_sdk/connectors/rest_api.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,3 +468,24 @@ def knowledge_base_completion(self, project: str, knowledge_base_name, payload):
468468
)
469469
_raise_for_status(r)
470470
return r.json()
471+
472+
def get_config(self):
473+
"""
474+
Get MindsDB configuration.
475+
476+
:return: Dictionary containing MindsDB configuration.
477+
"""
478+
url = self.url + '/api/config'
479+
r = self.session.get(url)
480+
_raise_for_status(r)
481+
return r.json()
482+
483+
def update_config(self, config: dict):
484+
"""
485+
Update MindsDB configuration with the provided settings.
486+
487+
:param config: Dictionary containing configuration settings.
488+
"""
489+
url = self.url + '/api/config'
490+
r = self.session.put(url, json=config)
491+
_raise_for_status(r)

0 commit comments

Comments
 (0)