aiwolf-nlp-common
Project description
aiwolf-nlp-common
人狼知能コンテスト(自然言語部門) のエージェント向けの共通パッケージです。
ゲームサーバから送信されるJSON形式のデータをオブジェクトに変換するためのパッケージです。
ゲームサーバから送信されたJSON形式の文字列から、以下のオブジェクトを生成します。
from aiwolf_nlp_common.protocol import CommunicationProtocol
recv:str = """{"request":"INITIALIZE","info":{"statusMap":{"Agent[01]":"ALIVE","Agent[02]":"ALIVE","Agent[03]":"ALIVE","Agent[04]":"ALIVE","Agent[05]":"ALIVE"},"roleMap":{"Agent[02]":"SEER"},"remainTalkMap":{},"remainWhisperMap":{},"day":0,"agent":"Agent[02]"},"setting":{"roleNumMap":{"BODYGUARD":0,"MEDIUM":0,"POSSESSED":0,"SEER":1,"VILLAGER":3,"WEREWOLF":1},"maxTalk":3,"maxTalkTurn":15,"maxWhisper":3,"maxWhisperTurn":15,"maxSkip":3,"isEnableNoAttack":true,"isVoteVisible":false,"isTalkOnFirstDay":true,"responseTimeout":90000,"actionTimeout":60000,"maxRevote":1,"maxAttackRevote":1}}"""
protocol = CommunicationProtocol.initialize_from_json(received_str=recv)
print(protocol.request)
print(protocol.info.agent)
INITIALIZE
Agent[02]
詳細については下記のプロトコルの説明やゲームサーバのソースコードを参考にしてください。
プロトコルの実装について
インストール方法
pip install aiwolf-nlp-common
[!WARNING]
pip install aiwolf-nlp-commonに失敗する場合は、以下の手順を試してください。
pip install --upgrade pip
pip install --upgrade setuptools
pip install -i https://test.pypi.org/simple/ aiwolf-nlp-common
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aiwolf_nlp_common-0.2.1.tar.gz
(62.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiwolf_nlp_common-0.2.1.tar.gz.
File metadata
- Download URL: aiwolf_nlp_common-0.2.1.tar.gz
- Upload date:
- Size: 62.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de599eaf56631bdf5da6a7dc0b4292e36fabc787f5ec03957e57dc760e7774f0
|
|
| MD5 |
bf98f7d7ee21c92fa2603ca867df531c
|
|
| BLAKE2b-256 |
c025ff315097c847fcb9a5918ae5e81df301e94ef5836e0a0378c3754e106a4a
|
File details
Details for the file aiwolf_nlp_common-0.2.1-py3-none-any.whl.
File metadata
- Download URL: aiwolf_nlp_common-0.2.1-py3-none-any.whl
- Upload date:
- Size: 37.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
900abf55285dc9195f551e094cc3f7f44c05c359839be379d3d488e1b91ecad1
|
|
| MD5 |
ccf8dafcf00b8f3878b62206a82fa9cc
|
|
| BLAKE2b-256 |
0db87fe0b9eaf3272af004b3baed5436e21f4bf7e7445b4ebca316b08c649a16
|