Use saved web and Gitea access from a fresh chat

This commit is contained in:
Mark Gregory
2026-11-16 16:18:39 +00:00
parent 00ea78671b
commit 4ebf2b82be
6 changed files with 79 additions and 15 deletions
+7
View File
@@ -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']