feat: remove asyncio dependencies from core api, assistant, and command handlers converting to synchronous execution
This commit is contained in:
@@ -12,7 +12,7 @@ from pr.ui import Colors
|
||||
from pr.editor import RPEditor
|
||||
|
||||
|
||||
def handle_command(assistant, command):
|
||||
async def handle_command(assistant, command):
|
||||
command_parts = command.strip().split(maxsplit=1)
|
||||
cmd = command_parts[0].lower()
|
||||
|
||||
@@ -121,7 +121,7 @@ def handle_command(assistant, command):
|
||||
print(f"Model set to: {Colors.GREEN}{assistant.model}{Colors.RESET}")
|
||||
|
||||
elif cmd == "/models":
|
||||
models = list_models(assistant.model_list_url, assistant.api_key)
|
||||
models = await list_models(assistant.model_list_url, assistant.api_key)
|
||||
if isinstance(models, dict) and "error" in models:
|
||||
print(f"{Colors.RED}Error fetching models: {models['error']}{Colors.RESET}")
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user