fix observer cruise schema (#1551)

This commit is contained in:
Shuchang Zheng
2025-01-14 13:21:08 -08:00
committed by GitHub
parent 4509ce741a
commit e4ad2ff6ca
2 changed files with 15 additions and 6 deletions

View File

@@ -2,9 +2,10 @@ from datetime import datetime
from enum import StrEnum
from typing import Any
from pydantic import BaseModel, ConfigDict, HttpUrl, field_validator
from pydantic import BaseModel, ConfigDict, field_validator
from skyvern.forge.sdk.core.validators import validate_url
from skyvern.forge.sdk.schemas.tasks import ProxyLocation
DEFAULT_WORKFLOW_TITLE = "New Workflow"
@@ -30,13 +31,25 @@ class ObserverCruise(BaseModel):
workflow_id: str | None = None
workflow_permanent_id: str | None = None
prompt: str | None = None
url: HttpUrl | None = None
url: str | None = None
summary: str | None = None
output: dict[str, Any] | list | str | None = None
totp_verification_url: str | None = None
totp_identifier: str | None = None
proxy_location: ProxyLocation | None = None
webhook_callback_url: str | None = None
created_at: datetime
modified_at: datetime
@field_validator("url", "webhook_callback_url", "totp_verification_url")
@classmethod
def validate_urls(cls, url: str | None) -> str | None:
if url is None:
return None
return validate_url(url)
class ObserverThoughtType(StrEnum):
plan = "plan"

View File

@@ -391,10 +391,6 @@ async def run_observer_cruise_helper(
output={"task_type": task_type, "user_goal_achieved": user_goal_achieved},
)
if not plan:
LOG.warning("No plan found in observer response", observer_response=observer_response)
continue
if user_goal_achieved is True:
LOG.info(
"User goal achieved. Workflow run will complete. Observer is stopping",