Compare commits

...

10 Commits

Author SHA1 Message Date
Joon Sung Park
fe05a71d3e
Merge pull request #24 from eltociear/main-1
Update README.md
2023-08-11 00:07:21 -07:00
Ikko Eltociear Ashimine
3b4c015627
Update README.md
Escape underscore.
2023-08-11 06:47:49 +09:00
Joon Sung Park
7373f4eb5d
Merge pull request #10 from guili618/my_dev
To make the error display more detailed using traceback.print_exc()
2023-08-10 04:55:45 -07:00
Joon Sung Park
c88afd75f2
Merge pull request #11 from mattkanwisher/main
Make project it buildable on M1 Apple Silicon Macs
2023-08-10 04:55:14 -07:00
Joon Sung Park
729fb05e2d
Merge pull request #13 from tripathiarpan20/main
Plan prompt fixes
2023-08-10 04:53:43 -07:00
Arpan Tripathi
f1f7e1b710
fixed typos in prompt 2023-08-10 11:38:15 +01:00
Arpan Tripathi
5cb6a1feb9
minor bug fix 2023-08-10 11:29:12 +01:00
Matthew Campbell
a78938d597 bump pip requirments to work on M1 Macs 2023-08-10 15:12:31 +07:00
guiaixiao
2aa4474095 To make the error display more detailed using traceback.print_exc() 2023-08-10 14:37:44 +08:00
joonspk-research
c7e0c16d88 readme updated
readme updated
2023-08-07 14:12:54 -07:00
4 changed files with 17 additions and 17 deletions

View File

@ -8,8 +8,6 @@
This repository accompanies our research paper titled "[Generative Agents: Interactive Simulacra of Human Behavior](https://arxiv.org/abs/2304.03442)." It contains our core simulation module for generative agents—computational agents that simulate believable human behaviors—and their game environment. Below, we document the steps for setting up the simulation environment on your local machine and for replaying the simulation as a demo animation. This repository accompanies our research paper titled "[Generative Agents: Interactive Simulacra of Human Behavior](https://arxiv.org/abs/2304.03442)." It contains our core simulation module for generative agents—computational agents that simulate believable human behaviors—and their game environment. Below, we document the steps for setting up the simulation environment on your local machine and for replaying the simulation as a demo animation.
*Usage Notice: This code repository of generative agents is intended for research use only.*
## <img src="https://joonsungpark.s3.amazonaws.com:443/static/assets/characters/profile/Isabella_Rodriguez.png" alt="Generative Isabella"> Setting Up the Environment ## <img src="https://joonsungpark.s3.amazonaws.com:443/static/assets/characters/profile/Isabella_Rodriguez.png" alt="Generative Isabella"> Setting Up the Environment
To set up your environment, you will need to generate a `utils.py` file that contains your OpenAI API key and download the necessary packages. To set up your environment, you will need to generate a `utils.py` file that contains your OpenAI API key and download the necessary packages.
@ -134,7 +132,7 @@ series = {UIST '23}
## <img src="https://joonsungpark.s3.amazonaws.com:443/static/assets/characters/profile/Wolfgang_Schulz.png" alt="Generative Wolfgang"> Acknowledgements ## <img src="https://joonsungpark.s3.amazonaws.com:443/static/assets/characters/profile/Wolfgang_Schulz.png" alt="Generative Wolfgang"> Acknowledgements
We encourage you to support the following three amazing artists who have designed the game assets for this project, especially if you are planning to use the assets included here for your own project: We encourage you to support the following three amazing artists who have designed the game assets for this project, especially if you are planning to use the assets included here for your own project:
* Background art: [PixyMoon (@_PixyMoon _)](https://twitter.com/_PixyMoon_) * Background art: [PixyMoon (@_PixyMoon\_)](https://twitter.com/_PixyMoon_)
* Furniture/interior design: [LimeZu (@lime_px)](https://twitter.com/lime_px) * Furniture/interior design: [LimeZu (@lime_px)](https://twitter.com/lime_px)
* Character design: [ぴぽ (@pipohi)](https://twitter.com/pipohi) * Character design: [ぴぽ (@pipohi)](https://twitter.com/pipohi)

View File

@ -22,16 +22,16 @@ h11==0.14.0
idna==3.3 idna==3.3
importlib-metadata==4.8.2 importlib-metadata==4.8.2
jmespath==1.0.1 jmespath==1.0.1
joblib==1.1.0 joblib>=1.1.1
kiwisolver==1.3.1 kiwisolver==1.4.4
matplotlib==3.3.4 matplotlib==3.7.2
multidict==6.0.4 multidict==6.0.4
nltk==3.6.5 nltk==3.6.5
numpy==1.19.5 numpy==1.25.2
openai==0.27.0 openai==0.27.0
outcome==1.2.0 outcome==1.2.0
packaging==23.0 packaging==23.0
pandas==1.1.5 pandas==2.0.3
patsy==0.5.3 patsy==0.5.3
Pillow==8.4.0 Pillow==8.4.0
psycopg2-binary==2.9.5 psycopg2-binary==2.9.5
@ -43,9 +43,9 @@ pytz==2021.3
regex==2021.11.10 regex==2021.11.10
requests==2.26.0 requests==2.26.0
s3transfer==0.6.0 s3transfer==0.6.0
scikit-learn==0.24.2 scikit-learn==1.3.0
scikit-posthocs==0.7.0 scikit-posthocs==0.7.0
scipy==1.5.4 scipy==1.11.1
seaborn==0.12.2 seaborn==0.12.2
selenium==4.8.2 selenium==4.8.2
six==1.16.0 six==1.16.0
@ -64,5 +64,5 @@ typing-extensions==4.0.0
urllib3==1.26.7 urllib3==1.26.7
wsproto==1.2.0 wsproto==1.2.0
yarl==1.8.2 yarl==1.8.2
yellowbrick==1.3.post1 yellowbrick==1.5
zipp==3.6.0 zipp==3.6.0

View File

@ -419,7 +419,7 @@ def revise_identity(persona):
# print (";adjhfno;asdjao;idfjo;af", p_name) # print (";adjhfno;asdjao;idfjo;af", p_name)
plan_prompt = statements + "\n" plan_prompt = statements + "\n"
plan_prompt += f"Given the statements above, is there anything that {p_name} should remember as she plans for" plan_prompt += f"Given the statements above, is there anything that {p_name} should remember as they plan for"
plan_prompt += f" *{persona.scratch.curr_time.strftime('%A %B %d')}*? " plan_prompt += f" *{persona.scratch.curr_time.strftime('%A %B %d')}*? "
plan_prompt += f"If there is any scheduling information, be as specific as possible (include date, time, and location if stated in the statement)\n\n" plan_prompt += f"If there is any scheduling information, be as specific as possible (include date, time, and location if stated in the statement)\n\n"
plan_prompt += f"Write the response from {p_name}'s perspective." plan_prompt += f"Write the response from {p_name}'s perspective."
@ -427,12 +427,12 @@ def revise_identity(persona):
# print (plan_note) # print (plan_note)
thought_prompt = statements + "\n" thought_prompt = statements + "\n"
thought_prompt += f"Given the statements above, how might we summarize {p_name}'s feelings about her days up to now?\n\n" thought_prompt += f"Given the statements above, how might we summarize {p_name}'s feelings about their days up to now?\n\n"
thought_prompt += f"Write the response from {p_name}'s perspective." thought_prompt += f"Write the response from {p_name}'s perspective."
thought_note = ChatGPT_single_request(plan_prompt) thought_note = ChatGPT_single_request(thought_prompt)
# print (thought_note) # print (thought_note)
currently_prompt = f"Isabella Rodriguez's status from {(persona.scratch.curr_time - datetime.timedelta(days=1)).strftime('%A %B %d')}:\n" currently_prompt = f"{p_name}'s status from {(persona.scratch.curr_time - datetime.timedelta(days=1)).strftime('%A %B %d')}:\n"
currently_prompt += f"{persona.scratch.currently}\n\n" currently_prompt += f"{persona.scratch.currently}\n\n"
currently_prompt += f"{p_name}'s thoughts at the end of {(persona.scratch.curr_time - datetime.timedelta(days=1)).strftime('%A %B %d')}:\n" currently_prompt += f"{p_name}'s thoughts at the end of {(persona.scratch.curr_time - datetime.timedelta(days=1)).strftime('%A %B %d')}:\n"
currently_prompt += (plan_note + thought_note).replace('\n', '') + "\n\n" currently_prompt += (plan_note + thought_note).replace('\n', '') + "\n\n"

View File

@ -26,6 +26,7 @@ import time
import math import math
import os import os
import shutil import shutil
import traceback
from selenium import webdriver from selenium import webdriver
@ -592,6 +593,7 @@ class ReverieServer:
print (ret_str) print (ret_str)
except: except:
traceback.print_exc()
print ("Error.") print ("Error.")
pass pass