Skip to content

Commit 1c18f59

Browse files
committed
Update leither_api.py
1 parent 86e418c commit 1c18f59

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

leither_api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
USER_ACCOUNT_KEY = "AICHAT_APP_USER_ACCOUNT_KEY"
55
GPT_3_Tokens = 1000000 # bonus tokens upon installation
66
GPT_4_Turbo_Tokens = 10000
7+
LEITHER_SERVER_CLIENT = hprose.HttpClient("http://localhost:8080/webapi/")
78

89
class LeitherAPI:
910
def __init__(self):
10-
self.client = hprose.HttpClient('http://localhost:8004/webapi/')
11+
self.client = LEITHER_SERVER_CLIENT
1112
print(self.client.GetVar("", "ver"))
1213
self.ppt = self.client.GetVarByContext("", "context_ppt")
1314
self.api = self.client.Login(self.ppt)
@@ -30,12 +31,10 @@ def get_sid(self):
3031

3132
def get_user_session(self, user_ip):
3233
# user's Leither mode ip not used for now.
33-
self.client = hprose.HttpClient('http://localhost:8004/webapi/')
3434
print(self.client.GetVar("", "ver"))
3535
return self.client.GetVarByContext("", "context_ppt")
3636

3737
def get_user_client(self, user_node_ip):
38-
self.client = hprose.HttpClient('http://localhost:8004/webapi/')
3938
print(self.client.GetVar("", "ver"))
4039
ppt = self.client.GetVarByContext("", "context_ppt")
4140

0 commit comments

Comments
 (0)