From 0ab56991cb1c59fc2affa073193369e0f3218cb9 Mon Sep 17 00:00:00 2001 From: Jan Soubusta Date: Thu, 7 Nov 2024 20:39:01 +0100 Subject: [PATCH] PoC expose AI use cases reset chat history fix output type --- gooddata-sdk/gooddata_sdk/compute/service.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gooddata-sdk/gooddata_sdk/compute/service.py b/gooddata-sdk/gooddata_sdk/compute/service.py index 20c5114a..3650500d 100644 --- a/gooddata-sdk/gooddata_sdk/compute/service.py +++ b/gooddata-sdk/gooddata_sdk/compute/service.py @@ -4,6 +4,7 @@ import logging from gooddata_api_client.model.chat_history_request import ChatHistoryRequest +from gooddata_api_client.model.chat_history_result import ChatHistoryResult from gooddata_api_client.model.chat_request import ChatRequest from gooddata_api_client.model.chat_result import ChatResult @@ -83,7 +84,7 @@ def ai_chat(self, workspace_id: str, question: str) -> ChatResult: response = self._actions_api.ai_chat(workspace_id, chat_request, _check_return_type=False) return response - def ai_chat_history(self, workspace_id: str, chat_history_interaction_id: int = 0) -> ChatResult: + def ai_chat_history(self, workspace_id: str, chat_history_interaction_id: int = 0) -> ChatHistoryResult: """ Get chat history with AI in GoodData workspace. @@ -96,3 +97,13 @@ def ai_chat_history(self, workspace_id: str, chat_history_interaction_id: int = chat_history_request = ChatHistoryRequest(chat_history_interaction_id=chat_history_interaction_id) response = self._actions_api.ai_chat_history(workspace_id, chat_history_request, _check_return_type=False) return response + + def ai_chat_history_reset(self, workspace_id: str) -> None: + """ + Reset chat history with AI in GoodData workspace. + + Args: + workspace_id: workspace identifier + """ + chat_history_request = ChatHistoryRequest(reset=True) + self._actions_api.ai_chat_history(workspace_id, chat_history_request, _check_return_type=False)