fix: use navigation_goal/data_extraction_goal for self-hosted Skyvern API

Cloud API uses 'prompt', self-hosted uses 'navigation_goal' and
'data_extraction_goal'. Pass them separately.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Christian Gick
2026-03-19 10:00:56 +02:00
parent 8862ed2596
commit ac0aefcfeb
2 changed files with 11 additions and 16 deletions

View File

@@ -42,20 +42,15 @@ async def execute_skyvern(config: dict, send_text=None, target_room: str = "", *
if not url or not goal:
raise ValueError("Skyvern step requires 'url' and 'goal' in config")
# Build prompt combining goal and extraction goal
prompt = goal
if data_extraction_goal:
prompt += f"\n\nExtract the following: {data_extraction_goal}"
payload: dict = {
"prompt": prompt,
"url": url,
"engine": "skyvern-v2",
"navigation_goal": goal,
"data_extraction_goal": data_extraction_goal or goal,
}
if extraction_schema:
if isinstance(extraction_schema, str):
extraction_schema = json.loads(extraction_schema)
payload["data_extraction_schema"] = extraction_schema
payload["extracted_information_schema"] = extraction_schema
if credential_id:
payload["credential_id"] = credential_id
if totp_identifier: