diff --git a/base/func_bard.py b/base/func_bard.py index 5d0a32c..970367c 100644 --- a/base/func_bard.py +++ b/base/func_bard.py @@ -1,14 +1,14 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- + import bardapi -import requests + class BardAssistant: def __init__(self, conf: dict) -> None: self._token = conf["token"] self._bard = bardapi.core.Bard(self._token) - def __repr__(self): return 'BardAssistant' @@ -22,6 +22,7 @@ class BardAssistant: response = self._bard.get_answer(msg) return response['content'] + if __name__ == "__main__": from configuration import Config config = Config().BardAssistant @@ -30,4 +31,4 @@ if __name__ == "__main__": bard_assistant = BardAssistant(config) rsp = BardAssistant.get_answer("who are you?") - print(rsp) \ No newline at end of file + print(rsp)