Skip to content

Commit 647fced

Browse files
committed
minds docstrings
1 parent 75e1121 commit 647fced

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

minds/minds.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ def completion(self, message: str, stream: bool = False) -> Union[str, Iterable[
126126
stream=stream
127127
)
128128
if stream:
129-
return self.stream_response(response)
129+
return self._stream_response(response)
130130
else:
131131
return response.choices[0].message.content
132132

133-
def stream_response(self, response):
133+
def _stream_response(self, response):
134134
for chunk in response:
135135
yield chunk.choices[0].delta
136136

@@ -143,13 +143,26 @@ def __init__(self, client):
143143
self.project = 'mindsdb'
144144

145145
def list(self) -> List[Mind]:
146+
"""
147+
Returns list of minds
148+
149+
:return: iterable
150+
"""
151+
146152
data = self.api.get(f'/projects/{self.project}/minds').json()
147153
minds_list = []
148154
for item in data:
149155
minds_list.append(Mind(self.client, **item))
150156
return minds_list
151157

152158
def get(self, name: str) -> Mind:
159+
"""
160+
Get mind by name
161+
162+
:param name: name of the mind
163+
:return: a mind object
164+
"""
165+
153166
item = self.api.get(f'/projects/{self.project}/minds/{name}').json()
154167
return Mind(self.client, **item)
155168

@@ -211,4 +224,10 @@ def create(
211224
return mind
212225

213226
def drop(self, name: str):
227+
"""
228+
Drop mind by name
229+
230+
:param name: name of the mind
231+
"""
232+
214233
self.api.delete(f'/projects/{self.project}/minds/{name}')

0 commit comments

Comments
 (0)