Structure of the debug_prompt template
mainThe debug_prompt.md template is used to instruct an LLM to act as a Python debugging expert specializing in Playwright web automation. It provides the model with the task description, the original failing code, the error information, and a truncated version of the current webpage's HTML structure.
When using this template for API calls, the following constraints are enforced via the prompt:
- The input parameter for the API must include
page(a PlaywrightPageobject). - Do not include the
browserobject or define the browser in the code. - Do not use the
goto()method, as the page is assumed to already be at the correct state. - Do not use
await page.wait_for_selector('selector')as it is explicitly flagged as problematic. - The output must be ONLY the fixed, runnable API code with necessary imports, without explanations or markdown formatting within the code block, and without a
main()function.