Skip to content

Commit

Permalink
get observer cruise API
Browse files Browse the repository at this point in the history
  • Loading branch information
wintonzheng committed Dec 29, 2024
1 parent 4962dbe commit 7754599
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions skyvern/forge/sdk/routes/agent_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -1097,3 +1097,12 @@ async def observer_cruise(
max_iterations_override=x_max_iterations_override,
)
return observer_cruise


@base_router.get("/cruise/{observer_cruise_id}")
@base_router.get("/cruise/{observer_cruise_id}/", include_in_schema=False)
async def get_observer_cruise(
observer_cruise_id: str,
organization: Organization = Depends(org_auth_service.get_current_org),
) -> ObserverCruise:
return await observer_service.get_observer_cruise(observer_cruise_id, organization.organization_id)
4 changes: 4 additions & 0 deletions skyvern/forge/sdk/services/observer_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -919,3 +919,7 @@ async def _record_thought_screenshot(observer_thought: ObserverThought, workflow
artifact_type=ArtifactType.SCREENSHOT_LLM,
data=screenshot,
)


async def get_observer_cruise(observer_cruise_id: str, organization_id: str | None = None) -> ObserverCruise:
return await app.DATABASE.get_observer_cruise(observer_cruise_id, organization_id=organization_id)

0 comments on commit 7754599

Please sign in to comment.