new features
This commit is contained in:
@@ -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']})
|
||||
|
||||
Reference in New Issue
Block a user