mirror of
https://github.com/lanqian528/chat2api.git
synced 2026-06-05 21:03:53 +08:00
v1.6.8-beta3 fix bugs
This commit is contained in:
parent
c4810f9120
commit
242be6d268
@ -14,7 +14,7 @@ from utils.Logger import logger
|
||||
|
||||
|
||||
def get_req_token(req_token, seed=None):
|
||||
if configs.auto_seed or not seed:
|
||||
if configs.auto_seed:
|
||||
available_token_list = list(set(globals.token_list) - set(globals.error_token_list))
|
||||
length = len(available_token_list)
|
||||
if seed and length > 0:
|
||||
@ -40,6 +40,7 @@ def get_req_token(req_token, seed=None):
|
||||
else:
|
||||
return req_token
|
||||
else:
|
||||
seed = req_token
|
||||
if seed not in globals.seed_map.keys():
|
||||
raise HTTPException(status_code=401, detail={"error": "Invalid Seed"})
|
||||
return globals.seed_map[seed]["token"]
|
||||
|
||||
@ -242,6 +242,7 @@ async def chatgpt_reverse_proxy(request: Request, path: str):
|
||||
return response
|
||||
except Exception:
|
||||
await client.close()
|
||||
|
||||
except HTTPException as e:
|
||||
raise e
|
||||
except Exception as e:
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
|
||||
@ -20,7 +20,6 @@ def is_true(x):
|
||||
|
||||
|
||||
api_prefix = os.getenv('API_PREFIX', None)
|
||||
auto_seed = os.getenv('AUTO_SEED', True)
|
||||
authorization = os.getenv('AUTHORIZATION', '').replace(' ', '')
|
||||
chatgpt_base_url = os.getenv('CHATGPT_BASE_URL', 'https://chatgpt.com').replace(' ', '')
|
||||
auth_key = os.getenv('AUTH_KEY', None)
|
||||
@ -55,6 +54,7 @@ impersonate_list = ast.literal_eval(impersonate_list_str)
|
||||
user_agents_list = ast.literal_eval(user_agents_list_str)
|
||||
|
||||
enable_gateway = is_true(os.getenv('ENABLE_GATEWAY', False))
|
||||
auto_seed = is_true(os.getenv('AUTO_SEED', True))
|
||||
no_sentinel = is_true(os.getenv('NO_SENTINEL', False))
|
||||
|
||||
with open('version.txt') as f:
|
||||
|
||||
@ -1 +1 @@
|
||||
1.6.8-beta2
|
||||
1.6.8-beta3
|
||||
Loading…
Reference in New Issue
Block a user