Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 62b4cab

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents aeff049 + 3556e19 commit 62b4cab

File tree

3 files changed

+13
-32
lines changed

3 files changed

+13
-32
lines changed

ProGPT/Conversation.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import json
44
import random
55
import string
6+
from uuid import uuid4
67

78

89
class Conversation:
@@ -85,7 +86,7 @@ def send(self, text: str) -> str:
8586
}
8687
}],
8788
"model": "text-davinci-002-render-sha",
88-
"parent_message_id": self.new_message_id(),
89+
"parent_message_id": str(uuid4()),
8990
"timezone_offset_min": -330
9091
}
9192

@@ -139,18 +140,3 @@ def send(self, text: str) -> str:
139140
message_parts: list = data["message"]["content"]["parts"]
140141

141142
return "".join(message_parts)
142-
143-
@staticmethod
144-
def new_message_id() -> str:
145-
146-
return str(
147-
"".join(random.choices(string.ascii_lowercase + string.digits, k=8)) +
148-
"-" +
149-
"".join(random.choices(string.ascii_lowercase + string.digits, k=4)) +
150-
"-" +
151-
"".join(random.choices(string.ascii_lowercase + string.digits, k=4)) +
152-
"-" +
153-
"".join(random.choices(string.ascii_lowercase + string.digits, k=4)) +
154-
"-" +
155-
"".join(random.choices(string.ascii_lowercase + string.digits, k=12))
156-
)

ProGPT/Generative.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import string
66
import os
77
from .Authentication import Authentication
8+
from uuid import uuid4
89

910

1011
class Generative:
@@ -86,7 +87,7 @@ def prompt(self, text: str) -> str:
8687
}
8788
}],
8889
"model": "text-davinci-002-render-sha",
89-
"parent_message_id": self.new_message_id(),
90+
"parent_message_id": str(uuid4()),
9091
"timezone_offset_min": -330
9192
}
9293

@@ -134,18 +135,3 @@ def prompt(self, text: str) -> str:
134135
message_parts: list = data["message"]["content"]["parts"]
135136

136137
return "".join(message_parts)
137-
138-
@staticmethod
139-
def new_message_id() -> str:
140-
141-
return str(
142-
"".join(random.choices(string.ascii_lowercase + string.digits, k=8)) +
143-
"-" +
144-
"".join(random.choices(string.ascii_lowercase + string.digits, k=4)) +
145-
"-" +
146-
"".join(random.choices(string.ascii_lowercase + string.digits, k=4)) +
147-
"-" +
148-
"".join(random.choices(string.ascii_lowercase + string.digits, k=4)) +
149-
"-" +
150-
"".join(random.choices(string.ascii_lowercase + string.digits, k=12))
151-
)

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
# ProGPT - Free GPT-3.5 API
2+
3+
[![PyPI](https://img.shields.io/pypi/v/progpt)](https://pypi.org/project/progpt)
4+
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/progpt)]()
5+
[![Downloads](https://static.pepy.tech/badge/progpt)](https://pepy.tech/project/progpt)
6+
[![Twitter Share](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2Fdiezo%2Fprogpt)](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Fdiezo%2Fprogpt)
7+
28
I reverse engineered [ChatGPT 3.5](https://chat.openai.com)'s Free Web API and put it all together into this simple python package.
39

410
It supports both **Generative** & **Conversation** mode.
511

612
[<img style="margin-top: 10px" src="https://www.buymeacoffee.com/assets/img/guidelines/download-assets-sm-1.svg" width="160"/>](https://buymeacoffee.com/diezo)
713

14+
## 🌟 Just a minute!
15+
ProGPT is still in it's early stages and requires your support. Don't forget to give a star. Thank you!
16+
817
## Installation
918
```python
1019
$ pip install progpt

0 commit comments

Comments
 (0)