A platform for simulating and evaluating social interaction.
Project description
Sotopia: an Open-ended Social Learning Environment
News
- [05/2024] Sotopia was presented at ICLR 2024 as a spotlight ⭐!
Introduction
Sotopia is an open-ended social learning environment that allows agents to interact with each other and the environment. The environment is designed to be a platform for evaluating and faciliating social intelligence in language agents. The environment is designed to be open-ended, meaning that the environment can be easily extended to include new environments and new agents. The environment is also designed to be scalable, meaning that the environment can be easily scaled to include a large number of agents and environments.
@inproceedings{zhou2024sotopia,
title = {SOTOPIA: Interactive Evaluation for Social Intelligence in Language Agents},
author = {Zhou*, Xuhui and Zhu*, Hao and Mathur, Leena and Zhang, Ruohong and Qi, Zhengyang and Yu, Haofei and Morency, Louis-Philippe and Bisk, Yonatan and Fried, Daniel and Neubig, Graham and Sap, Maarten},
journal = {ICLR},
year = {2024},
url = {https://openreview.net/forum?id=mM7VurbA4r},
}
Help
See documentation for more details.
Get started
Install locally
We recommend using a virtual environment, e.g. with anaconda3: conda create -n sotopia python=3.11; conda activate sotopia;
.
Then:
python -m pip install sotopia; sotopia install
This will setup the necessary environment variables and download the necessary data.
[!TIP] Having trouble installing? Or don't want to install redis for now? We are working on a public redis server for you to use. Stay tuned!
OpenAI key is required to run the code. Please set the environment variable OPENAI_API_KEY
to your key. The recommend way is to add the key to the conda environment:
conda env config vars set OPENAI_API_KEY=your_key
Easy Sample Server
You can view an episode demo with default parameters with the following:
import asyncio
from sotopia.samplers import UniformSampler
from sotopia.server import run_async_server
asyncio.run(
run_async_server(
model_dict={
"env": "gpt-4",
"agent1": "gpt-4o-mini",
"agent2": "gpt-4o-mini",
},
sampler=UniformSampler(),
)
)
or run
python examples/minimalist_demo.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file sotopia-0.1.2.tar.gz
.
File metadata
- Download URL: sotopia-0.1.2.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.4.21
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e3a6b07556afd6c48bd0f58739398a5a6550a7a30710c90586b16b567fdb228 |
|
MD5 | 7e62fdc8391740f00f577558098969c8 |
|
BLAKE2b-256 | eb921ba255c98c3b256154c68c3d91a8e11233fe2478b0979e55dc51832c809f |
File details
Details for the file sotopia-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: sotopia-0.1.2-py3-none-any.whl
- Upload date:
- Size: 72.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.4.21
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5ec3bef1dc374ae891db886e78fd8942b1bd2f2630dba0b27b533ab76f5a6852 |
|
MD5 | fc5250477536a18eeb176c4711b79e25 |
|
BLAKE2b-256 | 1480f198640dfea600dd778c6cb0abeb3284160b546acd43da18d2c6fee84650 |