diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 9aa540f7..6b7b74c5 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.4" + ".": "0.3.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index b120b664..93fe5d17 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 7 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-39cd9547d16412cf0568f6ce2ad8d43805dffe65bde830beeff630b903ae3b38.yml -openapi_spec_hash: 9cd7c9fefa686f9711392782d948470f -config_hash: 3c21550e2c94cad4339d3093d794beb0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-119383e808f394a7676e901bac8b97b6d7402d187d03452fd8d62b31d4085580.yml +openapi_spec_hash: 8a8d7be19d95f849098690863fe9a71a +config_hash: 1f709f8775e13029dc60064ef3a94355 diff --git a/CHANGELOG.md b/CHANGELOG.md index 989b483e..297a5680 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.3.0 (2026-01-12) + +Full Changelog: [v0.2.4...v0.3.0](https://github.com/browserbase/stagehand-python/compare/v0.2.4...v0.3.0) + +### Features + +* Removed requiring x-language and x-sdk-version from openapi spec ([618266f](https://github.com/browserbase/stagehand-python/commit/618266f3fe397a2d346fc1f3adaad225db443cdf)) +* Using provider/model syntax in modelName examples within openapi spec ([98d8ab9](https://github.com/browserbase/stagehand-python/commit/98d8ab97cb1115b9cff7f6e831b7dfa98e27f15a)) + ## 0.2.4 (2026-01-07) Full Changelog: [v0.2.3...v0.2.4](https://github.com/browserbase/stagehand-python/compare/v0.2.3...v0.2.4) diff --git a/pyproject.toml b/pyproject.toml index 2a7f591c..36781d10 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "stagehand-alpha" -version = "0.2.4" +version = "0.3.0" description = "The official Python library for the stagehand API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/stagehand/_version.py b/src/stagehand/_version.py index f26dd6ac..a162c62a 100644 --- a/src/stagehand/_version.py +++ b/src/stagehand/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "stagehand" -__version__ = "0.2.4" # x-release-please-version +__version__ = "0.3.0" # x-release-please-version diff --git a/src/stagehand/resources/sessions.py b/src/stagehand/resources/sessions.py index def9de51..22cdc0d2 100644 --- a/src/stagehand/resources/sessions.py +++ b/src/stagehand/resources/sessions.py @@ -77,8 +77,6 @@ def act( frame_id: str | Omit = omit, options: session_act_params.Options | Omit = omit, stream_response: Literal[False] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -101,10 +99,6 @@ def act( stream_response: Whether to stream the response via SSE - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -128,8 +122,6 @@ def act( stream_response: Literal[True], frame_id: str | Omit = omit, options: session_act_params.Options | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -152,10 +144,6 @@ def act( frame_id: Target frame ID for the action - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -179,8 +167,6 @@ def act( stream_response: bool, frame_id: str | Omit = omit, options: session_act_params.Options | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -203,10 +189,6 @@ def act( frame_id: Target frame ID for the action - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -230,8 +212,6 @@ def act( frame_id: str | Omit = omit, options: session_act_params.Options | Omit = omit, stream_response: Literal[False] | Literal[True] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -246,9 +226,7 @@ def act( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), @@ -279,8 +257,7 @@ def end( self, id: str, *, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, + _force_body: object | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -296,10 +273,6 @@ def end( Args: id: Unique session identifier - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -317,9 +290,7 @@ def end( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), @@ -343,8 +314,6 @@ def execute( execute_options: session_execute_params.ExecuteOptions, frame_id: str | Omit = omit, stream_response: Literal[False] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -364,10 +333,6 @@ def execute( stream_response: Whether to stream the response via SSE - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -391,8 +356,6 @@ def execute( execute_options: session_execute_params.ExecuteOptions, stream_response: Literal[True], frame_id: str | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -412,10 +375,6 @@ def execute( frame_id: Target frame ID for the agent - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -439,8 +398,6 @@ def execute( execute_options: session_execute_params.ExecuteOptions, stream_response: bool, frame_id: str | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -460,10 +417,6 @@ def execute( frame_id: Target frame ID for the agent - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -487,8 +440,6 @@ def execute( execute_options: session_execute_params.ExecuteOptions, frame_id: str | Omit = omit, stream_response: Literal[False] | Literal[True] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -503,9 +454,7 @@ def execute( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), @@ -542,8 +491,6 @@ def extract( options: session_extract_params.Options | Omit = omit, schema: Dict[str, object] | Omit = omit, stream_response: Literal[False] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -567,10 +514,6 @@ def extract( stream_response: Whether to stream the response via SSE - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -595,8 +538,6 @@ def extract( instruction: str | Omit = omit, options: session_extract_params.Options | Omit = omit, schema: Dict[str, object] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -620,10 +561,6 @@ def extract( schema: JSON Schema defining the structure of data to extract - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -648,8 +585,6 @@ def extract( instruction: str | Omit = omit, options: session_extract_params.Options | Omit = omit, schema: Dict[str, object] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -673,10 +608,6 @@ def extract( schema: JSON Schema defining the structure of data to extract - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -700,8 +631,6 @@ def extract( options: session_extract_params.Options | Omit = omit, schema: Dict[str, object] | Omit = omit, stream_response: Literal[False] | Literal[True] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -716,9 +645,7 @@ def extract( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), @@ -754,8 +681,6 @@ def navigate( frame_id: str | Omit = omit, options: session_navigate_params.Options | Omit = omit, stream_response: bool | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -777,10 +702,6 @@ def navigate( stream_response: Whether to stream the response via SSE - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -798,9 +719,7 @@ def navigate( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), @@ -832,8 +751,6 @@ def observe( instruction: str | Omit = omit, options: session_observe_params.Options | Omit = omit, stream_response: Literal[False] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -856,10 +773,6 @@ def observe( stream_response: Whether to stream the response via SSE - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -883,8 +796,6 @@ def observe( frame_id: str | Omit = omit, instruction: str | Omit = omit, options: session_observe_params.Options | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -907,10 +818,6 @@ def observe( instruction: Natural language instruction for what actions to find - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -934,8 +841,6 @@ def observe( frame_id: str | Omit = omit, instruction: str | Omit = omit, options: session_observe_params.Options | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -958,10 +863,6 @@ def observe( instruction: Natural language instruction for what actions to find - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -984,8 +885,6 @@ def observe( instruction: str | Omit = omit, options: session_observe_params.Options | Omit = omit, stream_response: Literal[False] | Literal[True] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1000,9 +899,7 @@ def observe( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), @@ -1043,8 +940,6 @@ def start( system_prompt: str | Omit = omit, verbose: Literal[0, 1, 2] | Omit = omit, wait_for_captcha_solves: bool | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1076,10 +971,6 @@ def start( wait_for_captcha_solves: Wait for captcha solves (deprecated, v2 only) - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -1095,9 +986,7 @@ def start( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), @@ -1157,8 +1046,6 @@ async def act( frame_id: str | Omit = omit, options: session_act_params.Options | Omit = omit, stream_response: Literal[False] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1181,10 +1068,6 @@ async def act( stream_response: Whether to stream the response via SSE - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -1208,8 +1091,6 @@ async def act( stream_response: Literal[True], frame_id: str | Omit = omit, options: session_act_params.Options | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1232,10 +1113,6 @@ async def act( frame_id: Target frame ID for the action - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -1259,8 +1136,6 @@ async def act( stream_response: bool, frame_id: str | Omit = omit, options: session_act_params.Options | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1283,10 +1158,6 @@ async def act( frame_id: Target frame ID for the action - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -1310,8 +1181,6 @@ async def act( frame_id: str | Omit = omit, options: session_act_params.Options | Omit = omit, stream_response: Literal[False] | Literal[True] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1326,9 +1195,7 @@ async def act( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), @@ -1359,8 +1226,7 @@ async def end( self, id: str, *, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, + _force_body: object | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1376,10 +1242,6 @@ async def end( Args: id: Unique session identifier - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -1397,9 +1259,7 @@ async def end( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), @@ -1423,8 +1283,6 @@ async def execute( execute_options: session_execute_params.ExecuteOptions, frame_id: str | Omit = omit, stream_response: Literal[False] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1444,10 +1302,6 @@ async def execute( stream_response: Whether to stream the response via SSE - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -1471,8 +1325,6 @@ async def execute( execute_options: session_execute_params.ExecuteOptions, stream_response: Literal[True], frame_id: str | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1492,10 +1344,6 @@ async def execute( frame_id: Target frame ID for the agent - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -1519,8 +1367,6 @@ async def execute( execute_options: session_execute_params.ExecuteOptions, stream_response: bool, frame_id: str | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1540,10 +1386,6 @@ async def execute( frame_id: Target frame ID for the agent - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -1567,8 +1409,6 @@ async def execute( execute_options: session_execute_params.ExecuteOptions, frame_id: str | Omit = omit, stream_response: Literal[False] | Literal[True] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1583,9 +1423,7 @@ async def execute( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), @@ -1622,8 +1460,6 @@ async def extract( options: session_extract_params.Options | Omit = omit, schema: Dict[str, object] | Omit = omit, stream_response: Literal[False] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1647,10 +1483,6 @@ async def extract( stream_response: Whether to stream the response via SSE - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -1675,8 +1507,6 @@ async def extract( instruction: str | Omit = omit, options: session_extract_params.Options | Omit = omit, schema: Dict[str, object] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1700,10 +1530,6 @@ async def extract( schema: JSON Schema defining the structure of data to extract - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -1728,8 +1554,6 @@ async def extract( instruction: str | Omit = omit, options: session_extract_params.Options | Omit = omit, schema: Dict[str, object] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1753,10 +1577,6 @@ async def extract( schema: JSON Schema defining the structure of data to extract - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -1780,8 +1600,6 @@ async def extract( options: session_extract_params.Options | Omit = omit, schema: Dict[str, object] | Omit = omit, stream_response: Literal[False] | Literal[True] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1796,9 +1614,7 @@ async def extract( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), @@ -1834,8 +1650,6 @@ async def navigate( frame_id: str | Omit = omit, options: session_navigate_params.Options | Omit = omit, stream_response: bool | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1857,10 +1671,6 @@ async def navigate( stream_response: Whether to stream the response via SSE - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -1878,9 +1688,7 @@ async def navigate( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), @@ -1912,8 +1720,6 @@ async def observe( instruction: str | Omit = omit, options: session_observe_params.Options | Omit = omit, stream_response: Literal[False] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1936,10 +1742,6 @@ async def observe( stream_response: Whether to stream the response via SSE - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -1963,8 +1765,6 @@ async def observe( frame_id: str | Omit = omit, instruction: str | Omit = omit, options: session_observe_params.Options | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -1987,10 +1787,6 @@ async def observe( instruction: Natural language instruction for what actions to find - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -2014,8 +1810,6 @@ async def observe( frame_id: str | Omit = omit, instruction: str | Omit = omit, options: session_observe_params.Options | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2038,10 +1832,6 @@ async def observe( instruction: Natural language instruction for what actions to find - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -2064,8 +1854,6 @@ async def observe( instruction: str | Omit = omit, options: session_observe_params.Options | Omit = omit, stream_response: Literal[False] | Literal[True] | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2080,9 +1868,7 @@ async def observe( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), @@ -2123,8 +1909,6 @@ async def start( system_prompt: str | Omit = omit, verbose: Literal[0, 1, 2] | Omit = omit, wait_for_captcha_solves: bool | Omit = omit, - x_language: Literal["typescript", "python", "playground"] | Omit = omit, - x_sdk_version: str | Omit = omit, x_sent_at: Union[str, datetime] | Omit = omit, x_stream_response: Literal["true", "false"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -2156,10 +1940,6 @@ async def start( wait_for_captcha_solves: Wait for captcha solves (deprecated, v2 only) - x_language: Client SDK language - - x_sdk_version: Version of the Stagehand SDK - x_sent_at: ISO timestamp when request was sent x_stream_response: Whether to stream the response via SSE @@ -2175,9 +1955,7 @@ async def start( extra_headers = { **strip_not_given( { - "x-language": str(x_language) if is_given(x_language) else not_given, - "x-sdk-version": x_sdk_version, - "x-sent-at": _format_x_sent_at(x_sent_at), + "x-sent-at": x_sent_at.isoformat() if is_given(x_sent_at) else not_given, "x-stream-response": str(x_stream_response) if is_given(x_stream_response) else not_given, } ), diff --git a/src/stagehand/types/model_config_param.py b/src/stagehand/types/model_config_param.py index 8d3df0ef..f633db12 100644 --- a/src/stagehand/types/model_config_param.py +++ b/src/stagehand/types/model_config_param.py @@ -12,7 +12,7 @@ class ModelConfigObject(TypedDict, total=False): model_name: Required[Annotated[str, PropertyInfo(alias="modelName")]] - """Model name string without prefix (e.g., 'gpt-5-nano', 'claude-4.5-opus')""" + """Model name string (e.g., 'openai/gpt-5-nano', 'anthropic/claude-4.5-opus')""" api_key: Annotated[str, PropertyInfo(alias="apiKey")] """API key for the model provider""" diff --git a/src/stagehand/types/session_act_params.py b/src/stagehand/types/session_act_params.py index 153ac6c8..605019b8 100644 --- a/src/stagehand/types/session_act_params.py +++ b/src/stagehand/types/session_act_params.py @@ -22,12 +22,6 @@ class SessionActParamsBase(TypedDict, total=False): options: Options - x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")] - """Client SDK language""" - - x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")] - """Version of the Stagehand SDK""" - x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")] """ISO timestamp when request was sent""" diff --git a/src/stagehand/types/session_end_params.py b/src/stagehand/types/session_end_params.py index defdf60a..1998cd27 100644 --- a/src/stagehand/types/session_end_params.py +++ b/src/stagehand/types/session_end_params.py @@ -14,12 +14,6 @@ class SessionEndParams(TypedDict, total=False): _force_body: Annotated[object, PropertyInfo(alias="_forceBody")] - x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")] - """Client SDK language""" - - x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")] - """Version of the Stagehand SDK""" - x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")] """ISO timestamp when request was sent""" diff --git a/src/stagehand/types/session_execute_params.py b/src/stagehand/types/session_execute_params.py index 794181d7..eb8678ff 100644 --- a/src/stagehand/types/session_execute_params.py +++ b/src/stagehand/types/session_execute_params.py @@ -26,12 +26,6 @@ class SessionExecuteParamsBase(TypedDict, total=False): frame_id: Annotated[str, PropertyInfo(alias="frameId")] """Target frame ID for the agent""" - x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")] - """Client SDK language""" - - x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")] - """Version of the Stagehand SDK""" - x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")] """ISO timestamp when request was sent""" diff --git a/src/stagehand/types/session_extract_params.py b/src/stagehand/types/session_extract_params.py index c18800f8..c763cbb5 100644 --- a/src/stagehand/types/session_extract_params.py +++ b/src/stagehand/types/session_extract_params.py @@ -24,12 +24,6 @@ class SessionExtractParamsBase(TypedDict, total=False): schema: Dict[str, object] """JSON Schema defining the structure of data to extract""" - x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")] - """Client SDK language""" - - x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")] - """Version of the Stagehand SDK""" - x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")] """ISO timestamp when request was sent""" diff --git a/src/stagehand/types/session_navigate_params.py b/src/stagehand/types/session_navigate_params.py index 59a86eae..39bb2b2e 100644 --- a/src/stagehand/types/session_navigate_params.py +++ b/src/stagehand/types/session_navigate_params.py @@ -23,12 +23,6 @@ class SessionNavigateParams(TypedDict, total=False): stream_response: Annotated[bool, PropertyInfo(alias="streamResponse")] """Whether to stream the response via SSE""" - x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")] - """Client SDK language""" - - x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")] - """Version of the Stagehand SDK""" - x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")] """ISO timestamp when request was sent""" diff --git a/src/stagehand/types/session_observe_params.py b/src/stagehand/types/session_observe_params.py index 9d18b185..7cad4c85 100644 --- a/src/stagehand/types/session_observe_params.py +++ b/src/stagehand/types/session_observe_params.py @@ -21,12 +21,6 @@ class SessionObserveParamsBase(TypedDict, total=False): options: Options - x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")] - """Client SDK language""" - - x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")] - """Version of the Stagehand SDK""" - x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")] """ISO timestamp when request was sent""" diff --git a/src/stagehand/types/session_start_params.py b/src/stagehand/types/session_start_params.py index 479d1fef..03735673 100644 --- a/src/stagehand/types/session_start_params.py +++ b/src/stagehand/types/session_start_params.py @@ -61,12 +61,6 @@ class SessionStartParams(TypedDict, total=False): wait_for_captcha_solves: Annotated[bool, PropertyInfo(alias="waitForCaptchaSolves")] """Wait for captcha solves (deprecated, v2 only)""" - x_language: Annotated[Literal["typescript", "python", "playground"], PropertyInfo(alias="x-language")] - """Client SDK language""" - - x_sdk_version: Annotated[str, PropertyInfo(alias="x-sdk-version")] - """Version of the Stagehand SDK""" - x_sent_at: Annotated[Union[str, datetime], PropertyInfo(alias="x-sent-at", format="iso8601")] """ISO timestamp when request was sent""" diff --git a/tests/api_resources/test_sessions.py b/tests/api_resources/test_sessions.py index daef296d..473a917d 100644 --- a/tests/api_resources/test_sessions.py +++ b/tests/api_resources/test_sessions.py @@ -48,8 +48,6 @@ def test_method_act_with_all_params_overload_1(self, client: Stagehand) -> None: "variables": {"username": "john_doe"}, }, stream_response=False, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -115,8 +113,6 @@ def test_method_act_with_all_params_overload_2(self, client: Stagehand) -> None: "timeout": 30000, "variables": {"username": "john_doe"}, }, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -174,8 +170,7 @@ def test_method_end(self, client: Stagehand) -> None: def test_method_end_with_all_params(self, client: Stagehand) -> None: session = client.sessions.end( id="c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123", - x_language="typescript", - x_sdk_version="3.0.6", + _force_body={}, x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -245,8 +240,6 @@ def test_method_execute_with_all_params_overload_1(self, client: Stagehand) -> N }, frame_id="frameId", stream_response=False, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -329,8 +322,6 @@ def test_method_execute_with_all_params_overload_2(self, client: Stagehand) -> N }, stream_response=True, frame_id="frameId", - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -406,8 +397,6 @@ def test_method_extract_with_all_params_overload_1(self, client: Stagehand) -> N }, schema={"foo": "bar"}, stream_response=False, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -470,8 +459,6 @@ def test_method_extract_with_all_params_overload_2(self, client: Stagehand) -> N "timeout": 30000, }, schema={"foo": "bar"}, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -535,8 +522,6 @@ def test_method_navigate_with_all_params(self, client: Stagehand) -> None: "wait_until": "networkidle", }, stream_response=True, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -600,8 +585,6 @@ def test_method_observe_with_all_params_overload_1(self, client: Stagehand) -> N "timeout": 30000, }, stream_response=False, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -663,8 +646,6 @@ def test_method_observe_with_all_params_overload_2(self, client: Stagehand) -> N "selector": "nav", "timeout": 30000, }, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -710,7 +691,7 @@ def test_path_params_observe_overload_2(self, client: Stagehand) -> None: @parametrize def test_method_start(self, client: Stagehand) -> None: session = client.sessions.start( - model_name="gpt-4o", + model_name="openai/gpt-4o", ) assert_matches_type(SessionStartResponse, session, path=["response"]) @@ -718,7 +699,7 @@ def test_method_start(self, client: Stagehand) -> None: @parametrize def test_method_start_with_all_params(self, client: Stagehand) -> None: session = client.sessions.start( - model_name="gpt-4o", + model_name="openai/gpt-4o", act_timeout_ms=0, browser={ "cdp_url": "ws://localhost:9222", @@ -797,8 +778,6 @@ def test_method_start_with_all_params(self, client: Stagehand) -> None: system_prompt="systemPrompt", verbose=1, wait_for_captcha_solves=True, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -808,7 +787,7 @@ def test_method_start_with_all_params(self, client: Stagehand) -> None: @parametrize def test_raw_response_start(self, client: Stagehand) -> None: response = client.sessions.with_raw_response.start( - model_name="gpt-4o", + model_name="openai/gpt-4o", ) assert response.is_closed is True @@ -820,7 +799,7 @@ def test_raw_response_start(self, client: Stagehand) -> None: @parametrize def test_streaming_response_start(self, client: Stagehand) -> None: with client.sessions.with_streaming_response.start( - model_name="gpt-4o", + model_name="openai/gpt-4o", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" @@ -858,8 +837,6 @@ async def test_method_act_with_all_params_overload_1(self, async_client: AsyncSt "variables": {"username": "john_doe"}, }, stream_response=False, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -925,8 +902,6 @@ async def test_method_act_with_all_params_overload_2(self, async_client: AsyncSt "timeout": 30000, "variables": {"username": "john_doe"}, }, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -984,8 +959,7 @@ async def test_method_end(self, async_client: AsyncStagehand) -> None: async def test_method_end_with_all_params(self, async_client: AsyncStagehand) -> None: session = await async_client.sessions.end( id="c4dbf3a9-9a58-4b22-8a1c-9f20f9f9e123", - x_language="typescript", - x_sdk_version="3.0.6", + _force_body={}, x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -1055,8 +1029,6 @@ async def test_method_execute_with_all_params_overload_1(self, async_client: Asy }, frame_id="frameId", stream_response=False, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -1139,8 +1111,6 @@ async def test_method_execute_with_all_params_overload_2(self, async_client: Asy }, stream_response=True, frame_id="frameId", - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -1216,8 +1186,6 @@ async def test_method_extract_with_all_params_overload_1(self, async_client: Asy }, schema={"foo": "bar"}, stream_response=False, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -1280,8 +1248,6 @@ async def test_method_extract_with_all_params_overload_2(self, async_client: Asy "timeout": 30000, }, schema={"foo": "bar"}, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -1345,8 +1311,6 @@ async def test_method_navigate_with_all_params(self, async_client: AsyncStagehan "wait_until": "networkidle", }, stream_response=True, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -1410,8 +1374,6 @@ async def test_method_observe_with_all_params_overload_1(self, async_client: Asy "timeout": 30000, }, stream_response=False, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -1473,8 +1435,6 @@ async def test_method_observe_with_all_params_overload_2(self, async_client: Asy "selector": "nav", "timeout": 30000, }, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -1520,7 +1480,7 @@ async def test_path_params_observe_overload_2(self, async_client: AsyncStagehand @parametrize async def test_method_start(self, async_client: AsyncStagehand) -> None: session = await async_client.sessions.start( - model_name="gpt-4o", + model_name="openai/gpt-4o", ) assert_matches_type(SessionStartResponse, session, path=["response"]) @@ -1528,7 +1488,7 @@ async def test_method_start(self, async_client: AsyncStagehand) -> None: @parametrize async def test_method_start_with_all_params(self, async_client: AsyncStagehand) -> None: session = await async_client.sessions.start( - model_name="gpt-4o", + model_name="openai/gpt-4o", act_timeout_ms=0, browser={ "cdp_url": "ws://localhost:9222", @@ -1607,8 +1567,6 @@ async def test_method_start_with_all_params(self, async_client: AsyncStagehand) system_prompt="systemPrompt", verbose=1, wait_for_captcha_solves=True, - x_language="typescript", - x_sdk_version="3.0.6", x_sent_at=parse_datetime("2025-01-15T10:30:00Z"), x_stream_response="true", ) @@ -1618,7 +1576,7 @@ async def test_method_start_with_all_params(self, async_client: AsyncStagehand) @parametrize async def test_raw_response_start(self, async_client: AsyncStagehand) -> None: response = await async_client.sessions.with_raw_response.start( - model_name="gpt-4o", + model_name="openai/gpt-4o", ) assert response.is_closed is True @@ -1630,7 +1588,7 @@ async def test_raw_response_start(self, async_client: AsyncStagehand) -> None: @parametrize async def test_streaming_response_start(self, async_client: AsyncStagehand) -> None: async with async_client.sessions.with_streaming_response.start( - model_name="gpt-4o", + model_name="openai/gpt-4o", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" diff --git a/tests/test_client.py b/tests/test_client.py index b1d79c7a..b04449bf 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -891,7 +891,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter, clien respx_mock.post("/v1/sessions/start").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - client.sessions.with_streaming_response.start(model_name="gpt-4o").__enter__() + client.sessions.with_streaming_response.start(model_name="openai/gpt-4o").__enter__() assert _get_open_connections(client) == 0 @@ -901,7 +901,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter, client respx_mock.post("/v1/sessions/start").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - client.sessions.with_streaming_response.start(model_name="gpt-4o").__enter__() + client.sessions.with_streaming_response.start(model_name="openai/gpt-4o").__enter__() assert _get_open_connections(client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @@ -930,7 +930,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/v1/sessions/start").mock(side_effect=retry_handler) - response = client.sessions.with_raw_response.start(model_name="gpt-4o") + response = client.sessions.with_raw_response.start(model_name="openai/gpt-4o") assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -955,7 +955,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/v1/sessions/start").mock(side_effect=retry_handler) response = client.sessions.with_raw_response.start( - model_name="gpt-4o", extra_headers={"x-stainless-retry-count": Omit()} + model_name="openai/gpt-4o", extra_headers={"x-stainless-retry-count": Omit()} ) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -980,7 +980,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/v1/sessions/start").mock(side_effect=retry_handler) response = client.sessions.with_raw_response.start( - model_name="gpt-4o", extra_headers={"x-stainless-retry-count": "42"} + model_name="openai/gpt-4o", extra_headers={"x-stainless-retry-count": "42"} ) assert response.http_request.headers.get("x-stainless-retry-count") == "42" @@ -1870,7 +1870,7 @@ async def test_retrying_timeout_errors_doesnt_leak( respx_mock.post("/v1/sessions/start").mock(side_effect=httpx.TimeoutException("Test timeout error")) with pytest.raises(APITimeoutError): - await async_client.sessions.with_streaming_response.start(model_name="gpt-4o").__aenter__() + await async_client.sessions.with_streaming_response.start(model_name="openai/gpt-4o").__aenter__() assert _get_open_connections(async_client) == 0 @@ -1882,7 +1882,7 @@ async def test_retrying_status_errors_doesnt_leak( respx_mock.post("/v1/sessions/start").mock(return_value=httpx.Response(500)) with pytest.raises(APIStatusError): - await async_client.sessions.with_streaming_response.start(model_name="gpt-4o").__aenter__() + await async_client.sessions.with_streaming_response.start(model_name="openai/gpt-4o").__aenter__() assert _get_open_connections(async_client) == 0 @pytest.mark.parametrize("failures_before_success", [0, 2, 4]) @@ -1911,7 +1911,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/v1/sessions/start").mock(side_effect=retry_handler) - response = await client.sessions.with_raw_response.start(model_name="gpt-4o") + response = await client.sessions.with_raw_response.start(model_name="openai/gpt-4o") assert response.retries_taken == failures_before_success assert int(response.http_request.headers.get("x-stainless-retry-count")) == failures_before_success @@ -1936,7 +1936,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/v1/sessions/start").mock(side_effect=retry_handler) response = await client.sessions.with_raw_response.start( - model_name="gpt-4o", extra_headers={"x-stainless-retry-count": Omit()} + model_name="openai/gpt-4o", extra_headers={"x-stainless-retry-count": Omit()} ) assert len(response.http_request.headers.get_list("x-stainless-retry-count")) == 0 @@ -1961,7 +1961,7 @@ def retry_handler(_request: httpx.Request) -> httpx.Response: respx_mock.post("/v1/sessions/start").mock(side_effect=retry_handler) response = await client.sessions.with_raw_response.start( - model_name="gpt-4o", extra_headers={"x-stainless-retry-count": "42"} + model_name="openai/gpt-4o", extra_headers={"x-stainless-retry-count": "42"} ) assert response.http_request.headers.get("x-stainless-retry-count") == "42"