new features

This commit is contained in:
Mark Gregory
2026-11-17 15:35:04 +00:00
parent 71972cd843
commit d1a1b454f6
18 changed files with 2598 additions and 112 deletions
+11
View File
@@ -63,6 +63,12 @@ class Handler(BaseHTTPRequestHandler):
self.reply(401)
return
assert message['model'] == 'fixture:latest' and message['stream']
if message['messages'][-1]['content'] == 'hello':
assert message['think'] is False
assert not any('unrelated.pdf' in item['content'] for item in message['messages'])
payload = b'{"message":{"content":"Hello!"},"done":false}\n{"done":true}\n'
self.reply(200, payload, 'application/x-ndjson')
return
payload = b'{"message":{"content":"fixture answer"},"done":false}\n{"done":true}\n'
self.reply(200, payload, 'application/x-ndjson')
return
@@ -72,6 +78,11 @@ class Handler(BaseHTTPRequestHandler):
self.reply(200, b'{"status":"pulling","total":10,"completed":7}\n{"status":"success"}\n',
'application/x-ndjson')
return
if self.path == '/ollama/api/copy':
assert message['source'] in self.server.models
self.server.models.add(message['destination'])
self.reply(200)
return
if self.path == '/ollama/api/show':
assert message['model'] in self.server.models
self.reply(200, {'capabilities': ['completion']})