add fern doc for login sdk (#3014)
This commit is contained in:
@@ -24,8 +24,8 @@ from skyvern.webeye.schemas import BrowserSessionResponse
|
||||
"x-fern-sdk-method-name": "create_browser_session",
|
||||
"x-fern-examples": [{"code-samples": [{"sdk": "python", "code": CREATE_BROWSER_SESSION_CODE_SAMPLE}]}],
|
||||
},
|
||||
description="Create a new browser session",
|
||||
summary="Create a new browser session",
|
||||
description="Create a browser session that persists across multiple runs",
|
||||
summary="Create a session",
|
||||
responses={
|
||||
200: {"description": "Successfully created browser session"},
|
||||
403: {"description": "Unauthorized - Invalid or missing authentication"},
|
||||
@@ -54,8 +54,8 @@ async def create_browser_session(
|
||||
"x-fern-sdk-method-name": "close_browser_session",
|
||||
"x-fern-examples": [{"code-samples": [{"sdk": "python", "code": CLOSE_BROWSER_SESSION_CODE_SAMPLE}]}],
|
||||
},
|
||||
description="Close a browser session",
|
||||
summary="Close a browser session",
|
||||
description="Close a session. Once closed, the session cannot be used again.",
|
||||
summary="Close a session",
|
||||
responses={
|
||||
200: {"description": "Successfully closed browser session"},
|
||||
403: {"description": "Unauthorized - Invalid or missing authentication"},
|
||||
@@ -89,8 +89,8 @@ async def close_browser_session(
|
||||
"x-fern-sdk-method-name": "get_browser_session",
|
||||
"x-fern-examples": [{"code-samples": [{"sdk": "python", "code": GET_BROWSER_SESSION_CODE_SAMPLE}]}],
|
||||
},
|
||||
description="Get details about a specific browser session by ID",
|
||||
summary="Get browser session details",
|
||||
description="Get details about a specific browser session, including the browser address for cdp connection.",
|
||||
summary="Get a session",
|
||||
responses={
|
||||
200: {"description": "Successfully retrieved browser session details"},
|
||||
404: {"description": "Browser session not found"},
|
||||
@@ -127,7 +127,7 @@ async def get_browser_session(
|
||||
"x-fern-examples": [{"code-samples": [{"sdk": "python", "code": GET_BROWSER_SESSIONS_CODE_SAMPLE}]}],
|
||||
},
|
||||
description="Get all active browser sessions for the organization",
|
||||
summary="Get all active browser sessions",
|
||||
summary="Get active browser sessions",
|
||||
responses={
|
||||
200: {"description": "Successfully retrieved all active browser sessions"},
|
||||
403: {"description": "Unauthorized - Invalid or missing authentication"},
|
||||
|
||||
@@ -25,6 +25,11 @@ RETRY_RUN_WEBHOOK_CODE_SAMPLE = """from skyvern import Skyvern
|
||||
skyvern = Skyvern(api_key="YOUR_API_KEY")
|
||||
await skyvern.retry_run_webhook(run_id="tsk_v2_123")
|
||||
"""
|
||||
LOGIN_CODE_SAMPLE = """from skyvern import Skyvern
|
||||
|
||||
skyvern = Skyvern(api_key="YOUR_API_KEY")
|
||||
await skyvern.login(workflow_id="wpid_123", parameters={"parameter1": "value1", "parameter2": "value2"})
|
||||
"""
|
||||
|
||||
# Workflows
|
||||
CREATE_WORKFLOW_CODE_SAMPLE = """curl -X POST https://api.skyvern.com/v1/workflows \
|
||||
|
||||
@@ -7,6 +7,7 @@ from skyvern.config import settings
|
||||
from skyvern.exceptions import MissingBrowserAddressError
|
||||
from skyvern.forge import app
|
||||
from skyvern.forge.sdk.core import skyvern_context
|
||||
from skyvern.forge.sdk.routes.code_samples import LOGIN_CODE_SAMPLE
|
||||
from skyvern.forge.sdk.routes.routers import base_router
|
||||
from skyvern.forge.sdk.schemas.organizations import Organization
|
||||
from skyvern.forge.sdk.services import org_auth_service
|
||||
@@ -34,7 +35,14 @@ If login is completed, you're successful."""
|
||||
|
||||
@base_router.post(
|
||||
"/run/tasks/login",
|
||||
tags=["Agent"],
|
||||
response_model=WorkflowRunResponse,
|
||||
openapi_extra={
|
||||
"x-fern-sdk-method-name": "login",
|
||||
"x-fern-examples": [{"code-samples": [{"sdk": "python", "code": LOGIN_CODE_SAMPLE}]}],
|
||||
},
|
||||
description="Log in to a website using either credential stored in Skyvern, Bitwarden or 1Password",
|
||||
summary="Login Task",
|
||||
)
|
||||
async def login(
|
||||
request: Request,
|
||||
|
||||
Reference in New Issue
Block a user