![]() ![]() ![]() □ FAQ ❓ The response of ChatGPT has no empty spaces. You have some ideas on how to improve the macros or tips on how to make them run on different systems? Don't hesitate include feedback about used token / used money.use any selected text as input (even special characters).make the max_tokens dynamically, depending on the length of the input.add the functionality to abort a running call.temperature: see official documentation.If you use gpt-4then I recommend max_tokens=5000. By default, this is set to 3000, meaning your maximum input can be 1000 tokens (roughly 1.5 pages of text). If your input consists of 3000 tokens, the response can only be 1000 tokens long. The total token limit for a single request with gpt-3.5-turbo is 4000 (approximately 6 pages of text), including the input. max_tokens: This parameter sets the maximum length of the response.If you have access to GPT4 you can switch it to gpt-4. model: The model is set to gpt-3.5-turbo.Everything you return is directly inserted into a LaTeX document and interpreted as LaTeX code." ![]() By default, ChatGPT uses "You are a helpful assistant." for this macro, it has been modified to "You are a helpful assistant and an expert LaTeX editor. system message: The system message determines the behavior of the assistant.Within the Python script, you have the ability to modify various parameters to fine-tune the generated response: These two menu options are dynamically generated when the Macros are executed and not visible if the Macros where never executed.Ĭhange the parameters in the python script If you have executed the macro and you want to stop it (because the response is to long or not what you expected) then just click on Macro -> Stop ChatGPT or Stop ChatGPT PromptLib. The first time you execute the macros they ask you Do you trust this script? if you click Yes, allow all calls it will ever make this message will not be shown to you again. Now you're all set! Highlight any text in your document and run the macros using the shortcuts Shift+F1 and Shift+F2 or by clicking on it. Verify that the Python path is correct (type which python3 in the terminal and paste the result into the macro) - in Windows you have to use forward slashes.Update the script_path variable with the absolute filepath of the Python script you noted in Step 1 - in Windows you have to use forward slashes.save both files as ChatGPT.txsMacro and ChatGPT-PromptLibrary.txsMacro (don't add a file ending like.Download both macros ChatGPT.txsMacro and ChatGPT-PromptLibrary.txsMacro.Note the absolute filepath of the script.Open the script and insert your OpenAI API key.It will be only shown once, so save it somewhere for the next step. Obtain an OpenAI API keyĬreate an account at and get your API key from the OpenAI API Keys page. Open a terminal and run pip install openai. Install Python from the official website. Install Python and the OpenAI Python library If you need to update, download the latest version from the TeXstudio release page.įor Linux users, download the *AppImage, make it executable ( chmod +x filename), and run it. To check your version, go to "Help" -> "About TeXstudio." Make sure you're using TeXstudio version 4.5.2rc1 or higher. Note: this macro was developed and tested on Ubuntu 22.04 but should also run on Windows and Mac.įollow these simple steps to set up the ChatGPT Macro for TeXstudio: Prerequisites 1. The secondary macro, ChatGPT-PromptLibrary, offers a collection of predefined prompts accessible through a dropdown menu, allowing you to easily apply them to any selected text. The response text is inserted directly into your editor, creating an intuitive and interactive ChatGPT experience. The first macro ChatGPT allows you to send selected text from your document to a Python script, which interacts with the API and processes the response. The ChatGPT Macro for TeXstudio is a user-friendly integration that connects TeXstudio with OpenAI's API. Watch this video to see it in action: ChatGPT_Macro_TeXstudio.mp4 □ How does it work Enhance your TeXstudio experience with the power of AI! These macros leverage OpenAI's technology to provide intelligent suggestions and improvements to your LaTeX documents. ![]()
0 Comments
Leave a Reply. |