[BUG]: Fix Bailing API configs (#1570)

This commit is contained in:
Yi Ding 2024-09-27 11:56:57 +08:00 committed by GitHub
parent e8437db98f
commit 85a28874aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,6 +77,9 @@ class BailingAPI(BaseAPIModel):
self._headers = {'Authorization': f'Bearer {token}'} self._headers = {'Authorization': f'Bearer {token}'}
else: else:
raise RuntimeError('There is not valid token.') raise RuntimeError('There is not valid token.')
else:
self._headers = {'Authorization': f'Bearer {token}'}
self._headers['Content-Type'] = 'application/json' self._headers['Content-Type'] = 'application/json'
self._url = url if url else \ self._url = url if url else \
'https://bailingchat.alipay.com/chat/completions' 'https://bailingchat.alipay.com/chat/completions'