diff --git a/ex_app/lib/all_tools/calendar.py b/ex_app/lib/all_tools/calendar.py index 4412bdd..6ecb1ec 100644 --- a/ex_app/lib/all_tools/calendar.py +++ b/ex_app/lib/all_tools/calendar.py @@ -70,6 +70,7 @@ def schedule_event(calendar_name: str, title: str, description: str, start_date: start_datetime = tz.localize(start_datetime) end_datetime = tz.localize(end_datetime) + description_with_ai_note = f"{description}\n\n---\n\nThis event was scheduled by Nextcloud AI Assistant." # Create event c = Calendar() @@ -77,7 +78,7 @@ def schedule_event(calendar_name: str, title: str, description: str, start_date: e.name = title e.begin = start_datetime e.end = end_datetime - e.description = description + e.description = description_with_ai_note e.location = location if attendees is not None: for attendee in attendees: @@ -200,11 +201,13 @@ def add_task(calendar_name: str, title: str, description: str, due_date: Optiona :return: bool """ + description_with_ai_note = f"{description}\n\n---\n\nThis task was scheduled by Nextcloud AI Assistant." + # Create task c = Calendar() t = Todo() t.name = title - t.description = description + t.description = description_with_ai_note # Parse date and times if due_date: diff --git a/ex_app/lib/all_tools/deck.py b/ex_app/lib/all_tools/deck.py index 7a6e735..4c26b91 100644 --- a/ex_app/lib/all_tools/deck.py +++ b/ex_app/lib/all_tools/deck.py @@ -50,6 +50,7 @@ def add_card(deck_id: int, stack_id: int, title: str): "Content-Type": "application/json", }, json={ 'title': title, + 'description': 'Created by Nextcloud AI Assistant.', 'type': 'plain', 'order': 999, }) diff --git a/ex_app/lib/all_tools/mail.py b/ex_app/lib/all_tools/mail.py index aa81ace..38a99a2 100644 --- a/ex_app/lib/all_tools/mail.py +++ b/ex_app/lib/all_tools/mail.py @@ -23,13 +23,14 @@ def send_email(subject: str, body: str, account_id: int, from_email: str, to_ema :param to_emails: The emails to send """ i = 0 + body_with_ai_note = f"{body}\n\n---\n\nThis email was sent by Nextcloud AI Assistant." while i < 20: try: return nc.ocs('POST', '/ocs/v2.php/apps/mail/message/send', json={ 'accountId': account_id, 'fromEmail': from_email, 'subject': subject, - 'body': body, + 'body': body_with_ai_note, 'isHtml': False, 'to': [{'label': '', 'email': email} for email in to_emails], }) diff --git a/ex_app/lib/all_tools/openproject.py b/ex_app/lib/all_tools/openproject.py index 6efada6..18818c2 100644 --- a/ex_app/lib/all_tools/openproject.py +++ b/ex_app/lib/all_tools/openproject.py @@ -40,7 +40,9 @@ def create_work_package(project_id: int, title: str, description: Optional[str], :param description: The description of the work package :param assignee_id: The ID of the user the work package should be assigned to, obtainable via list_assignees :return: - """ + """ + + descrption_with_ai_note = f"{description}\n\nThis work package was created by Nextcloud AI Assistant." links = { "project": { @@ -69,10 +71,10 @@ def create_work_package(project_id: int, title: str, description: Optional[str], if description: json["body"]["description"] = { - "format": "markdown", - "html": "", - "raw": description, - } + "format": "markdown", + "html": "", + "raw": descrption_with_ai_note, + } response = nc.ocs('POST', '/ocs/v2.php/apps/integration_openproject/api/v1/create/work-packages', json=json) diff --git a/ex_app/lib/all_tools/talk.py b/ex_app/lib/all_tools/talk.py index 5c89551..814f941 100644 --- a/ex_app/lib/all_tools/talk.py +++ b/ex_app/lib/all_tools/talk.py @@ -43,7 +43,8 @@ def send_message_to_conversation(conversation_name: str, message: str): """ conversations = nc.talk.get_user_conversations() conversation = {conv.display_name: conv for conv in conversations}[conversation_name] - nc.talk.send_message(message, conversation) + message_with_ai_note = f"{message}\n\nThis message was sent by Nextcloud AI Assistant." + nc.talk.send_message(message_with_ai_note, conversation) return True