summaryrefslogtreecommitdiffstats
path: root/experimental/bard/typings.py
diff options
context:
space:
mode:
authort.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-16 18:43:26 +0200
committert.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-16 18:43:26 +0200
commit0fed30596a0e2fb162f5b813cf61ff57382c2ba1 (patch)
tree5b29da33b07f8321b0879d703e7f8fc3e90ad7c8 /experimental/bard/typings.py
parentora.sh gpt-4 (diff)
downloadgpt4free-0fed30596a0e2fb162f5b813cf61ff57382c2ba1.tar
gpt4free-0fed30596a0e2fb162f5b813cf61ff57382c2ba1.tar.gz
gpt4free-0fed30596a0e2fb162f5b813cf61ff57382c2ba1.tar.bz2
gpt4free-0fed30596a0e2fb162f5b813cf61ff57382c2ba1.tar.lz
gpt4free-0fed30596a0e2fb162f5b813cf61ff57382c2ba1.tar.xz
gpt4free-0fed30596a0e2fb162f5b813cf61ff57382c2ba1.tar.zst
gpt4free-0fed30596a0e2fb162f5b813cf61ff57382c2ba1.zip
Diffstat (limited to '')
-rw-r--r--experimental/bard/typings.py15
1 files changed, 15 insertions, 0 deletions
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]