Use saved web and Gitea access from a fresh chat
This commit is contained in:
@@ -40,6 +40,13 @@ class Handler(BaseHTTPRequestHandler):
|
||||
payload = ''.join(f'data: {json.dumps(frame)}\n\n' for frame in frames)
|
||||
self.reply(200, (payload + 'data: [DONE]\n\n').encode(), 'text/event-stream')
|
||||
return
|
||||
if self.path == '/chat-web/api/chat':
|
||||
system, user = message['messages']
|
||||
if system['role'] != 'system' or 'Test passage.' not in system['content'] or '/article' not in user['content']:
|
||||
self.reply(400)
|
||||
return
|
||||
self.reply(200, b'{"message":{"content":"Page received."},"done":true}\n', 'application/x-ndjson')
|
||||
return
|
||||
if self.path == '/chat-tools/api/chat':
|
||||
system, user = message['messages']
|
||||
valid = (system['role'] == 'system' and 'fixture/visible-repo' in system['content']
|
||||
|
||||
Reference in New Issue
Block a user