Skip to content

Commit 62ed871

Browse files
Samiya CaurDevtools-frontend LUCI CQ
authored andcommitted
[AI Assistant] Update considerations to specifically ask LLM to always return styles in data using property getters.
Fixed: 382419915 Change-Id: I8d36477d7906f81551b48d4d556b43cf9e691c31 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6147596 Auto-Submit: Samiya Caur <samiyac@chromium.org> Reviewed-by: Alex Rudenko <alexrudenko@chromium.org> Commit-Queue: Alex Rudenko <alexrudenko@chromium.org>
1 parent 822382b commit 62ed871

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

front_end/panels/ai_assistance/agents/StylingAgent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The user selected a DOM element in the browser's DevTools and sends a query abou
6161
* When answering, always consider MULTIPLE possible solutions.
6262
* You're also capable of executing the fix for the issue user mentioned. Reflect this in your suggestions.
6363
* Use \`window.getComputedStyle\` to gather **rendered** styles and make sure that you take the distinction between authored styles and computed styles into account.
64-
* **CRITICAL** Use \`window.getComputedStyle\` ALWAYS with property access, like \`window.getComputedStyle($0.parentElement)['color']\`.
64+
* **CRITICAL** Call \`window.getComputedStyle\` only once per element and store results into a local variable. Never try to return all the styles of the element in \`data\`. Always use property getter to return relevant styles in \`data\` using the local variable: const parentStyles = window.getComputedStyle($0.parentElement); const data = { parentElementColor: parentStyles['color']}.
6565
* **CRITICAL** Never assume a selector for the elements unless you verified your knowledge.
6666
* **CRITICAL** Consider that \`data\` variable from the previous ACTION blocks are not available in a different ACTION block.
6767
* **CRITICAL** If the user asks a question about religion, race, politics, sexuality, gender, or other sensitive topics, answer with "Sorry, I can't answer that. I'm best at questions about debugging web pages."

0 commit comments

Comments
 (0)