The AgentConfigBuilder provides a fluent interface for configuring agent behavior, device connections, and server settings.
from minitap.mobile_use.sdk.builders import Builders
# Access the builder
config_builder = Builders.AgentConfig
Methods
for_device
Specify a target device instead of auto-detection.
def for_device (
self ,
platform : DevicePlatform,
device_id : str
) -> AgentConfigBuilder
Device platform (DevicePlatform.ANDROID or DevicePlatform.IOS)
Device identifier (from adb devices or idevice_id -l)
from minitap.mobile_use.sdk.types import DevicePlatform
config = (
Builders.AgentConfig
.for_device( platform = DevicePlatform. ANDROID , device_id = "emulator-5554" )
.build()
)
for_cloud_mobile
Configure the agent to use a cloud mobile (virtual device hosted on Minitap Platform).
When using a cloud mobile, all agentic logic runs in the cloud, and tasks are executed remotely via the Platform API.
def for_cloud_mobile (
self ,
cloud_mobile_id_or_ref : str
) -> AgentConfigBuilder
The cloud mobile identifier. Can be either:
UUID (e.g., "550e8400-e29b-41d4-a716-446655440000")
Reference name (e.g., "my-test-device")
Example with UUID
config = (
Builders.AgentConfig
.for_cloud_mobile( cloud_mobile_id_or_ref = "550e8400-e29b-41d4-a716-446655440000" )
.build()
)
agent = Agent( config = config)
await agent.init( api_key = "your-minitap-api-key" )
Example with Reference Name
config = (
Builders.AgentConfig
.for_cloud_mobile( cloud_mobile_id_or_ref = "my-test-device" )
.build()
)
agent = Agent( config = config)
await agent.init( api_key = "your-minitap-api-key" )
Important Notes:
for_cloud_mobile() and for_device() are mutually exclusive
Cloud mobiles require a Minitap API key (passed to agent.init() or via MINITAP_API_KEY env var)
Cloud mobiles only support PlatformTaskRequest (not TaskRequest)
No local setup required - no ADB, idb, or local servers needed
Cloud mobiles are ideal when you want:
No local device setup or maintenance
Centralized execution and monitoring via Minitap Platform
Scalable automation without managing infrastructure
add_profile
Add a single agent profile.
def add_profile ( self , profile : AgentProfile) -> AgentConfigBuilder
from minitap.mobile_use.sdk.types import AgentProfile
profile = AgentProfile( name = "fast" , from_file = "fast-config.jsonc" )
config = Builders.AgentConfig.add_profile(profile).build()
add_profiles
Add multiple agent profiles at once.
def add_profiles ( self , profiles : list[AgentProfile]) -> AgentConfigBuilder
profiles = [
AgentProfile( name = "fast" , from_file = "fast.jsonc" ),
AgentProfile( name = "accurate" , from_file = "accurate.jsonc" )
]
config = Builders.AgentConfig.add_profiles(profiles).build()
with_default_profile
Set the default agent profile used for tasks.
def with_default_profile (
self ,
profile : str | AgentProfile
) -> AgentConfigBuilder
profile
str | AgentProfile
required
Profile name (if already added) or AgentProfile instance
profile = AgentProfile( name = "default" , from_file = "llm-config.defaults.jsonc" )
config = (
Builders.AgentConfig
.with_default_profile(profile)
.build()
)
with_adb_server
Set the ADB server host and port.
def with_adb_server (
self ,
host : str ,
port : int | None = None
) -> AgentConfigBuilder
ADB server port (default: 5037)
config = (
Builders.AgentConfig
.with_adb_server( host = "localhost" , port = 5037 )
.build()
)
with_default_task_config
Set default configuration for all tasks created by the agent.
def with_default_task_config (
self ,
config : TaskRequestCommon
) -> AgentConfigBuilder
# Create task defaults
task_defaults = (
Builders.TaskDefaults
.with_max_steps( 500 )
.build()
)
# Apply to agent
config = (
Builders.AgentConfig
.with_default_task_config(task_defaults)
.build()
)
Enable video recording tools (start_video_recording, stop_video_recording).
When enabled, the agent can record the device screen and analyze video content using Gemini models. This is useful for transcribing video content playing on the screen.
def with_video_recording_tools ( self ) -> AgentConfigBuilder
Requirements:
ffmpeg must be installed on the system (for video compression)
A video-capable model must be configured in utils.video_analyzer
Supported models for video_analyzer:
gemini-3-flash-preview (recommended)
gemini-3-pro-preview
gemini-2.5-flash
gemini-2.5-pro
gemini-2.0-flash
from minitap.mobile_use.config import LLM , LLMConfig, LLMConfigUtils, LLMWithFallback
# Create profile with video_analyzer configured
profile = AgentProfile(
name = "video_capable" ,
llm_config = LLMConfig(
planner = LLMWithFallback( ... ),
orchestrator = LLMWithFallback( ... ),
cortex = LLMWithFallback( ... ),
executor = LLMWithFallback( ... ),
utils = LLMConfigUtils(
outputter = LLMWithFallback( ... ),
hopper = LLMWithFallback( ... ),
# Required for video recording tools
video_analyzer = LLMWithFallback(
provider = "google" ,
model = "gemini-3-flash-preview" ,
fallback = LLM( provider = "google" , model = "gemini-2.5-flash" ),
),
),
),
)
config = (
Builders.AgentConfig
.add_profile(profile)
.with_video_recording_tools()
.build()
)
Raises FFmpegNotInstalledError if ffmpeg is not installed.
Raises ValueError at runtime if any profile lacks video_analyzer config.
Build and return the final AgentConfig object.
def build ( self ) -> AgentConfig
config = Builders.AgentConfig.with_default_profile(profile).build()
agent = Agent( config = config)
Complete Example
from minitap.mobile_use.sdk import Agent
from minitap.mobile_use.sdk.builders import Builders
from minitap.mobile_use.sdk.types import AgentProfile, DevicePlatform
# Create profiles
fast_profile = AgentProfile( name = "fast" , from_file = "fast-config.jsonc" )
accurate_profile = AgentProfile( name = "accurate" , from_file = "accurate-config.jsonc" )
# Configure task defaults
task_defaults = (
Builders.TaskDefaults
.with_max_steps( 500 )
.build()
)
# Build comprehensive agent configuration
config = (
Builders.AgentConfig
.for_device( platform = DevicePlatform. ANDROID , device_id = "emulator-5554" )
.add_profiles([fast_profile, accurate_profile])
.with_default_profile(fast_profile)
.with_adb_server( host = "localhost" , port = 5037 )
.with_default_task_config(task_defaults)
.build()
)
# Create agent with configuration
agent = Agent( config = config)
TaskDefaults Builder
Configure default settings for all tasks:
defaults = (
Builders.TaskDefaults
.with_max_steps( 500 )
.with_trace_recording( enabled = True )
.build()
)
config = (
Builders.AgentConfig
.with_default_task_config(defaults)
.build()
)
Server Configuration Shortcut
Use with_servers() as a shortcut for configuring ADB server settings:
from minitap.mobile_use.sdk.types import ServerConfig
servers = ServerConfig(
adb_server_host = "localhost" ,
adb_server_port = 5037
)
config = (
Builders.AgentConfig
.with_servers(servers)
.build()
)
Next Steps
Agent SDK Learn about the Agent class
Types Explore configuration types