diff options
author | t.me/xtekky <98614666+xtekky@users.noreply.github.com> | 2023-04-20 16:34:19 +0200 |
---|---|---|
committer | t.me/xtekky <98614666+xtekky@users.noreply.github.com> | 2023-04-20 16:34:19 +0200 |
commit | a485cfb180094f14b3fe27ea218d2890033768a3 (patch) | |
tree | 8cf4b2f08fb79271a9dc30a0f8843c5561c5d9c9 /unfinished/bard/typings.py | |
parent | ora.sh (diff) | |
download | gpt4free-a485cfb180094f14b3fe27ea218d2890033768a3.tar gpt4free-a485cfb180094f14b3fe27ea218d2890033768a3.tar.gz gpt4free-a485cfb180094f14b3fe27ea218d2890033768a3.tar.bz2 gpt4free-a485cfb180094f14b3fe27ea218d2890033768a3.tar.lz gpt4free-a485cfb180094f14b3fe27ea218d2890033768a3.tar.xz gpt4free-a485cfb180094f14b3fe27ea218d2890033768a3.tar.zst gpt4free-a485cfb180094f14b3fe27ea218d2890033768a3.zip |
Diffstat (limited to 'unfinished/bard/typings.py')
-rw-r--r-- | unfinished/bard/typings.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/unfinished/bard/typings.py b/unfinished/bard/typings.py new file mode 100644 index 00000000..69239762 --- /dev/null +++ b/unfinished/bard/typings.py @@ -0,0 +1,15 @@ +class BardResponse: + def __init__(self, json_dict): + self.json = json_dict + + self.content = json_dict.get('content') + self.conversation_id = json_dict.get('conversation_id') + self.response_id = json_dict.get('response_id') + self.factuality_queries = json_dict.get('factualityQueries', []) + self.text_query = json_dict.get('textQuery', []) + self.choices = [self.BardChoice(choice) for choice in json_dict.get('choices', [])] + + class BardChoice: + def __init__(self, choice_dict): + self.id = choice_dict.get('id') + self.content = choice_dict.get('content')[0] |