Agent SDK v0.5 API Reference
API reference for Agent SDK version 0.5
This is documentation for v0.5. View latest version.
v0.5.2
pip install cua-agent==0.5.2agent - Decorator-based Computer Use Agent with liteLLM integration
Classes
| Class | Description |
|---|---|
ComputerAgent | Main agent class that automatically selects the appropriate agent loop |
ComputerAgent
Main agent class that automatically selects the appropriate agent loop based on the model and executes tool calls.
Methods
ComputerAgent.run
async def run(self, messages: Messages, stream: bool = False, api_key: Optional[str] = None, api_base: Optional[str] = None, additional_generation_kwargs = {}) -> AsyncGenerator[Dict[str, Any], None]Run the agent with the given messages using Computer protocol handler pattern.
Args: messages: List of message dictionaries stream: Whether to stream the response api_key: Optional API key override for the model provider api_base: Optional API base URL override for the model provider **additional_generation_kwargs: Additional arguments passed to the model provider
Returns: AsyncGenerator that yields response chunks
ComputerAgent.predict_click
async def predict_click(self, instruction: str, image_b64: Optional[str] = None) -> Optional[Tuple[int, int]]Predict click coordinates based on image and instruction.
Args: instruction: Instruction for where to click image_b64: Base64 encoded image (optional, will take screenshot if not provided)
Returns: None or tuple with (x, y) coordinates
ComputerAgent.get_capabilities
def get_capabilities(self) -> List[AgentCapability]Get list of capabilities supported by the current agent config.
Returns: List of capability strings (e.g., ["step", "click"])
Was this page helpful?