Skip to content

Commit

Permalink
Make the tabby autocompletion support conditional
Browse files Browse the repository at this point in the history
* Otherwise it burns my cpu when editing code :D
  • Loading branch information
radare committed Jun 26, 2024
1 parent db55d3c commit b80c3a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions r2ai/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 4 additions & 3 deletions r2ai/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b80c3a3

Please sign in to comment.