summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Acytoo.py
diff options
context:
space:
mode:
authorBagus Indrayana <bagusindrayanaindo@gmail.com>2023-08-24 12:23:55 +0200
committerBagus Indrayana <bagusindrayanaindo@gmail.com>2023-08-24 12:23:55 +0200
commitc9d2f060906ceffe13cccbf9cf049fa614dc3707 (patch)
tree7c18afd174d8ca192a5b3042e0a381f01c0dba08 /g4f/Provider/Acytoo.py
parentadd provider (diff)
parent ~ | Merge pull request #829 (diff)
downloadgpt4free-c9d2f060906ceffe13cccbf9cf049fa614dc3707.tar
gpt4free-c9d2f060906ceffe13cccbf9cf049fa614dc3707.tar.gz
gpt4free-c9d2f060906ceffe13cccbf9cf049fa614dc3707.tar.bz2
gpt4free-c9d2f060906ceffe13cccbf9cf049fa614dc3707.tar.lz
gpt4free-c9d2f060906ceffe13cccbf9cf049fa614dc3707.tar.xz
gpt4free-c9d2f060906ceffe13cccbf9cf049fa614dc3707.tar.zst
gpt4free-c9d2f060906ceffe13cccbf9cf049fa614dc3707.zip
Diffstat (limited to 'g4f/Provider/Acytoo.py')
-rw-r--r--g4f/Provider/Acytoo.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/g4f/Provider/Acytoo.py b/g4f/Provider/Acytoo.py
index 32c67c0c..2edd9efd 100644
--- a/g4f/Provider/Acytoo.py
+++ b/g4f/Provider/Acytoo.py
@@ -19,11 +19,12 @@ class Acytoo(BaseProvider):
**kwargs: Any,
) -> CreateResult:
headers = _create_header()
- payload = _create_payload(messages)
+ payload = _create_payload(messages, kwargs.get('temperature', 0.5))
url = "https://chat.acytoo.com/api/completions"
response = requests.post(url=url, headers=headers, json=payload)
response.raise_for_status()
+ response.encoding = "utf-8"
yield response.text
@@ -34,7 +35,7 @@ def _create_header():
}
-def _create_payload(messages: list[dict[str, str]]):
+def _create_payload(messages: list[dict[str, str]], temperature):
payload_messages = [
message | {"createdAt": int(time.time()) * 1000} for message in messages
]
@@ -42,6 +43,6 @@ def _create_payload(messages: list[dict[str, str]]):
"key": "",
"model": "gpt-3.5-turbo",
"messages": payload_messages,
- "temperature": 1,
+ "temperature": temperature,
"password": "",
}