fixes
このコミットが含まれているのは:
コミット
b2631af65e
|
@ -21,10 +21,10 @@ class Utils:
|
|||
base_string: str = '%s:%s:%s:%s' % (
|
||||
json_data['t'],
|
||||
json_data['m'],
|
||||
secretKey.decode(),
|
||||
'OVbi[TPN{S#)c{36%9?g;usl)CL',
|
||||
len(json_data['m'])
|
||||
)
|
||||
|
||||
|
||||
return hashlib.sha256(base_string.encode()).hexdigest()
|
||||
|
||||
def format_timestamp(timestamp: int) -> str:
|
||||
|
@ -38,11 +38,20 @@ class Utils:
|
|||
def _create_completion(model: str,messages: list, temperature: float = 0.6, stream: bool = False):
|
||||
headers = {
|
||||
'authority': 'api.caipacity.com',
|
||||
'authorization': f'Bearer free',
|
||||
'accept': '*/*',
|
||||
'authorization': 'Bearer free',
|
||||
'client-id': str(uuid.uuid4()),
|
||||
'client-v': '0.1.26',
|
||||
'content-type': 'application/json',
|
||||
'origin': 'https://ai.ls',
|
||||
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'
|
||||
'referer': 'https://ai.ls/',
|
||||
'sec-ch-ua': '"Google Chrome";v="113", "Chromium";v="113", "Not-A.Brand";v="24"',
|
||||
'sec-ch-ua-mobile': '?0',
|
||||
'sec-ch-ua-platform': '"macOS"',
|
||||
'sec-fetch-dest': 'empty',
|
||||
'sec-fetch-mode': 'cors',
|
||||
'sec-fetch-site': 'cross-site',
|
||||
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36',
|
||||
}
|
||||
|
||||
timestamp = Utils.format_timestamp(int(time.time() * 1000))
|
||||
|
|
読み込み中…
新しいイシューから参照