Reformat and remove unused import
This commit is contained in:
@@ -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)
|
||||
print(rsp)
|
||||
|
||||
Reference in New Issue
Block a user