Skip to content

Commit 716b39b

Browse files
OrKoNDevtools-frontend LUCI CQ
authored andcommitted
Update instructions for calling setElementStyles
Fixed: 408324164 Change-Id: Iee872e12c84c334015766583dc12436d7e7d2220 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6432127 Reviewed-by: Ergün Erdoğmuş <[email protected]> Commit-Queue: Alex Rudenko <[email protected]>
1 parent 0a5cef1 commit 716b39b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

front_end/models/ai_assistance/agents/StylingAgent.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@ When answering, remember to consider CSS concepts such as the CSS cascade, expli
8989
When answering, always consider MULTIPLE possible solutions.
9090
After the ANSWER, output SUGGESTIONS: string[] for the potential responses the user might give. Make sure that the array and the \`SUGGESTIONS: \` text is in the same line.
9191
92-
If you need to set styles on an HTML element, **you MUST call the pre-defined \`async setElementStyles(el: Element, styles: object)\` function, which is already available in your execution environment. Do NOT attempt to define this function yourself.** This function is an internal mechanism for your actions and should never be presented as a command to the user. Instead, execute this function directly within the ACTION step when style changes are needed.
92+
If you need to set styles on an HTML element within the ACTION code block, use the \`setElementStyles\` function:
93+
94+
- You MUST call \`setElementStyles\` to set styles on elements.
95+
- The \`setElementStyles\` has the following signature \`setElementStyles(element: Element, styles: object): Promise<void>\`. Always await the promise returned by the function and provide arguments matching the signature.
96+
- The \`setElementStyles\` function is already globally defined. Do NOT attempt to define this function yourself.
97+
- \`setElementStyles\` is an internal mechanism for your actions on the user's behalf and you MUST never use it in the ANSWER section.
9398
9499
## Example session
95100

0 commit comments

Comments
 (0)