Skip to content

Commit ec5ba82

Browse files
removed uses of projects/<project_name> in base URL
1 parent 31c305e commit ec5ba82

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

minds/minds.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ def __init__(
2121
):
2222
self.api = client.api
2323
self.client = client
24-
self.project = 'mindsdb'
2524

2625
self.name = name
2726
self.model_name = model_name
@@ -116,7 +115,7 @@ def update(
116115
data['parameters']['prompt_template'] = prompt_template
117116

118117
self.api.patch(
119-
f'/projects/{self.project}/minds/{self.name}',
118+
f'/minds/{self.name}',
120119
data=data
121120
)
122121

@@ -252,16 +251,14 @@ def __init__(self, client):
252251
self.api = client.api
253252
self.client = client
254253

255-
self.project = 'mindsdb'
256-
257254
def list(self) -> List[Mind]:
258255
"""
259256
Returns list of minds
260257
261258
:return: iterable
262259
"""
263260

264-
data = self.api.get(f'/projects/{self.project}/minds').json()
261+
data = self.api.get(f'/minds').json()
265262
minds_list = []
266263
for item in data:
267264
minds_list.append(Mind(self.client, **item))
@@ -275,7 +272,7 @@ def get(self, name: str) -> Mind:
275272
:return: a mind object
276273
"""
277274

278-
item = self.api.get(f'/projects/{self.project}/minds/{name}').json()
275+
item = self.api.get(f'/minds/{name}').json()
279276
return Mind(self.client, **item)
280277

281278
def _check_datasource(self, ds) -> dict:
@@ -383,10 +380,10 @@ def create(
383380

384381
if update:
385382
method = self.api.put
386-
url = f'/projects/{self.project}/minds/{name}'
383+
url = f'/minds/{name}'
387384
else:
388385
method = self.api.post
389-
url = f'/projects/{self.project}/minds'
386+
url = f'/minds'
390387

391388
method(
392389
url,
@@ -410,4 +407,4 @@ def drop(self, name: str):
410407
:param name: name of the mind
411408
"""
412409

413-
self.api.delete(f'/projects/{self.project}/minds/{name}')
410+
self.api.delete(f'/minds/{name}')

0 commit comments

Comments
 (0)