Act as an expert software developer. Always use best practices when coding.…
- User
User: Act as an expert software developer. Always use best practices when coding. Respect and use existing conventions, libraries, etc that are already present in the code base. You have access to tools, but only use them when necessary. If a tool is not required, respond as normal. If you have information that you don't know, please proactively use the tools provided by users! Especially the web search tool.
Use the appropriate shell based on the user's system info:
- Platform: Linux-6.13.1-arch1-1-x86_64
- Shell: /usr/bin/zsh
- Language: en_US.UTF-8
- Current date: 2025-02-06
- Project root: /home/q/dotfiles
- The user is operating inside a git repository
Take requests for changes to the supplied code. If the request is ambiguous, ask questions.
Always reply to the user in the same language they are using.
Once you understand the request you MUST:
- Decide if you need to propose SEARCH/REPLACE edits to any files that haven't been added to the chat. You can create new files without asking!
But if you need to propose edits to existing files not already added to the chat, you MUST tell the user their full path names and ask them to add the files to the chat. End your reply and wait for their approval. You can keep asking if you then decide you need to edit more files.
-
Think step-by-step and explain the needed changes in a few short sentences.
-
Describe each change with a SEARCH/REPLACE block per the examples below.
All changes to files must use this SEARCH/REPLACE block format. ONLY EVER RETURN CODE IN A SEARCH/REPLACE BLOCK!
Example conversations:
USER: Change get_factorial() to use math.factorial
ASSISTANT: To make this change we need to modify
mathweb/flask/app.pyto:- Import the math package.
- Remove the existing factorial() function.
- Update get_factorial() to call math.factorial instead.
Here are the SEARCH/REPLACE blocks:
mathweb/flask/app.py
mathweb/flask/app.py
codeif n == 0: return 1 else: return n * factorial(n-1)mathweb/flask/app.py
USER: Refactor hello() into its own file.
ASSISTANT: To make this change we need to modify
main.pyand make a new filehello.py: - Assistant
Чтобы ускорить работу скрипта
rofi-gpt.sh, можно внести следующие улучшения:- Использовать
curlс флагом--compressed, чтобы сжать ответ от сервера и повысить скорость передачи данных. - Параллельно выполнять запрос с
curlи обработку ответа с помощьюjq, если есть возможность, уменьшив время ожидания.
Поскольку изменения коснутся одного файла, вот как можно их внести в
rofi/.config/rofi/launchers/type-3/rofi-gpt.sh:Вот соответствующие SEARCH/REPLACE блоки:
rofi/.config/rofi/launchers/type-3/rofi-gpt.sh
После внесения этих изменений, скрипт должен работать быстрее за счет уменьшения объема передаваемых данных.
Подтвердите, пожалуйста, что хотите внести эти изменения.
- Использовать