🎨 sort main function arguments by length

This commit is contained in:
Laureηt 2023-05-24 22:29:09 +02:00
parent 2fce498162
commit 8e2c9938ed
Signed by: Laurent
SSH key fingerprint: SHA256:kZEpW8cMJ54PDeCvOhzreNr4FSh6R13CMGH/POoO8DI

View file

@ -21,12 +21,13 @@ logger = logging.getLogger("nio-llm.main")
@click.option("--room", "-r", help="The room to join.", required=True) @click.option("--room", "-r", help="The room to join.", required=True)
@click.option("--preprompt", "-t", help="The preprompt to use.", required=True) @click.option("--preprompt", "-t", help="The preprompt to use.", required=True)
def main( def main(
homeserver: str, *,
device_id: str,
username: str,
password: str,
room: str, room: str,
password: str,
username: str,
device_id: str,
preprompt: str, preprompt: str,
homeserver: str,
) -> None: ) -> None:
"""Run the main program. """Run the main program.
@ -43,25 +44,26 @@ def main(
# start the async loop # start the async loop
asyncio.get_event_loop().run_until_complete( asyncio.get_event_loop().run_until_complete(
_main( _main(
ggml_path=ggml_path,
homeserver=homeserver,
device_id=device_id,
username=username,
password=password,
preprompt=preprompt,
room=room, room=room,
password=password,
username=username,
device_id=device_id,
ggml_path=ggml_path,
preprompt=preprompt,
homeserver=homeserver,
), ),
) )
async def _main( async def _main(
homeserver: str, *,
device_id: str, room: str,
username: str,
password: str, password: str,
username: str,
device_id: str,
preprompt: str, preprompt: str,
ggml_path: Path, ggml_path: Path,
room: str, homeserver: str,
) -> None: ) -> None:
"""Run the async main program. """Run the async main program.
@ -69,12 +71,12 @@ async def _main(
""" """
# create the client # create the client
client = LLMClient( client = LLMClient(
homeserver=homeserver,
device_id=device_id,
username=username,
room=room, room=room,
preprompt=preprompt, username=username,
device_id=device_id,
ggml_path=ggml_path, ggml_path=ggml_path,
preprompt=preprompt,
homeserver=homeserver,
) )
# Login to the homeserver # Login to the homeserver