Skip to content

Commit 2ede0a9

Browse files
feat: Add start_url
1 parent 44b4c5d commit 2ede0a9

File tree

5 files changed

+27
-24
lines changed

5 files changed

+27
-24
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 26
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browser-use%2Fbrowser-use-758a1c052b93e7e478fa650c1748f4b466653f44cb26f97fef1314c7a96924df.yml
3-
openapi_spec_hash: 9e0e99b613f2b9bf3993ac36aa0c7911
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browser-use%2Fbrowser-use-890b9140b139df6307d175ff31cba0bf14d703887bee2f0a8db9f5bffc78e11d.yml
3+
openapi_spec_hash: 7131a3daffe4f5b67bc1c7ccec06d961
44
config_hash: 9d52be5177b2ede4cb0633c04f4cc4ef

src/browser_use_sdk/resources/tasks.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,17 @@ def create(
113113
- 400: If session is stopped or already has a running task
114114
115115
Args:
116-
agent_settings: Configuration settings for the AI agent
116+
agent_settings: Configuration settings for the agent
117117
118-
Attributes: llm: The LLM model to use for the agent profile_id: Unique
119-
identifier of the agent profile to use for the task
118+
Attributes: llm: The LLM model to use for the agent start_url: Optional URL to
119+
start the agent on (will not be changed as a step) profile_id: Unique identifier
120+
of the agent profile to use for the task
120121
121122
browser_settings: Configuration settings for the browser session
122123
123124
Attributes: session_id: Unique identifier of existing session to continue
124-
profile_id: Unique identifier of browser profile to use save_browser_data:
125-
Whether to save browser state/data for the user to download later
125+
profile_id: Unique identifier of browser profile to use (use if you want to
126+
start a new session)
126127
127128
extra_headers: Send extra headers
128129
@@ -610,16 +611,17 @@ async def create(
610611
- 400: If session is stopped or already has a running task
611612
612613
Args:
613-
agent_settings: Configuration settings for the AI agent
614+
agent_settings: Configuration settings for the agent
614615
615-
Attributes: llm: The LLM model to use for the agent profile_id: Unique
616-
identifier of the agent profile to use for the task
616+
Attributes: llm: The LLM model to use for the agent start_url: Optional URL to
617+
start the agent on (will not be changed as a step) profile_id: Unique identifier
618+
of the agent profile to use for the task
617619
618620
browser_settings: Configuration settings for the browser session
619621
620622
Attributes: session_id: Unique identifier of existing session to continue
621-
profile_id: Unique identifier of browser profile to use save_browser_data:
622-
Whether to save browser state/data for the user to download later
623+
profile_id: Unique identifier of browser profile to use (use if you want to
624+
start a new session)
623625
624626
extra_headers: Send extra headers
625627

src/browser_use_sdk/types/task_create_params.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@ class TaskCreateParams(TypedDict, total=False):
1515
task: Required[str]
1616

1717
agent_settings: Annotated[AgentSettings, PropertyInfo(alias="agentSettings")]
18-
"""Configuration settings for the AI agent
18+
"""Configuration settings for the agent
1919
20-
Attributes: llm: The LLM model to use for the agent profile_id: Unique
21-
identifier of the agent profile to use for the task
20+
Attributes: llm: The LLM model to use for the agent start_url: Optional URL to
21+
start the agent on (will not be changed as a step) profile_id: Unique identifier
22+
of the agent profile to use for the task
2223
"""
2324

2425
browser_settings: Annotated[BrowserSettings, PropertyInfo(alias="browserSettings")]
2526
"""Configuration settings for the browser session
2627
2728
Attributes: session_id: Unique identifier of existing session to continue
28-
profile_id: Unique identifier of browser profile to use save_browser_data:
29-
Whether to save browser state/data for the user to download later
29+
profile_id: Unique identifier of browser profile to use (use if you want to
30+
start a new session)
3031
"""
3132

3233
included_file_names: Annotated[Optional[List[str]], PropertyInfo(alias="includedFileNames")]
@@ -43,10 +44,10 @@ class AgentSettings(TypedDict, total=False):
4344

4445
profile_id: Annotated[Optional[str], PropertyInfo(alias="profileId")]
4546

47+
start_url: Annotated[Optional[str], PropertyInfo(alias="startUrl")]
48+
4649

4750
class BrowserSettings(TypedDict, total=False):
4851
profile_id: Annotated[Optional[str], PropertyInfo(alias="profileId")]
4952

50-
save_browser_data: Annotated[bool, PropertyInfo(alias="saveBrowserData")]
51-
5253
session_id: Annotated[Optional[str], PropertyInfo(alias="sessionId")]

src/browser_use_sdk/types/task_view.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ class TaskView(BaseModel):
4545
"""View model for representing a session that a task belongs to
4646
4747
Attributes: id: Unique identifier for the session status: Current status of the
48-
session live_url: URL where the browser can be viewed live in real-time.
49-
started_at: Timestamp when the session was created and started. finished_at:
50-
Timestamp when the session was stopped (None if still active).
48+
session (active/stopped) live_url: URL where the browser can be viewed live in
49+
real-time. started_at: Timestamp when the session was created and started.
50+
finished_at: Timestamp when the session was stopped (None if still active).
5151
"""
5252

5353
session_id: str = FieldInfo(alias="sessionId")

tests/api_resources/test_tasks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ def test_method_create_with_all_params(self, client: BrowserUse) -> None:
4040
agent_settings={
4141
"llm": "gpt-4o",
4242
"profile_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
43+
"start_url": "startUrl",
4344
},
4445
browser_settings={
4546
"profile_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
46-
"save_browser_data": True,
4747
"session_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
4848
},
4949
included_file_names=["string"],
@@ -374,10 +374,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncBrowserUse
374374
agent_settings={
375375
"llm": "gpt-4o",
376376
"profile_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
377+
"start_url": "startUrl",
377378
},
378379
browser_settings={
379380
"profile_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
380-
"save_browser_data": True,
381381
"session_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
382382
},
383383
included_file_names=["string"],

0 commit comments

Comments
 (0)