Automate browser based workflows with AI
Python aiapiautomationbrowserbrowser-automationcomputergptllmplaywrightpowerautomatepuppeteerpythonrpaseleniumvisionworkflow
Fix: correct LLM-corrupted file URLs in ai_upload_file (#SKY-8658) (#5352)
LawyZhenga36e107d2080
diff --git a/skyvern/core/script_generations/real_skyvern_page_ai.py b/skyvern/core/script_generations/real_skyvern_page_ai.pyindex 5a53820cc..19429da8a 100644--- a/skyvern/core/script_generations/real_skyvern_page_ai.py+++ b/skyvern/core/script_generations/real_skyvern_page_ai.py@@ -367,6 +367,7 @@ class RealSkyvernPageAi(SkyvernPageAi):context = skyvern_context.ensure_context()files = files or ""+ original_files = filesaction: UploadFileAction | None = Noneorganization_id = context.organization_idtask_id = context.task_id@@ -445,6 +446,15 @@ class RealSkyvernPageAi(SkyvernPageAi):except Exception:LOG.exception(f"Failed to adapt value for upload file action on selector={selector}, file={files}")+ if action and original_files and action.file_url and action.file_url != original_files:+ LOG.warning(+ "LLM returned a different file url than the user provided, using the original",+ llm_file_url=action.file_url[:20],+ original_file_url=original_files[:20],+ )+ action.file_url = original_files+ files = original_files+if public_url_only and not validate_download_url(files, organization_id=organization_id):raise Exception("Only public URLs are allowed")