From 13ffdcd61a5c5cabb1fe293e873a80af8328ea35 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Sat, 14 Oct 2023 00:31:48 +0200 Subject: Fix Opchatgpts and ChatForAi Provider Deprecate Vitalentum and Aivvm Provider --- g4f/Provider/GptForLove.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'g4f/Provider/GptForLove.py') diff --git a/g4f/Provider/GptForLove.py b/g4f/Provider/GptForLove.py index 01cef443..9f7156b2 100644 --- a/g4f/Provider/GptForLove.py +++ b/g4f/Provider/GptForLove.py @@ -42,11 +42,10 @@ class GptForLove(AsyncGeneratorProvider): data = { "prompt": prompt, "options": {}, - "systemMessage": "You are ChatGPT, the version is GPT3.5, a large language model trained by OpenAI. Follow the user's instructions carefully. Respond using markdown.", - "temperature": 0.8, - "top_p": 1, + "systemMessage": kwargs.get("system_message", "You are ChatGPT, the version is GPT3.5, a large language model trained by OpenAI. Follow the user's instructions carefully."), + "temperature": kwargs.get("temperature", 0.8), + "top_p": kwargs.get("top_p", 1), "secret": get_secret(), - **kwargs } async with session.post("https://api.gptplus.one/chat-process", json=data, proxy=proxy) as response: response.raise_for_status() @@ -67,9 +66,9 @@ class GptForLove(AsyncGeneratorProvider): def get_secret() -> str: dir = os.path.dirname(__file__) - dir += '/npm/node_modules/crypto-js' + include = dir + '/npm/node_modules/crypto-js/crypto-js' source = """ -CryptoJS = require('{dir}/crypto-js') +CryptoJS = require({include}) var k = '14487141bvirvvG' , e = Math.floor(new Date().getTime() / 1e3); var t = CryptoJS.enc.Utf8.parse(e) @@ -79,5 +78,5 @@ var t = CryptoJS.enc.Utf8.parse(e) }); return o.toString() """ - source = source.replace('{dir}', dir) + source = source.replace('{include}', json.dumps(include)) return execjs.compile(source).call('') -- cgit v1.2.3