Google AI Studio Auto System Instructions

Automatically fill system instructions for new chats in Google AI Studio

Автор
Altron
Щоденних встановлень
0
Всього встановлень
0
Рейтинги
0 0 0
Версія
1.0
Створено
25.04.2025
Оновлено
25.04.2025
Size
4,2 кБ
Ліцензія
MIT
Відноситься до

Automatically fills system instructions for new chats in Google AI Studio.

THE INSTRUCTION STRING NEEDS TO BE CHANGED WITHIN THE SCRIPT.

Lifehack: ALWAYS check ANY user scripts you install for malware. Just paste the code into an AI chat and ask.

For your consideration, this script was made entirely by AI. Prompt to one-shot it: Please create a userscript that would automatically fill "custom instructions" (the system prompt) for any new chats in Google AI Studio. System instructions text area in current version of AI studio UI is hidden by default (and cannot be selected), to make it visible, you have to click document.querySelector('div.toolbar-container > div:nth-child(2) > button'), then wait for document.querySelector('textarea[aria-label="System instructions"]') to become selectable, select, then change its value, then hide it again by clicking the same button. The system prompt should only be filled when 1. it is empty; 2. a NEW chat has been opened (we need to remember old chat ids with localstorage). When a new chat opens, Studio updates the page URL to https://aistudio.google.com/app/prompts/[new chat id] Take into account that not all AI models support custom instructions, so sometimes we will fail to do this. It shouldn't break the script.