Any way to "shortcut" ChatGPR requests?

I keep asking ChatGPT to explain to me the grammar behind a particular German sentence (which I’m learning right now). But it seems to take too much effort to enter the request again and again: “Please explain the grammar to me in this German sentence:”. Is there a way to create a kind of shortcut so that the query is entered with a click of a button?

Create a browser extension. There might even be one that already does what you need.

Perhaps

That’s exactly what the API is for. You can also save prompts in the Playground: OpenAI API

Note that there’s a charge for this, though it’s usually a few cents.

I actually have one connected to my command line when I’m too lazy to open the website. There’s a brief tutorial here, but let me know if you have any questions: GitHub - smuzani/openai-samples

Der DET det
schnelle ADJ amod
braune ADJ amod
Fuchs NOUN nsubj
springt VERB ROOT
über ADP case
den DET det
faulen ADJ amod
Hund NOUN obl
. PUNCT punct

are In this example, we load the German language model in spaCy (de_core_news_sm ) and process the input sentence. We then iterate over each token in the sentence and print the token text, its part-of-speech (POS) tag, and the dependency label.
The output will provide information about each word in the sentence, including its grammatical category (such as noun, verb, adjective, etc.) and its syntactic relationship to other words in the sentence (such as subject, object, modifier, etc.) if that helps idk i can try to exsplain it better

Thank you for suggestion. Actually I want to create Telegram bot so users could easily send it a sentence, and it parses ChatGPT (or anything else) for grammar tips. However it supposed to be free and I cant afford myself to pay so much for my users to use API. Maybe I can ask my users to send the bot their openai API keys, however is that a good practice?

Is this model free of charge to use? How can I deploy it?

import logging
import requests
from telegram import Update
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext

# Enable logging
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
logger = logging.getLogger(__name__)

# LanguageTool API endpoint
API_URL = 'https://api.languagetool.org/v2/check'

# Define a command handler for the /start command
def start(update: Update, context: CallbackContext):
    context.bot.send_message(chat_id=update.effective_chat.id, text="Hello! I'm your Grammar Bot. Send me a sentence, and I'll check its grammar.")

# Define a message handler for handling text messages
def grammar_check(update: Update, context: CallbackContext):
    sentence = update.message.text

    # Send the sentence to the LanguageTool API for grammar checking
    response = requests.get(API_URL, params={'text': sentence})

    if response.ok:
        results = response.json()

        # Extract grammar tips from the response
        grammar_tips = [error['message'] for error in results['matches']]

        if grammar_tips:
            # Send the grammar tips as a reply
            context.bot.send_message(chat_id=update.effective_chat.id, text='\n'.join(grammar_tips))
        else:
            context.bot.send_message(chat_id=update.effective_chat.id, text="No grammar issues found.")
    else:
        context.bot.send_message(chat_id=update.effective_chat.id, text="Oops! Something went wrong. Please try again later.")

def main():
    # Set up the Telegram bot
    updater = Updater("YOUR_BOT_TOKEN", use_context=True)

    # Get the dispatcher to register handlers
    dispatcher = updater.dispatcher

    # Register the command handlers
    dispatcher.add_handler(CommandHandler("start", start))

    # Register the message handler
    dispatcher.add_handler(MessageHandler(Filters.text & ~Filters.command, grammar_check))

    # Start the bot
    updater.start_polling()
    logger.info("Bot started!")

    # Run the bot until you press Ctrl-C or the process is stopped
    updater.idle()

if __name__ == '__main__':
    main()

this is a Python code to incorporate grammar checking using the Language Tool API, in this example, the bot responds with grammar tips for a sentence received from a user. It sends the sentence to the Language Tool API and processes the API response to extract the grammar tips. The tips are then sent back as a reply to the user.

in regard to cost it all depends on the system and the amount of tokens and the value of the platform unfortunately nothing in life is free but like with ChatGPT’s, the token system follows global gaudiness regarding tokening due to what call “monopoly” so Thay can only charge what u agree to global standards & regulations. Though most request are minute in comparison depends on token system the syntax and so many more variables.

u can also try to post an example to try and better what ur working on if u don’t want people to know i mean its all out there so i mean just write something similar but not the same if u want more help i can be messaged here

1 Like

You can make a telegram bot that runs for free with this service: heynovo.ai

There’s also this bot for learning German:

1 Like

Ah, I think Raycast has shortcuts too now, but you gotta buy premium for that