Skip to content

Commit

Permalink
Merge branch 'staging' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-koontz committed Jun 7, 2024
2 parents 338f218 + 61b75cb commit c536ff7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion mindsdb_sdk/__about__.py
Original file line number Diff line number Diff line change
@@ -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__ = "[email protected]"
__author__ = 'MindsDB Inc'
Expand Down
26 changes: 15 additions & 11 deletions mindsdb_sdk/utils/mind.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,39 @@ 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.
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
"""
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()
Expand Down

0 comments on commit c536ff7

Please sign in to comment.