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.2.2.tar.gz (62.8 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.2.2-py3-none-any.whl (38.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for aiwolf_nlp_common-0.2.2.tar.gz
Algorithm Hash digest
SHA256 1be41ecf2abfec8e831c28adf2421dd55fd18b225e0bb27564516eae86d49a2c
MD5 1c30c7d591030f5b68dc9d82a6f7460a
BLAKE2b-256 ca5edf75e5601250d5125fe142018a67dea7a473fa7f96613b6c4cd1ffe5ca23

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aiwolf_nlp_common-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 83c99d2d5dd5af7d02a34af6089a0d2cf79c680598d1c32756f2daa9eb7c546a
MD5 9fc66bc4b5279d34a0c56be0230a7396
BLAKE2b-256 d61ec12e9e74d8a995a43b9425c5a216af0cd770a6485d2309e9680718dae0bd

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