From fc357d17f21c9aa1f1fe9ce87f3b4ef91288be42 Mon Sep 17 00:00:00 2001 From: Sandipsinh Rathod Date: Sun, 13 Oct 2024 10:25:06 -0400 Subject: [PATCH] chore: make it compatible with chatgpt --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 607aa59..8037dee 100644 --- a/main.py +++ b/main.py @@ -11,7 +11,11 @@ def send_post_request(prompt): url = "http://localhost:19194/" # Update this to your actual server URL payload = prompt.title() response = requests.post(url, json=payload) - return response.text + json = response.json() + if "response" in json: + return json["response"] + else: + return json # Custom CSS to fix the input box at the bottom of the page