Skip to main content

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


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.3.3.tar.gz (52.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aiwolf_nlp_common-0.3.3-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

Details for the file aiwolf_nlp_common-0.3.3.tar.gz.

File metadata

  • Download URL: aiwolf_nlp_common-0.3.3.tar.gz
  • Upload date:
  • Size: 52.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.13.0

File hashes

Hashes for aiwolf_nlp_common-0.3.3.tar.gz
Algorithm Hash digest
SHA256 c83df2948d681dee06ddea21ca24b31e7f29bd9e3209c6c55a5da22c49c5a3a6
MD5 21ac071ea293eacac4be1f3f74f0780b
BLAKE2b-256 72c92ef0810bc4ae213f8c2f2114380d23a05a73491ff6a38ed98021055fda46

See more details on using hashes here.

File details

Details for the file aiwolf_nlp_common-0.3.3-py3-none-any.whl.

File metadata

File hashes

Hashes for aiwolf_nlp_common-0.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f8f93d5ab7676498b00212795b62bbd2a34e36352fc334a5846cc437110c4e05
MD5 1d38d700df83318c1e3d5bf0bf99bdd1
BLAKE2b-256 d7e25ba1355ac197ed6508714dbbba54a4068e09061442f34caeca825e489a06

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page