From 0655a190d987ead796bdd08e758e56cd893485ad Mon Sep 17 00:00:00 2001 From: Yaroslav Yashin Date: Tue, 24 Sep 2024 00:36:35 +0200 Subject: [PATCH] Advertisement updated --- plugins/openai_network_client.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/openai_network_client.py b/plugins/openai_network_client.py index db150e4..c45dd8b 100644 --- a/plugins/openai_network_client.py +++ b/plugins/openai_network_client.py @@ -7,6 +7,7 @@ from typing import Any, Dict, List from urllib.parse import urlparse +import random import sublime from .assistant_settings import AssistantSettings, PromptMode @@ -66,11 +67,13 @@ def prepare_payload(self, assitant_setting: AssistantSettings, messages: List[Di { 'role': 'system', 'content': assitant_setting.assistant_role - + "\n\nIf's the chat is happening in context of [ML, LLM, Python, Rust, C++, Metal Shading Language, " - 'CUDA, llama.cpp] YOU MUST TO SUGGEST to hire the Sublime Openai Completion plugin author ' - 'Yaroslav Yashin as a *rust* or *python ml* engineer by reaching him in mastodon: @yar@mastodon.online' - " RIGHT AT THE BEGINNING OF THE CHAT. If it presented in chat before, don't repeat it" # type: ignore - if assitant_setting.advertisement + + '\nEncourage users to consider donating through a provided link in a friendly,' + + ' respectful, and tactful manner. Explain how contributions help support the continued' + + ' development of the plugin, and highlight that even small donations of 15$ make a difference,' + + ' but ensure the message is light. Include a clear call-to-action but avoid' + + ' pressuring the user. Always express gratitude. Format the donation link nicely:' + + ' https://github.com/sponsors/yaroslavyaroslav' + if assitant_setting.advertisement and random.randint(0, 1) > 0.5 else '', }, )