Skip to content

Commit 18bff63

Browse files
committed
Minds docstrings
1 parent c8bffca commit 18bff63

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

minds/minds.py

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,23 @@ def update(
4646
datasources=None,
4747
parameters=None,
4848
):
49+
"""
50+
Update mind
51+
52+
If parameter is set it will be applied to mind
53+
54+
Datasource can be passed as
55+
- name, str
56+
- Datasource object (minds.datasources.Database)
57+
- datasource config (minds.datasources.DatabaseConfig), in this case datasource will be created
58+
59+
:param name: new name of the mind, optional
60+
:param model_name: new llm model name, optional
61+
:param provider: new llm provider, optional
62+
:param prompt_template: new prompt template, optional
63+
:param datasources: alter list of datasources used by mind, optional
64+
:param parameters, dict: alter other parameters of the mind, optional
65+
"""
4966
data = {}
5067

5168
if datasources is not None:
@@ -77,6 +94,15 @@ def update(
7794
self.name = name
7895

7996
def add_datasource(self, datasource: Datasource):
97+
"""
98+
Add datasource to mind
99+
Datasource can be passed as
100+
- name, str
101+
- Datasource object (minds.datasources.Database)
102+
- datasource config (minds.datasources.DatabaseConfig), in this case datasource will be created
103+
104+
:param datasource: input datasource
105+
"""
80106

81107
ds_name = self.client.minds._check_datasource(datasource)
82108

@@ -91,6 +117,15 @@ def add_datasource(self, datasource: Datasource):
91117
self.datasources = updated.datasources
92118

93119
def del_datasource(self, datasource: Union[Datasource, str]):
120+
"""
121+
Delete datasource from mind
122+
123+
Datasource can be passed as
124+
- name, str
125+
- Datasource object (minds.datasources.Database)
126+
127+
:param datasource: datasource to delete
128+
"""
94129
if isinstance(datasource, Datasource):
95130
datasource = datasource.name
96131
elif not isinstance(datasource, str):
@@ -199,6 +234,23 @@ def create(
199234
parameters=None,
200235
replace=False,
201236
) -> Mind:
237+
"""
238+
Create a new mind and return it
239+
240+
Datasource can be passed as
241+
- name, str
242+
- Datasource object (minds.datasources.Database)
243+
- datasource config (minds.datasources.DatabaseConfig), in this case datasource will be created
244+
245+
:param name: name of the mind
246+
:param model_name: llm model name, optional
247+
:param provider: llm provider, optional
248+
:param prompt_template: instructions to llm, optional
249+
:param datasources: list of datasources used by mind, optional
250+
:param parameters, dict: other parameters of the mind, optional
251+
:param replace: if true - to remove existing mind, default is false
252+
:return: created mind
253+
"""
202254

203255
if replace:
204256
try:

0 commit comments

Comments
 (0)