From 0fed30596a0e2fb162f5b813cf61ff57382c2ba1 Mon Sep 17 00:00:00 2001 From: "t.me/xtekky" <98614666+xtekky@users.noreply.github.com> Date: Sun, 16 Apr 2023 17:43:26 +0100 Subject: opena, bard & bing [experimental] --- experimental/bard/typings.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 experimental/bard/typings.py (limited to 'experimental/bard/typings.py') diff --git a/experimental/bard/typings.py b/experimental/bard/typings.py new file mode 100644 index 00000000..69239762 --- /dev/null +++ b/experimental/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] -- cgit v1.2.3