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.0.tar.gz
(62.7 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.0.tar.gz.
File metadata
- Download URL: aiwolf_nlp_common-0.2.0.tar.gz
- Upload date:
- Size: 62.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.13.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36894a61abac5f702f3296e0afbc2a93b41997fe2acdda06c07b43414134023f
|
|
| MD5 |
505cf2002e11c0fce9fff9e70522fa45
|
|
| BLAKE2b-256 |
8556a2e4b6eaa20e749a29d0cdfdcdcd878673cf3fad37201b7b2c486e99b531
|
File details
Details for the file aiwolf_nlp_common-0.2.0-py3-none-any.whl.
File metadata
- Download URL: aiwolf_nlp_common-0.2.0-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 |
ebd14f5cad669bf65effae8e568a3c4a5381e12c7ca50db39f9d7a557b2a8f1d
|
|
| MD5 |
b1a80685a628379685bb027ebb565b9d
|
|
| BLAKE2b-256 |
b807d1f23cb8ed4b33402575bfcd0f55ecec75bd3228f5b830f95dee94d81065
|