summaryrefslogtreecommitdiffstats
path: root/ora/typing.py
diff options
context:
space:
mode:
authort.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-25 19:40:17 +0200
committert.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-04-25 19:40:17 +0200
commite341c75e5e9c34c5aa583e67b8711799d74040eb (patch)
tree9838ce842a78a0226bb9d55e83bfc0a7d7b2249d /ora/typing.py
parent_ (diff)
downloadgpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.tar
gpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.tar.gz
gpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.tar.bz2
gpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.tar.lz
gpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.tar.xz
gpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.tar.zst
gpt4free-e341c75e5e9c34c5aa583e67b8711799d74040eb.zip
Diffstat (limited to 'ora/typing.py')
-rw-r--r--ora/typing.py39
1 files changed, 0 insertions, 39 deletions
diff --git a/ora/typing.py b/ora/typing.py
deleted file mode 100644
index f3f0aebf..00000000
--- a/ora/typing.py
+++ /dev/null
@@ -1,39 +0,0 @@
-class OraResponse:
-
- class Completion:
-
- class Choices:
- def __init__(self, choice: dict) -> None:
- self.text = choice['text']
- self.content = self.text.encode()
- self.index = choice['index']
- self.logprobs = choice['logprobs']
- self.finish_reason = choice['finish_reason']
-
- def __repr__(self) -> str:
- return f'''<__main__.APIResponse.Completion.Choices(\n text = {self.text.encode()},\n index = {self.index},\n logprobs = {self.logprobs},\n finish_reason = {self.finish_reason})object at 0x1337>'''
-
- def __init__(self, choices: dict) -> None:
- self.choices = [self.Choices(choice) for choice in choices]
-
- class Usage:
- def __init__(self, usage_dict: dict) -> None:
- self.prompt_tokens = usage_dict['prompt_tokens']
- self.completion_tokens = usage_dict['completion_tokens']
- self.total_tokens = usage_dict['total_tokens']
-
- def __repr__(self):
- return f'''<__main__.APIResponse.Usage(\n prompt_tokens = {self.prompt_tokens},\n completion_tokens = {self.completion_tokens},\n total_tokens = {self.total_tokens})object at 0x1337>'''
-
- def __init__(self, response_dict: dict) -> None:
-
- self.response_dict = response_dict
- self.id = response_dict['id']
- self.object = response_dict['object']
- self.created = response_dict['created']
- self.model = response_dict['model']
- self.completion = self.Completion(response_dict['choices'])
- self.usage = self.Usage(response_dict['usage'])
-
- def json(self) -> dict:
- return self.response_dict \ No newline at end of file