mirror of
https://github.com/NovaOSS/nova-api.git
synced 2024-11-25 14:33:57 +01:00
idk
This commit is contained in:
parent
ea35674853
commit
bc5cd7122e
|
@ -86,6 +86,7 @@ async def stream(
|
|||
'Sorry, the API has no working keys anymore.',
|
||||
'The admins have been messaged automatically.'
|
||||
)
|
||||
return
|
||||
|
||||
for k, v in target_request.get('headers', {}).items():
|
||||
headers[k] = v
|
||||
|
@ -138,6 +139,7 @@ async def stream(
|
|||
chunk = f'{chunk.decode("utf8")}\n\n'
|
||||
chunk = chunk.replace(os.getenv('MAGIC_WORD', 'novaOSScheckKeyword'), payload['model'])
|
||||
# chunk = chunk.replace(os.getenv('MAGIC_USER_WORD', 'novaOSSuserKeyword'), user['_id'])
|
||||
print(chunk)
|
||||
|
||||
if not chunk.strip():
|
||||
send = False
|
||||
|
@ -145,7 +147,6 @@ async def stream(
|
|||
if is_chat and '{' in chunk:
|
||||
data = json.loads(chunk.split('data: ')[1])
|
||||
send = True
|
||||
print(data)
|
||||
|
||||
if target_request['module'] == 'twa' and data.get('text'):
|
||||
chunk = chat.create_chat_chunk(
|
||||
|
|
Loading…
Reference in a new issue