diff --git a/r2ai/interpreter.py b/r2ai/interpreter.py index 91bc79a7..95553bc9 100644 --- a/r2ai/interpreter.py +++ b/r2ai/interpreter.py @@ -591,6 +591,7 @@ def __init__(self): self.env["key.mastodon"] = "" self.env["key.openai"] = "" self.env["http.port"] = "8080" + self.env["http.tabby"] = "false" self.env["http.path"] = "" self.env["http.verbose"] = "true" # not used yet self.env["http.chatctx"] = "false" diff --git a/r2ai/web.py b/r2ai/web.py index ff1b8017..16d4be3b 100644 --- a/r2ai/web.py +++ b/r2ai/web.py @@ -267,9 +267,10 @@ def handle_tabby_query(self, ai, obj, runline2, method): healthstr=json.dumps(healthobj) self.wfile.write(bytes(f'{healthstr}','utf-8')) return True - # /v1/completions - if self.path == "/v1/completions": - return handle_v1_completions(self, ai, obj, runline2, method) + if ai.env["http.tabby"] == "true": + # /v1/completions + if self.path == "/v1/completions": + return handle_v1_completions(self, ai, obj, runline2, method) print(f"UnkPath: {self.path}") self.send_response(200)