From 61b75cbb78fb42bda501ffd65a99299d7230d19b Mon Sep 17 00:00:00 2001 From: Lucas Koontz Date: Fri, 7 Jun 2024 19:41:29 -0400 Subject: [PATCH] feat: update create_mind util function with new params --- mindsdb_sdk/__about__.py | 2 +- mindsdb_sdk/utils/mind.py | 26 +++++++++++++++----------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/mindsdb_sdk/__about__.py b/mindsdb_sdk/__about__.py index 2a6403a..5732b35 100755 --- a/mindsdb_sdk/__about__.py +++ b/mindsdb_sdk/__about__.py @@ -1,6 +1,6 @@ __title__ = 'mindsdb_sdk' __package_name__ = 'mindsdb_sdk' -__version__ = '2.4.0' +__version__ = '2.4.1' __description__ = "MindsDB Python SDK, provides an SDK to use a remote mindsdb instance" __email__ = "jorge@mindsdb.com" __author__ = 'MindsDB Inc' diff --git a/mindsdb_sdk/utils/mind.py b/mindsdb_sdk/utils/mind.py index d68b574..0c83b02 100644 --- a/mindsdb_sdk/utils/mind.py +++ b/mindsdb_sdk/utils/mind.py @@ -12,13 +12,15 @@ def __init__(self, name): # Create mind entity util function -def create( +def create_mind( base_url: str, api_key: str, - model: str, - connection_args: dict, - data_source: str, + + name: str, description: str, + model: str, + data_source_type: str, + data_source_connection_args: dict, ) -> Mind: """ Create a mind entity in LiteLLM proxy. @@ -26,10 +28,11 @@ def create( Args: base_url: MindsDB base URL api_key: MindsDB API key - model: Model name - connection_args: Connection arguments - data_source: Data source - description: Description + name: Mind name + description: Mind description + model: Model orchestrating the AI reasoning loop + data_source_type: Data source type + data_source_connection_args: Data source connection arguments Returns: Mind: Mind entity @@ -37,10 +40,11 @@ def create( url = f"{base_url}/minds" headers = {"Authorization": f"Bearer {api_key}"} payload = { + "name": name, + "description": description, "model": model, - "connection_args": connection_args, - "data_source": data_source, - "description": description + "data_source_type": data_source_type, + "data_source_connection_args": data_source_connection_args } response = requests.post(url, json=payload, headers=headers) response.raise_for_status()