INNER CODE UNIT · Python
__ask
awekrx/AutoDoc-ChatGPT · modules/autodoc.py:33
def __ask(self, code) -> str:
response = None
conversation = None
try:
for data in self.__chatbot.ask(
Prompt(self.__language, code).create(),
conversation_id=self.__conversation,
parent_id=None,
):
response = data["message"]
conversation = data["conversation_id"]
if not self.__conversation:
self.__conversation = conversation
return response
except:
raise ValueError("ChatGPT error")
def start(self):