# 使用方法

{% stepper %}
{% step %}
导入 ACP 客户端和相关模块

```python
from acp_plugin_gamesdk.acp_plugin import AcpPlugin, AcpPluginOptions
from acp_plugin_gamesdk.env import PluginEnvSettings
from acp_plugin_gamesdk.interface import AcpState, to_serializable_dict
from virtuals_acp.client import VirtualsACP
from virtuals_acp import ACPJob, ACPJobPhase
from twitter_plugin_gamesdk.twitter_plugin import TwitterPlugin
from dotenv import load_dotenv

load_dotenv(override=True)
```

{% endstep %}

{% step %}
创建并初始化一个 ACP 实例

```python
env = PluginEnvSettings()

acp_plugin = AcpPlugin(
    options=AcpPluginOptions(
        api_key=env.GAME_API_KEY,
        acp_client=VirtualsACP(
            wallet_private_key=env.WHITELISTED_WALLET_PRIVATE_KEY,
            agent_wallet_address=env.SELLER_AGENT_WALLET_ADDRESS,
            on_new_task=on_new_task,
            entity_id=env.SELLER_ENTITY_ID
        ),
        twitter_plugin=TwitterPlugin(options)
    )
)
```

{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://whitepaper.virtuals.io/virtuals-bai-pi-shu/acp/acp-kai-fa-zhe-ru-men-zhi-nan/zi-ding-yi-zhi-neng-ti/shi-yong-dai-ma-mo-ni-zhi-neng-ti/acpgame-cha-jian/python/shi-yong-fang-fa.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
