fix generate error code bug (#3416)

This commit is contained in:
LawyZheng
2025-09-12 11:13:13 +08:00
committed by GitHub
parent f1aa653b82
commit 907a530b26
2 changed files with 3 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ Do not return any error that's not defined by the user.
Reply in JSON format with the following keys:
{
"reasoning": str, // A string to explain the reason for inferring the result.
"errors": array // A list of errors. If no error description suits the current situation on the screenshots, return an empty list. You are allowed to return multiple errors if there are multiple errors on the page.
[{
"error_code": str, // The error code from the user's error code list

View File

@@ -3736,8 +3736,8 @@ async def extract_user_defined_errors(task: Task, step: Step, scraped_page: Scra
navigation_goal=task.navigation_goal,
navigation_payload_str=json.dumps(task.navigation_payload),
elements=scraped_page_refreshed.build_element_tree(fmt=ElementTreeFormat.HTML),
current_url=task.url,
error_code_mapping_str=json.dumps(task.error_code_mapping) if task.error_code_mapping else {},
current_url=scraped_page_refreshed.url,
error_code_mapping_str=json.dumps(task.error_code_mapping) if task.error_code_mapping else "{}",
local_datetime=datetime.now(skyvern_context.ensure_context().tz_info).isoformat(),
)
json_response = await app.EXTRACTION_LLM_API_HANDLER(