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.2.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.2-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiwolf_nlp_common-0.3.2.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.2.tar.gz
Algorithm Hash digest
SHA256 dafff4a2fd88038ab681803d0284ad680599e566bd9f12bbeed0dafba78d8cbd
MD5 e29ca6e113c0b538e32705a7b8daeea5
BLAKE2b-256 17d6ec10509e78ac0674997388af6e5fb52a390d1fc046dba7c53b536cca500c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aiwolf_nlp_common-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6c17596057e175f6016d1d971b65058fd881440709d6390e744747a4fee7c4c5
MD5 b41fcc3acbbd8bb59f737b6e63018fbe
BLAKE2b-256 e5de17e72019a8fe7c867bb1773e940690dd3674660d503cd8d3bffea55da39a

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