summaryrefslogtreecommitdiffstats
path: root/gpt4free
diff options
context:
space:
mode:
authort.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-05-04 18:29:09 +0200
committert.me/xtekky <98614666+xtekky@users.noreply.github.com>2023-05-04 18:29:09 +0200
commit824d7259d030f7c5d35004729eee68a0e4359304 (patch)
tree909b5bc4b10461e1fe2e82aa2cfd9da9724bcec6 /gpt4free
parentUpdate README.md (diff)
downloadgpt4free-824d7259d030f7c5d35004729eee68a0e4359304.tar
gpt4free-824d7259d030f7c5d35004729eee68a0e4359304.tar.gz
gpt4free-824d7259d030f7c5d35004729eee68a0e4359304.tar.bz2
gpt4free-824d7259d030f7c5d35004729eee68a0e4359304.tar.lz
gpt4free-824d7259d030f7c5d35004729eee68a0e4359304.tar.xz
gpt4free-824d7259d030f7c5d35004729eee68a0e4359304.tar.zst
gpt4free-824d7259d030f7c5d35004729eee68a0e4359304.zip
Diffstat (limited to 'gpt4free')
-rw-r--r--gpt4free/italygpt/README.md18
-rw-r--r--gpt4free/italygpt/__init__.py28
-rw-r--r--gpt4free/quora/__init__.py4
3 files changed, 2 insertions, 48 deletions
diff --git a/gpt4free/italygpt/README.md b/gpt4free/italygpt/README.md
deleted file mode 100644
index 984eff3a..00000000
--- a/gpt4free/italygpt/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-### Example: `italygpt`
-
-```python
-# create an instance
-from gpt4free import italygpt
-italygpt = italygpt.Completion()
-
-# initialize api
-italygpt.init()
-
-# get an answer
-italygpt.create(prompt="What is the meaning of life?")
-print(italygpt.answer) # html formatted
-
-# keep the old conversation
-italygpt.create(prompt="Are you a human?", messages=italygpt.messages)
-print(italygpt.answer)
-``` \ No newline at end of file
diff --git a/gpt4free/italygpt/__init__.py b/gpt4free/italygpt/__init__.py
deleted file mode 100644
index 27a965f1..00000000
--- a/gpt4free/italygpt/__init__.py
+++ /dev/null
@@ -1,28 +0,0 @@
-import requests, time, ast, json
-from bs4 import BeautifulSoup
-from hashlib import sha256
-
-class Completion:
- # answer is returned with html formatting
- next_id = None
- messages = []
- answer = None
-
- def init(self):
- r = requests.get("https://italygpt.it")
- soup = BeautifulSoup(r.text, "html.parser")
- self.next_id = soup.find("input", {"name": "next_id"})["value"]
-
- def create(self, prompt: str, messages: list = []):
- try:
- r = requests.get("https://italygpt.it/question", params={"hash": sha256(self.next_id.encode()).hexdigest(), "prompt": prompt, "raw_messages": json.dumps(messages)}).json()
- except:
- r = requests.get("https://italygpt.it/question", params={"hash": sha256(self.next_id.encode()).hexdigest(), "prompt": prompt, "raw_messages": json.dumps(messages)}).text
- if "too many requests" in r.lower():
- # rate limit is 17 requests per 1 minute
- time.sleep(20)
- return self.create(prompt, messages)
- self.next_id = r["next_id"]
- self.messages = ast.literal_eval(r["raw_messages"])
- self.answer = r["response"]
- return self \ No newline at end of file
diff --git a/gpt4free/quora/__init__.py b/gpt4free/quora/__init__.py
index bc17ea5d..5d9e80c1 100644
--- a/gpt4free/quora/__init__.py
+++ b/gpt4free/quora/__init__.py
@@ -104,8 +104,8 @@ class Model:
def create(
token: str,
model: str = 'gpt-3.5-turbo', # claude-instant
- system_prompt: str = 'You are ChatGPT a large language model developed by Openai. Answer as consisely as possible',
- description: str = 'gpt-3.5 language model from openai, skidded by poe.com',
+ system_prompt: str = 'You are ChatGPT a large language model. Answer as consisely as possible',
+ description: str = 'gpt-3.5 language model',
handle: str = None,
) -> ModelResponse:
if not handle: