Skip to main content

aiwolf-nlp-common

Project description

aiwolf-nlp-common

人狼知能コンテスト(自然言語部門) のエージェント向けの共通パッケージです。
ゲームサーバから送信されるJSON形式のデータをオブジェクトに変換するためのパッケージです。

import json

from aiwolf_nlp_common.protocol import Packet

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}}"""
value: dict = json.loads(recv)
packet = Packet(value=value)

print(packet.request)
print(packet.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.4.tar.gz (46.2 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.4-py3-none-any.whl (22.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aiwolf_nlp_common-0.3.4.tar.gz
  • Upload date:
  • Size: 46.2 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.4.tar.gz
Algorithm Hash digest
SHA256 027e46790b7fca714b85d9eb8c8e2b97c5e56673c3d03f349103ceed60457bc3
MD5 f085708b3edb1ababe2d1411db2ab416
BLAKE2b-256 99850b2185dee3d35213d4e917e5434450dc8a07e05c91398c977e149256c4bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aiwolf_nlp_common-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 66693ee9b4d6f4328f62c948a871378027f5063ed995ced886de677888230b13
MD5 f22bee42a32ca675faebc45e1d2377c3
BLAKE2b-256 4c49f16afc2758cefb1fad4c177b1a11fc73e089ec029e3701f36dd25d552fbe

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