From 4cec1ed9aaaa5ae6a09f1d2193cfe6e6c3791106 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Wed, 22 Nov 2023 21:21:57 +0100 Subject: Fix ChatgptAi Provider --- g4f/Provider/ChatgptAi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/g4f/Provider/ChatgptAi.py b/g4f/Provider/ChatgptAi.py index 9425dfb0..f2785364 100644 --- a/g4f/Provider/ChatgptAi.py +++ b/g4f/Provider/ChatgptAi.py @@ -65,7 +65,8 @@ class ChatgptAi(AsyncGeneratorProvider): async with session.post( f"{cls.url}/wp-json/mwai-ui/v1/chats/submit", proxy=proxy, - json=data + json=data, + headers={"X-Wp-Nonce": cls._system["restNonce"]} ) as response: response.raise_for_status() async for line in response.content: -- cgit v1.2.3