Skip to content

sotopia-lab/sotopia-demo

 
 

Repository files navigation

SocialStream

Python 3.11 pre-commit Ruff Checked with mypy

Get started

This package supports Python 3.11 and above. We recommend using a virtual environment to install this package, e.g.,

conda create -n socialstream python=3.11; conda activate socialstream;  curl -sSL https://install.python-poetry.org | python3
poetry install

Usage

streamlit run app.py

Before that you should specify a Redis database by conda env config vars set REDIS_OM_URL={YOUR_URL}. You can also 1. Specify a new database in the sidebar, or 2. Include your temporary scenario in data with suffix _agents.json and _scenarios.json.

Chat

First choose the agents (two agents cannot be the same), scenarios and the agent you are going to be, then click start to start interaction. When you want to leave and get evaluated, click stop to start evaluation.

Contribution

Install dev options

mypy --install-types --non-interactive socialstream
pip install pre-commit
pre-commit install

New branch for each feature

git checkout -b feature/feature-name and PR to main branch.

Before committing

Run pre-commit run --all-files to run all checks

Check github action result

Check the github action result to make sure all tests pass. If not, fix the errors and push again.

About Callbacks in Streamlit

From Streamlit documentation on session state.

"When updating Session state in response to events, a callback function gets executed first, and then the app is executed from top to bottom."

In this code, we utilize callbacks to handle the clickability of buttons and ensure that any edited information is promptly and accurately updated.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.3%
  • Dockerfile 1.5%
  • Shell 0.2%