computer-use-api 0.0.2
AgentKit Computer-Use API
Keywords: Swagger, AgentKit Computer-Use API

# computer-use-api
AgentKit Computer-Use API

This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:

- API version: 0.0.1
- Package version: 0.0.2
- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen

## Requirements.

Python 2.7 and 3.4+

## Installation & Usage
### pip install

```sh
pip install computer-use-api
```
(you may need to run `pip` with root permission: `sudo pip install computer-use-api`)

Then import the package:
```python
import computer_use_api 
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import computer_use_api
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python
from __future__ import print_function
import time
import computer_use_api
from computer_use_api.rest import ApiException
from pprint import pprint

# Configure API key authorization: ComputerUseKey
configuration = computer_use_api.Configuration()
configuration.host = "YOUR_TOOL_SERVER_URL"
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = computer_use_api.ComputerUseApi(computer_use_api.ApiClient(configuration))
body = computer_use_api.ClickMouseRequest() # ClickMouseRequest | 

try:
    # 鼠标在指定位置点击
    api_response = api_instance.click_mouse(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ComputerUseApi->click_mouse: %s\n" % e)

# Configure API key authorization: ComputerUseKey
configuration = computer_use_api.Configuration()
configuration.host = "YOUR_TOOL_SERVER_URL"
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = computer_use_api.ComputerUseApi(computer_use_api.ApiClient(configuration))
body = computer_use_api.DragMouseRequest() # DragMouseRequest | 

try:
    # 移动鼠标
    api_response = api_instance.drag_mouse(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ComputerUseApi->drag_mouse: %s\n" % e)

# Configure API key authorization: ComputerUseKey
configuration = computer_use_api.Configuration()
configuration.host = "YOUR_TOOL_SERVER_URL"
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = computer_use_api.ComputerUseApi(computer_use_api.ApiClient(configuration))

try:
    # 获取鼠标坐标
    api_response = api_instance.get_cursor_position()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ComputerUseApi->get_cursor_position: %s\n" % e)

# Configure API key authorization: ComputerUseKey
configuration = computer_use_api.Configuration()
configuration.host = "YOUR_TOOL_SERVER_URL"
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = computer_use_api.ComputerUseApi(computer_use_api.ApiClient(configuration))

try:
    # 获取屏幕长宽
    api_response = api_instance.get_screen_size()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ComputerUseApi->get_screen_size: %s\n" % e)

# Configure API key authorization: ComputerUseKey
configuration = computer_use_api.Configuration()
configuration.host = "YOUR_TOOL_SERVER_URL"
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = computer_use_api.ComputerUseApi(computer_use_api.ApiClient(configuration))
body = computer_use_api.MoveMouseRequest() # MoveMouseRequest | 

try:
    # 鼠标移动到指定位置
    api_response = api_instance.move_mouse(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ComputerUseApi->move_mouse: %s\n" % e)

# Configure API key authorization: ComputerUseKey
configuration = computer_use_api.Configuration()
configuration.host = "YOUR_TOOL_SERVER_URL"
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = computer_use_api.ComputerUseApi(computer_use_api.ApiClient(configuration))
body = computer_use_api.PressKeyRequest() # PressKeyRequest | 

try:
    # 按键
    api_response = api_instance.press_key(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ComputerUseApi->press_key: %s\n" % e)

# Configure API key authorization: ComputerUseKey
configuration = computer_use_api.Configuration()
configuration.host = "YOUR_TOOL_SERVER_URL"
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = computer_use_api.ComputerUseApi(computer_use_api.ApiClient(configuration))
body = computer_use_api.ScrollRequest() # ScrollRequest | 

try:
    # 滚动
    api_response = api_instance.scroll(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ComputerUseApi->scroll: %s\n" % e)

# Configure API key authorization: ComputerUseKey
configuration = computer_use_api.Configuration()
configuration.host = "YOUR_TOOL_SERVER_URL"
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = computer_use_api.ComputerUseApi(computer_use_api.ApiClient(configuration))

try:
    # 截屏
    api_response = api_instance.take_screenshot()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ComputerUseApi->take_screenshot: %s\n" % e)

# Configure API key authorization: ComputerUseKey
configuration = computer_use_api.Configuration()
configuration.host = "YOUR_TOOL_SERVER_URL"
configuration.api_key['X-API-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-API-Key'] = 'Bearer'

# create an instance of the API class
api_instance = computer_use_api.ComputerUseApi(computer_use_api.ApiClient(configuration))
body = computer_use_api.TypeTextRequest() # TypeTextRequest | 

try:
    # 发送文本
    api_response = api_instance.type_text(body)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ComputerUseApi->type_text: %s\n" % e)
```

## Documentation for API Endpoints

All URIs are relative to */*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*ComputerUseApi* | [**click_mouse**](docs/ComputerUseApi.md#click_mouse) | **POST** /2020-04-01/ClickMouse | 鼠标在指定位置点击
*ComputerUseApi* | [**drag_mouse**](docs/ComputerUseApi.md#drag_mouse) | **POST** /2020-04-01/DragMouse | 移动鼠标
*ComputerUseApi* | [**get_cursor_position**](docs/ComputerUseApi.md#get_cursor_position) | **GET** /2020-04-01/GetCursorPosition | 获取鼠标坐标
*ComputerUseApi* | [**get_screen_size**](docs/ComputerUseApi.md#get_screen_size) | **GET** /2020-04-01/GetScreenSize | 获取屏幕长宽
*ComputerUseApi* | [**move_mouse**](docs/ComputerUseApi.md#move_mouse) | **POST** /2020-04-01/MoveMouse | 鼠标移动到指定位置
*ComputerUseApi* | [**press_key**](docs/ComputerUseApi.md#press_key) | **POST** /2020-04-01/PressKey | 按键
*ComputerUseApi* | [**scroll**](docs/ComputerUseApi.md#scroll) | **POST** /2020-04-01/Scroll | 滚动
*ComputerUseApi* | [**take_screenshot**](docs/ComputerUseApi.md#take_screenshot) | **GET** /2020-04-01/TakeScreenshot | 截屏
*ComputerUseApi* | [**type_text**](docs/ComputerUseApi.md#type_text) | **POST** /2020-04-01/TypeText | 发送文本

## Documentation For Models

 - [ClickMouseRequest](docs/ClickMouseRequest.md)
 - [ClickMouseResponse](docs/ClickMouseResponse.md)
 - [ComputeOperateResult](docs/ComputeOperateResult.md)
 - [DragMouseRequest](docs/DragMouseRequest.md)
 - [DragMouseResponse](docs/DragMouseResponse.md)
 - [GetCursorPositionResponse](docs/GetCursorPositionResponse.md)
 - [GetCursorPositionResult](docs/GetCursorPositionResult.md)
 - [GetScreenSizeResponse](docs/GetScreenSizeResponse.md)
 - [GetScreenSizeResult](docs/GetScreenSizeResult.md)
 - [InternalError](docs/InternalError.md)
 - [MoveMouseRequest](docs/MoveMouseRequest.md)
 - [MoveMouseResponse](docs/MoveMouseResponse.md)
 - [PressKeyRequest](docs/PressKeyRequest.md)
 - [PressKeyResponse](docs/PressKeyResponse.md)
 - [ResponseMetadata](docs/ResponseMetadata.md)
 - [ScrollRequest](docs/ScrollRequest.md)
 - [ScrollResponse](docs/ScrollResponse.md)
 - [TakeScreenshotResponse](docs/TakeScreenshotResponse.md)
 - [TakeScreenshotResult](docs/TakeScreenshotResult.md)
 - [TypeTextRequest](docs/TypeTextRequest.md)
 - [TypeTextResponse](docs/TypeTextResponse.md)
 - [UnauthorizedError](docs/UnauthorizedError.md)

## Documentation For Authorization


## ComputerUseKey

- **Type**: API key
- **API key parameter name**: X-API-Key
- **Location**: HTTP header


## Author