diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c75b7e..da26607 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' diff --git a/.stats.yml b/.stats.yml index 532cadf..27e07db 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 84 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/droidrun%2Fdroidrun-cloud-7187108bdaaacaa810e3fa1ecd7da0b7242ac5361ad299a94c34cdf258c2735c.yml -openapi_spec_hash: 33fedb3f0532192e0e91196dd7c3da12 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/droidrun%2Fdroidrun-cloud-95a4ffa336c4635145ec6a8a114a1f38997f2cbc1bca80777fbcd91929d6d7f5.yml +openapi_spec_hash: 4fc5a0b864310d5f1e1d2a3093ecbbf9 config_hash: 6addf54d60509e5161fde56d48805e01 diff --git a/pyproject.toml b/pyproject.toml index 541564d..6b2c9ed 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ authors = [ dependencies = [ "httpx>=0.23.0, <1", "pydantic>=1.9.0, <3", - "typing-extensions>=4.10, <5", + "typing-extensions>=4.14, <5", "anyio>=3.5.0, <5", "distro>=1.7.0, <2", "sniffio", diff --git a/src/mobilerun/_compat.py b/src/mobilerun/_compat.py index 786ff42..e6690a4 100644 --- a/src/mobilerun/_compat.py +++ b/src/mobilerun/_compat.py @@ -2,7 +2,7 @@ from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload from datetime import date, datetime -from typing_extensions import Self, Literal +from typing_extensions import Self, Literal, TypedDict import pydantic from pydantic.fields import FieldInfo @@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str: return model.model_dump_json(indent=indent) +class _ModelDumpKwargs(TypedDict, total=False): + by_alias: bool + + def model_dump( model: pydantic.BaseModel, *, @@ -142,6 +146,9 @@ def model_dump( by_alias: bool | None = None, ) -> dict[str, Any]: if (not PYDANTIC_V1) or hasattr(model, "model_dump"): + kwargs: _ModelDumpKwargs = {} + if by_alias is not None: + kwargs["by_alias"] = by_alias return model.model_dump( mode=mode, exclude=exclude, @@ -149,7 +156,7 @@ def model_dump( exclude_defaults=exclude_defaults, # warnings are not supported in Pydantic v1 warnings=True if PYDANTIC_V1 else warnings, - by_alias=by_alias, + **kwargs, ) return cast( "dict[str, Any]", diff --git a/src/mobilerun/resources/tasks/tasks.py b/src/mobilerun/resources/tasks/tasks.py index 46fec7c..db5fe58 100644 --- a/src/mobilerun/resources/tasks/tasks.py +++ b/src/mobilerun/resources/tasks/tasks.py @@ -281,6 +281,7 @@ def run( output_schema: Optional[Dict[str, object]] | Omit = omit, reasoning: bool | Omit = omit, stealth: bool | Omit = omit, + subagent_model: str | Omit = omit, temperature: float | Omit = omit, vision: bool | Omit = omit, vpn_country: Optional[Literal["US", "BR", "FR", "DE", "IN", "JP", "KR", "ZA"]] | Omit = omit, @@ -304,6 +305,8 @@ def run( llm_model: The LLM model identifier to use for the task (e.g. 'google/gemini-3.1-flash-lite-preview') + subagent_model: LLM model used by sub-agent roles: executor, app_opener, structured_output + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -329,6 +332,7 @@ def run( "output_schema": output_schema, "reasoning": reasoning, "stealth": stealth, + "subagent_model": subagent_model, "temperature": temperature, "vision": vision, "vpn_country": vpn_country, @@ -357,6 +361,7 @@ def run_streamed( output_schema: Optional[Dict[str, object]] | Omit = omit, reasoning: bool | Omit = omit, stealth: bool | Omit = omit, + subagent_model: str | Omit = omit, temperature: float | Omit = omit, vision: bool | Omit = omit, vpn_country: Optional[Literal["US", "BR", "FR", "DE", "IN", "JP", "KR", "ZA"]] | Omit = omit, @@ -379,6 +384,8 @@ def run_streamed( llm_model: The LLM model identifier to use for the task (e.g. 'google/gemini-3.1-flash-lite-preview') + subagent_model: LLM model used by sub-agent roles: executor, app_opener, structured_output + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -404,6 +411,7 @@ def run_streamed( "output_schema": output_schema, "reasoning": reasoning, "stealth": stealth, + "subagent_model": subagent_model, "temperature": temperature, "vision": vision, "vpn_country": vpn_country, @@ -724,6 +732,7 @@ async def run( output_schema: Optional[Dict[str, object]] | Omit = omit, reasoning: bool | Omit = omit, stealth: bool | Omit = omit, + subagent_model: str | Omit = omit, temperature: float | Omit = omit, vision: bool | Omit = omit, vpn_country: Optional[Literal["US", "BR", "FR", "DE", "IN", "JP", "KR", "ZA"]] | Omit = omit, @@ -747,6 +756,8 @@ async def run( llm_model: The LLM model identifier to use for the task (e.g. 'google/gemini-3.1-flash-lite-preview') + subagent_model: LLM model used by sub-agent roles: executor, app_opener, structured_output + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -772,6 +783,7 @@ async def run( "output_schema": output_schema, "reasoning": reasoning, "stealth": stealth, + "subagent_model": subagent_model, "temperature": temperature, "vision": vision, "vpn_country": vpn_country, @@ -800,6 +812,7 @@ async def run_streamed( output_schema: Optional[Dict[str, object]] | Omit = omit, reasoning: bool | Omit = omit, stealth: bool | Omit = omit, + subagent_model: str | Omit = omit, temperature: float | Omit = omit, vision: bool | Omit = omit, vpn_country: Optional[Literal["US", "BR", "FR", "DE", "IN", "JP", "KR", "ZA"]] | Omit = omit, @@ -822,6 +835,8 @@ async def run_streamed( llm_model: The LLM model identifier to use for the task (e.g. 'google/gemini-3.1-flash-lite-preview') + subagent_model: LLM model used by sub-agent roles: executor, app_opener, structured_output + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -847,6 +862,7 @@ async def run_streamed( "output_schema": output_schema, "reasoning": reasoning, "stealth": stealth, + "subagent_model": subagent_model, "temperature": temperature, "vision": vision, "vpn_country": vpn_country, diff --git a/src/mobilerun/types/agent_list_response.py b/src/mobilerun/types/agent_list_response.py index ab2cece..fc366d6 100644 --- a/src/mobilerun/types/agent_list_response.py +++ b/src/mobilerun/types/agent_list_response.py @@ -25,6 +25,8 @@ class AgentListResponseItem(BaseModel): reasoning: bool + subagent_model: Optional[str] = FieldInfo(alias="subagentModel", default=None) + vision: bool diff --git a/src/mobilerun/types/devices/time_timezone_response.py b/src/mobilerun/types/devices/time_timezone_response.py index dfcf33d..7c5340f 100644 --- a/src/mobilerun/types/devices/time_timezone_response.py +++ b/src/mobilerun/types/devices/time_timezone_response.py @@ -10,7 +10,7 @@ class TimeTimezoneResponse(BaseModel): - timezone: str + timezone: Optional[str] = None schema_: Optional[str] = FieldInfo(alias="$schema", default=None) """A URL to the JSON Schema for this object.""" diff --git a/src/mobilerun/types/task.py b/src/mobilerun/types/task.py index c7d5de8..9a5eadc 100644 --- a/src/mobilerun/types/task.py +++ b/src/mobilerun/types/task.py @@ -57,6 +57,9 @@ class Task(BaseModel): steps: Optional[int] = None + subagent_model: Optional[str] = FieldInfo(alias="subagentModel", default=None) + """LLM model used by sub-agent roles: executor, app_opener, structured_output""" + succeeded: Optional[bool] = None temperature: Optional[float] = None diff --git a/src/mobilerun/types/task_run_params.py b/src/mobilerun/types/task_run_params.py index 854c9ad..f753c44 100644 --- a/src/mobilerun/types/task_run_params.py +++ b/src/mobilerun/types/task_run_params.py @@ -45,6 +45,9 @@ class TaskRunParams(TypedDict, total=False): stealth: bool + subagent_model: Annotated[str, PropertyInfo(alias="subagentModel")] + """LLM model used by sub-agent roles: executor, app_opener, structured_output""" + temperature: float vision: bool diff --git a/src/mobilerun/types/task_run_streamed_params.py b/src/mobilerun/types/task_run_streamed_params.py index dd65739..bf3a9a4 100644 --- a/src/mobilerun/types/task_run_streamed_params.py +++ b/src/mobilerun/types/task_run_streamed_params.py @@ -45,6 +45,9 @@ class TaskRunStreamedParams(TypedDict, total=False): stealth: bool + subagent_model: Annotated[str, PropertyInfo(alias="subagentModel")] + """LLM model used by sub-agent roles: executor, app_opener, structured_output""" + temperature: float vision: bool diff --git a/tests/api_resources/test_tasks.py b/tests/api_resources/test_tasks.py index ab86047..4d09336 100644 --- a/tests/api_resources/test_tasks.py +++ b/tests/api_resources/test_tasks.py @@ -265,6 +265,7 @@ def test_method_run_with_all_params(self, client: Mobilerun) -> None: output_schema={"foo": "bar"}, reasoning=True, stealth=True, + subagent_model="subagentModel", temperature=0, vision=True, vpn_country="US", @@ -330,6 +331,7 @@ def test_method_run_streamed_with_all_params(self, client: Mobilerun) -> None: output_schema={"foo": "bar"}, reasoning=True, stealth=True, + subagent_model="subagentModel", temperature=0, vision=True, vpn_country="US", @@ -698,6 +700,7 @@ async def test_method_run_with_all_params(self, async_client: AsyncMobilerun) -> output_schema={"foo": "bar"}, reasoning=True, stealth=True, + subagent_model="subagentModel", temperature=0, vision=True, vpn_country="US", @@ -763,6 +766,7 @@ async def test_method_run_streamed_with_all_params(self, async_client: AsyncMobi output_schema={"foo": "bar"}, reasoning=True, stealth=True, + subagent_model="subagentModel", temperature=0, vision=True, vpn_country="US",