diff --git a/client.py b/client.py index c09f275..3c336e6 100644 --- a/client.py +++ b/client.py @@ -28,7 +28,11 @@ data["userkey"] = config["userkey"] while True: data["prompt"] = str(input(">> You:\n")) - req = json.loads(requests.post(url=config['url'],json=data).text) + try: + req = json.loads(requests.post(url=config['url'],json=data).text) + except: + print("Internet Err : Can not connect Server") + break if req["code"] == 200: print(f"\n>> AI:\n{req['output']}\n\n<剩余tokens:{req['surplus']} >") elif req["code"] == 403: