MafiaGPT
所属分类:GPT/ChatGPT
开发工具:Python
文件大小:0KB
下载次数:0
上传日期:2023-08-07 19:11:41
上 传 者:
sh-1993
说明: Python主持人,与GPT玩家玩黑手党(狼人)游戏!,
(Python Moderator for a Mafia(Werewolf) game with GPT players!,)
文件列表:
LICENSE (1077, 2023-09-26)
assets/ (0, 2023-09-26)
assets/robotic werewol 0.jpg (241040, 2023-09-26)
core/ (0, 2023-09-26)
core/__init__.py (0, 2023-09-26)
core/api.py (1508, 2023-09-26)
core/game.py (11124, 2023-09-26)
docs/ (0, 2023-09-26)
docs/Alternatives.md (151, 2023-09-26)
docs/Samples/ (0, 2023-09-26)
docs/Samples/1.md (29725, 2023-09-26)
docs/image-1.png (89076, 2023-09-26)
docs/index.md (699, 2023-09-26)
log-to-readable-md.py (2857, 2023-09-26)
log.json (33108, 2023-09-26)
mkdocs.yml (128, 2023-09-26)
prompts/ (0, 2023-09-26)
prompts/__init__.py (0, 2023-09-26)
prompts/render_prompts.py (4970, 2023-09-26)
requirements.txt (22, 2023-09-26)
run.py (136, 2023-09-26)
# MafiaGPT
a program that moderate a [Mafia(Werewolf)](https://en.wikipedia.org/wiki/Mafia_(party_game)) game with 7 players between GPT models.
to see communication, team work and social/logical abilities of GPT model.(it is fun and educational)
the roles are :
- 1 Medical
- 1 Seer
- 3 Villagers
- 2 Werewolves
## Get started
install openai via pip :
```shell
pip install openai
```
set your Openai API key as an enivronmental variable with key : OPENAI_API_KEY
- you can configure your model(Default is 'gpt-3.5-turbo') and your rate_limit and token_limit in api.py
- make DEBUG=True in api.py if you want to see all messages passed to GPT model.
```shell
python run.py
```
it will save a log file in the bellow format in records/ folder.
## log.json format
every event in the game is a dictionary.
```javascript
{
'event':"
",
'content':"<...>"
}
```
events are :
- roles :
```javascript
'content':{
'player':""
'role':""
}
```
- cycle :
```javascript
'content':""
```
- speech :
```javascript
'content':{
'player':""
'context':""
}
```
- voted :
```javascript
'content':{
'player':""
'voted_to_player':""
'reason':""
}
```
- vote_start :
```javascript
'content':{
'player':""
'voted_to_player':""
'reason':""
}
```
- healed :
```javascript
'content':{
'player':""
'reason':""
}
```
- targeted :
```javascript
'content':{
'player':""
'reason':""
}
```
- killed :
```javascript
'content':{
'player':""
}
```
- inquiried :
```javascript
'content':{
'player':""
'context':""
'reason':""
}
```
- notetaking :
```javascript
'content':{
'player':""
'context':""
}
```
- end :
```javascript
'content':{
'winner':""
}
```
## Prompts
- Game Introduction('/intro_prompt.txt') : rules and the role of the player
- Game Reports('/report_prompt.txt) :
- Speeches in last round
- Game status : alive players in seperation of the teams.
- Players status : alivness of players based on their number
- Agent previous SPEACIAL actions
- Agent previous VOTES
- Notes that have taken by the agent
- Commands('/game.py') :
- Speak command
- Vote command
- targetting/healing/killing/inquiring command
## Tasks
- [ ] optimizing prompts
- [ ] a web interface to play natively a log-file as an animation
- [ ] allowing a player/players to play with GPT (Probably tricky prompts will lead to game hacking.)
- [ ] allowing more chat models or different GPT tempretures to compete
近期下载者:
相关文件:
收藏者: