Skip to content

Commit 2c78c02

Browse files
author
parthiv11
committed
update rest
1 parent ec289e8 commit 2c78c02

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

mindsdb_sdk/connectors/rest_api.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -479,26 +479,23 @@ def get_chatbot(self, project: str, chatbot_name: str):
479479
return r.json()
480480

481481
@_try_relogin
482-
def create_chatbot(self, project: str, chatbot_name: str, params: dict):
482+
def create_chatbot(self, project: str, data: dict):
483483
"""
484484
Create a new chatbot.
485485
:param project: Name of the project.
486-
:param chatbot_name: Name of the chatbot to create.
487-
:param params: Configuration parameters for the chatbot.
486+
:param data: Configuration parameters for the chatbot.
488487
:return: Details of the created chatbot as a JSON response.
489488
"""
490489
url = f'{self.url}/api/projects/{project}/chatbots'
491490
r = self.session.post(url, json={
492-
'chatbot': {
493-
'name': chatbot_name,
494-
'params': params
495-
}
491+
'chatbot': data
492+
496493
})
497494
_raise_for_status(r)
498495
return r.json()
499496

500497
@_try_relogin
501-
def update_chatbot(self, project: str, chatbot_name: str, params: dict):
498+
def update_chatbot(self, project: str, chatbot_name: str, data: dict):
502499
"""
503500
Update an existing chatbot's configuration.
504501
:param project: Name of the project.
@@ -508,9 +505,7 @@ def update_chatbot(self, project: str, chatbot_name: str, params: dict):
508505
"""
509506
url = f'{self.url}/api/projects/{project}/chatbots/{chatbot_name}'
510507
r = self.session.put(url, json={
511-
'chatbot': {
512-
'params': params
513-
}
508+
'chatbot': data
514509
})
515510
_raise_for_status(r)
516511
return r.json()

0 commit comments

Comments
 (0)