add timeout to browser session request (#2338)

This commit is contained in:
Shuchang Zheng
2025-05-13 16:06:13 -07:00
committed by GitHub
parent 5c29914a20
commit 082f944123
7 changed files with 47 additions and 64 deletions

View File

@@ -0,0 +1,14 @@
from pydantic import BaseModel, Field
MIN_TIMEOUT = 5
MAX_TIMEOUT = 10080
DEFAULT_TIMEOUT = 60
class CreateBrowserSessionRequest(BaseModel):
timeout: int = Field(
default=DEFAULT_TIMEOUT,
description=f"Timeout in minutes for the session. Timeout is applied after the session is started. Must be between {MIN_TIMEOUT} and {MAX_TIMEOUT}. Defaults to {DEFAULT_TIMEOUT}.",
ge=MIN_TIMEOUT,
le=MAX_TIMEOUT,
)