Broaden client-neutral OpenAI and llama.cpp chat compatibility
This commit is contained in:
1 parent
c9036201f7
commit
3cd9fa5750
5 files changed
+158
-3
No files matched your search
+6
-1
@@ -169,7 +169,9 @@ class APIHandler(BaseHTTPRequestHandler):
|
||||
def log_message(self,*args):pass
|
||||
def compatibility_headers(self):
|
||||
info=getattr(self,'compatibility',{})
|
||||
if info:
|
||||
if info.get('ignored'):
|
||||
self.send_header('X-Athena-Compatibility-Ignored',','.join(info['ignored']))
|
||||
if 'requested' in info:
|
||||
self.send_header('X-Athena-Reasoning-Requested',info['requested'])
|
||||
self.send_header('X-Athena-Reasoning-Effective',info['effective'])
|
||||
self.send_header('X-Athena-Reasoning-Semantics',info['semantics'])
|
||||
@@ -209,6 +211,9 @@ class APIHandler(BaseHTTPRequestHandler):
|
||||
try:ep.video.relay(self) if callable(getattr(type(ep.video),'relay',None)) else relay(self,video['selected'])
|
||||
except ValueError as exc:raise APIError(str(exc)) from None
|
||||
return
|
||||
if self.command=='GET' and self.path=='/v1/capabilities':
|
||||
from api_compat import capabilities
|
||||
return self.send(capabilities())
|
||||
model_routes={'/v1/models':'chat','/v1/images/models':'image','/v1/audio/speech/models':'audio','/v1/audio/transcriptions/models':'stt','/v1/audio/music/models':'music'}
|
||||
if self.command=='GET' and self.path in model_routes:return self.send(ep.model_list(model_routes[self.path]))
|
||||
if self.command=='GET' and self.path=='/health':return self.send({'status':'ok','service':'athena-deck-api'})
|
||||
|
||||
Reference in new issue
Block a user