diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 304cf20..c6fa8f8 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -59,12 +59,13 @@ jobs: echo MATRIX_BOT_PASSWORD=${{ secrets.MATRIX_BOT_PASSWORD }} >> .env echo ERRORS_ROOM_ID=${{ secrets.ERRORS_ROOM_ID }} >> .env echo USER_ALLOWED_DOMAINS=${{ secrets.USER_ALLOWED_DOMAINS }} >> .env - echo JOIN_ON_INVITE=${{ secrets.JOIN_ON_INVITE }} >> .env + echo JOIN_ON_INVITE=${{ vars.JOIN_ON_INVITE }} >> .env echo SALT=${{ secrets.SALT }} >> .env echo ALBERT_API_URL=${{ secrets.ALBERT_API_URL }} >> .env echo ALBERT_API_TOKEN=${{ secrets.ALBERT_API_TOKEN }} >> .env - echo ALBERT_API_MODEL_NAME=${{ secrets.ALBERT_API_MODEL_NAME }} >> .env - echo ALBERT_API_MODE=${{ secrets.ALBERT_API_MODE }} >> .env + echo ALBERT_API_MODEL_NAME=${{ vars.ALBERT_API_MODEL_NAME }} >> .env + echo ALBERT_API_MODE=${{ vars.ALBERT_API_MODE }} >> .env + echo GROUPS_USED=${{ vars.GROUPS_USED }} >> .env cat .env - name: Copy deployment files to remote server via SCP diff --git a/app/commands.py b/app/commands.py index 067f1cd..bc65a11 100755 --- a/app/commands.py +++ b/app/commands.py @@ -170,6 +170,25 @@ async def albert_conversation(ep: EventParser, matrix_client: MatrixClient): await matrix_client.send_text_message(ep.room.room_id, reset_message) +@register_feature( + group="albert_debug", + onEvent=RoomMessageText, + command="mode", + help=f"**{COMMAND_PREFIX}mode** MODE : Modifier le mode du modèle (c'est-à-dire le modèle de prompt utilisé).", +) +async def albert_mode(ep: EventParser, matrix_client: MatrixClient): + config = user_configs[ep.sender] + await matrix_client.room_typing(ep.room.room_id) + commands = ep.event.body.split() + if len(commands) <= 1: + reset_message = "La commande !mode nécessite un argument. Se référer à !help." + else: + mode = commands[1] + config.albert_api_mode = mode + reset_message = "Le mode a été modifié." + await matrix_client.send_text_message(ep.room.room_id, reset_message) + + @register_feature( group="albert", onEvent=RoomMessageText, diff --git a/docker-compose.yml b/docker-compose.yml index c5a4d87..a452719 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: - MATRIX_BOT_PASSWORD=${MATRIX_BOT_PASSWORD} - ERRORS_ROOM_ID=${ERRORS_ROOM_ID} - SESSION_PATH=/data/session.txt - - GROUPS_USED=["basic", "albert"] + - GROUPS_USED=${GROUPS_USED} - USER_ALLOWED_DOMAINS=${USER_ALLOWED_DOMAINS} - JOIN_ON_INVITE=${JOIN_ON_INVITE} - SALT=${SALT}