diff options
author | Bagus Indrayana <bagusindrayanaindo@gmail.com> | 2023-08-24 12:23:55 +0200 |
---|---|---|
committer | Bagus Indrayana <bagusindrayanaindo@gmail.com> | 2023-08-24 12:23:55 +0200 |
commit | c9d2f060906ceffe13cccbf9cf049fa614dc3707 (patch) | |
tree | 7c18afd174d8ca192a5b3042e0a381f01c0dba08 /g4f/Provider/Aichat.py | |
parent | add provider (diff) | |
parent | ~ | Merge pull request #829 (diff) | |
download | gpt4free-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/Aichat.py')
-rw-r--r-- | g4f/Provider/Aichat.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/g4f/Provider/Aichat.py b/g4f/Provider/Aichat.py index 6992d071..a1d90db7 100644 --- a/g4f/Provider/Aichat.py +++ b/g4f/Provider/Aichat.py @@ -40,9 +40,9 @@ class Aichat(BaseProvider): json_data = { "message": base, - "temperature": 1, + "temperature": kwargs.get('temperature', 0.5), "presence_penalty": 0, - "top_p": 1, + "top_p": kwargs.get('top_p', 1), "frequency_penalty": 0, } @@ -52,4 +52,6 @@ class Aichat(BaseProvider): json=json_data, ) response.raise_for_status() + if not response.json()['response']: + raise Exception("Error Response: " + response.json()) yield response.json()["message"] |