Skip to content

Commit ccccd06

Browse files
XuhuiZhoudependabot[bot]ProKilyangalan123Chenghao Yang
authored
UI update (#273)
* Update langchain requirement from <0.3.0,>=0.2.5 to >=0.2.5,<0.4.0 (#236) * [Automated] Merge release into main (#235) * bump the version, test release to PyPi * Update README.md * Update README.md * Update README.md * bumpy version to 0.0.9 * Update Sotopia presentation information in README.md * bump version to 0.0.10 * bump version * add merge release back to main action * change checkout v4->v3 * fix merge-back-to-main and pin mypy to <1.11.0 * merge bug fix * upgrade default model to handle bad-foratted outputs to gpt-4o-mini as gpt-3.5-turbo is deprecated (#183) * update pull request -> pull request target * bump version * Add `bad_output_process_model` option and `use_fixed_model_version` option for all generation methods, to avoid future OpenAI API changes break Sotopia running. (#196) * Two major updates: 1) add "bad_output_process_model" option to all `agenerate_xxx()` methods so users can decide which model to use for handling bad outputs. By default, this is set to be `gpt-4o-mini`. 2) add `use_fixed_model_version` option for all generation methods, as some fixed model version may no longer available in the future. Users should have the right to bypass the fixed model version mapping instead of getting stuck in an error. Document (`generation.md`) has been updated for these two major changes correspondingly. * [autofix.ci] apply automated fixes --------- Co-authored-by: Chenghao Yang <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix gpt-3.5 * replace gpt3.5 turbo for tests * update gpt-3.5-turbo to gpt-4o-mini * bug fix for return fixed model version function * fix sampling error * fix rc.4 * new tag * bump version * update workflow permission * add why sotopia * improve the why sotopia * bump version * further add clarification to the custom models --------- Co-authored-by: XuhuiZhou <[email protected]> Co-authored-by: Chenghao (Alan) Yang <[email protected]> Co-authored-by: Chenghao Yang <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * update macos test runner as macos-latest (#238) * update macos test runner as macos-latest * redis-stack-server * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat(exp_eval): support tag for combo iteration (#245) * support tag for combo iteration * fix pre-commit error * [autofix.ci] apply automated fixes * fix mypy error --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * Adding OpenHands node * [autofix.ci] apply automated fixes * Added LLM Agent Node * [autofix.ci] apply automated fixes * removing openhands * [autofix.ci] apply automated fixes * Correcting mypy error in tick agent * Moving everything to examples since its not specific to sotopia * [autofix.ci] apply automated fixes * Adding some additional final checks * Renaming to interview openhands * Adding documentation * [autofix.ci] apply automated fixes * Updating the readme * [autofix.ci] apply automated fixes * feat: Initial Message for LLM agnets in Sotopia Aact (Experimental) (#249) * Adding OpenHands node * [autofix.ci] apply automated fixes * Added LLM Agent Node * [autofix.ci] apply automated fixes * removing openhands * [autofix.ci] apply automated fixes * Correcting mypy error in tick agent * Moving everything to examples since its not specific to sotopia * [autofix.ci] apply automated fixes * Adding some additional final checks * Adding scene context for agents * [autofix.ci] apply automated fixes * Renaming scene context to initial message * Adding the initial message channel * Renaming to interview openhands * Adding documentation * [autofix.ci] apply automated fixes * Updating the readme * [autofix.ci] apply automated fixes * Adding scene context for agents * [autofix.ci] apply automated fixes * Renaming scene context to initial message * Adding the initial message channel * Rebasing --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: Adding Chat print node for pretty printing chat conversation between agents (#250) * Adding OpenHands node * [autofix.ci] apply automated fixes * Added LLM Agent Node * [autofix.ci] apply automated fixes * removing openhands * [autofix.ci] apply automated fixes * Correcting mypy error in tick agent * Adding scene context for agents * [autofix.ci] apply automated fixes * Added chat print node * [autofix.ci] apply automated fixes * Fixing the runtime channel * Moving everything to examples since its not specific to sotopia * [autofix.ci] apply automated fixes * Adding some additional final checks * Adding scene context for agents * [autofix.ci] apply automated fixes * Renaming scene context to initial message * Adding the initial message channel * Adding scene context for agents * Added chat print node * [autofix.ci] apply automated fixes * Moving chat node to experiment * Renaming to interview openhands * Adding documentation * [autofix.ci] apply automated fixes * Updating the readme * [autofix.ci] apply automated fixes * feat: Initial Message for LLM agnets in Sotopia Aact (Experimental) (#249) * Adding OpenHands node * [autofix.ci] apply automated fixes * Added LLM Agent Node * [autofix.ci] apply automated fixes * removing openhands * [autofix.ci] apply automated fixes * Correcting mypy error in tick agent * Moving everything to examples since its not specific to sotopia * [autofix.ci] apply automated fixes * Adding some additional final checks * Adding scene context for agents * [autofix.ci] apply automated fixes * Renaming scene context to initial message * Adding the initial message channel * Renaming to interview openhands * Adding documentation * [autofix.ci] apply automated fixes * Updating the readme * [autofix.ci] apply automated fixes * Adding scene context for agents * [autofix.ci] apply automated fixes * Renaming scene context to initial message * Adding the initial message channel * Rebasing --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * Adding scene context for agents * [autofix.ci] apply automated fixes * Renaming scene context to initial message * Adding scene context for agents * Added chat print node * [autofix.ci] apply automated fixes * Adding scene context for agents * [autofix.ci] apply automated fixes * Fixing the runtime channel * Moving chat node to experiment * Updating the toml file paths --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * doc: API endpoints for sotopia (#242) * api doc * add PUT * add an temp example for websocket * websocket * update readme * Update README.md * update websocket live simulation api doc * [autofix.ci] apply automated fixes * update websocket doc * add api server with websocket as well as a client * fix mypy errors * support stopping the chat * add 404 to the status code * fix mypy issue * remove files * update requirement * update return message from the server * add restful error code * Update README.md * remove paks --------- Co-authored-by: Hao Zhu <[email protected]> Co-authored-by: Zhe Su <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * feat: FastAPI Implementation of Sotopia Part One (wo websocket) (#246) * api doc * add PUT * add an temp example for websocket * websocket * update readme * Update README.md * fastapi server wo websocket * update project toml * add websocket api and a sample client sample * add initial test * post update * finalize the doc * fix the create * finish test * add files * change chata to api * fix mypy error * fix mypy bug * fix mypy * create mock agents * downgrade langchain openai upperbound to fix CI --------- Co-authored-by: Hao Zhu <[email protected]> Co-authored-by: Zhe Su <[email protected]> * update the instruction to load existing data via docker (#255) * fix doc (#258) * Sotopia API and UI (#264) * feat: FastAPI Implementation of Sotopia Part Two (w websocket) (#252) * api doc * add PUT * add an temp example for websocket * websocket * update readme * Update README.md * update websocket live simulation api doc * [autofix.ci] apply automated fixes * update websocket doc * add api server with websocket as well as a client * fix mypy errors * support stopping the chat * add 404 to the status code * fix mypy issue * update the returned message types * redesign websocket api * update websocket, fix mypy error * add example of using websocket * clean code & change to existing functions for simulation * fix typing mismatch * update doc & mypy type fix * add type check for run_async_server * move example --------- Co-authored-by: Hao Zhu <[email protected]> Co-authored-by: Zhe Su <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * Add customizable evaluation dimensions (#256) * add customizable evaluation dimensions * add docs * fix mypy error & refactor examples * add docs for evaluation dimensions * update docs and examples * add test cases and fix mypy issue * fix mypy issue * Fix test_create_custom_dimension to use CustomEvaluationDimension.get(pk) (#262) Co-authored-by: openhands <[email protected]> * Fix/custom eval dimension test (#263) * Fix test_create_custom_dimension to use CustomEvaluationDimension.get(pk) * Update documentation for SotopiaDimension and EvaluationDimensionBuilder * [autofix.ci] apply automated fixes * Add API documentation for evaluation dimensions * Refine API documentation for evaluation_dimensions.py to match style * [autofix.ci] apply automated fixes --------- Co-authored-by: openhands <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * add doc --------- Co-authored-by: XuhuiZhou <[email protected]> Co-authored-by: openhands <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * Feat/addtional fast apis for non-streaming simulation and managing relationshio (#265) * temp run * add relationship api * fix mypy error * update relationship api * simulate episode non-streaming * modify sim episodes * add simulation status * task error * add background task * [autofix.ci] apply automated fixes * back to arun one episode * upload the code * use rq to execute background tasks * temp sol --------- Co-authored-by: Hao Zhu <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> * fix ci error * solving pytests * improve the tests * add custom eval fast api (#268) * fix mypy error * aact moderator (#257) * initial framework * initial conv * fix module error * feat: Add 3 new features to Moderator (#266) * feat:introduce booting procedure, saving, and ending chat to moderator * fix: moderator will now ignore none AgentAction, Observations now don't have to include all channels in the mapping * merge changes of example into the original one * fix: 1. save() method now accepts push_to_db config 2. booting()'s waiting time is changed to 0.1 sec * fix: rewrite booting() so that different agent will receive different background information * fix: moderator now inherits from Node directly, instead of from BaseAgent --------- Co-authored-by: JXZhou <JXZhou> * add save condition for moderator * push to db false * to fully stop * stopping all agents * fix mypy * fix mypy error --------- Co-authored-by: JXZhou <[email protected]> * Deploy the api to modal (#267) * prototype for modal serving * add openai secret * fix type annotation * add doc * bug fix for simulation api * add customize model, evaluator model and evaluation dimensions * Implement modal API server with Redis integration and FastAPI setup - Added a new script for the modal API server that initializes a Redis instance. - Created a persistent volume for Redis data and included a function to download initial data if not present. - Configured a Docker image with necessary dependencies including Redis Stack and FastAPI. - Implemented a web API class that sets up and cleans up the Redis connection, ensuring readiness before serving requests. - Integrated the SotopiaFastAPI application within the modal framework. --------- Co-authored-by: XuhuiZhou <[email protected]> * Feature/sotopia demo UI (#261) * initial * initial ui * merge main * add new ui * switch to fastAPI * websocket check * fix render episode error * add page; make a simplified page and still WIP * [autofix.ci] apply automated fixes * fix simplified streaming version * semi-done character page + avatar assets * Fixed character card styling * [autofix.ci] apply automated fixes * unified rendering and chat display * updated chat character icons * add some tags * add typing * temp fix * add characters avatar to simulation * fix episode full avatar * go to modal config * clean up code * add modal streamlit app * clean codebase except websocket * remove repeated local css * clean websocket * fix get name error * fix errors * pre render scenario * add custom eval * change streamlit to dynamic path * new uv * revert to previous install commands * a fix for modal * add customized dimension * [autofix.ci] apply automated fixes * sort scenarios in simulation * for demo video * update deploy instruction * update intro page * update intro page * [autofix.ci] apply automated fixes * update intro page * add customized dimensions * update api link and modal environment * move folder * fix relative import * update modal image build * use uv to build environment * change folder name * change test * fix modal serve * environment change * refactor * fix ui --------- Co-authored-by: Zhe Su <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: astrophie <[email protected]> * remove dev tag * add custom eval * base dimension * fix ui mypy * fix mypy * add delete dimension * update streamlit ui * ignores the ui directory * Committing changes before push * pytest for eval dimension * fix mypy * clean up comments * run non streaming simulation * add pytest for websocket * fix mypy issue --------- Co-authored-by: Hao Zhu <[email protected]> Co-authored-by: Zhe Su <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: openhands <[email protected]> Co-authored-by: JXZhou <[email protected]> Co-authored-by: astrophie <[email protected]> --------- Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Hao Zhu <[email protected]> Co-authored-by: Chenghao (Alan) Yang <[email protected]> Co-authored-by: Chenghao Yang <[email protected]> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Haofei Yu <[email protected]> Co-authored-by: Arpandeep Khatua <[email protected]> Co-authored-by: Arpandeep Khatua <[email protected]> Co-authored-by: Zhe Su <[email protected]> Co-authored-by: openhands <[email protected]> Co-authored-by: JXZhou <[email protected]> Co-authored-by: astrophie <[email protected]>
1 parent 2b80515 commit ccccd06

File tree

72 files changed

+7631
-2284
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+7631
-2284
lines changed

.github/.codecov.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ ignore:
66
- ".github" # ignore the .github directory
77
- "docs" # ignore the tests directory
88
- "figs" # ignore the figs directory
9+
- "ui" # ignore the ui directory
910

1011
coverage:
1112
status:

.github/workflows/cli_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
max-parallel: 5
2222
matrix:
23-
os: [ubuntu-latest, macos-13]
23+
os: [ubuntu-latest, macos-latest]
2424

2525
runs-on: ${{ matrix.os }}
2626

@@ -38,7 +38,7 @@ jobs:
3838
run: |
3939
python -m pip install --upgrade pip
4040
python -m pip install uv
41-
uv sync --extra test --extra chat
41+
uv sync --extra test --extra api
4242
- name: Test with pytest
4343
run: |
4444
uv run pytest tests/cli/test_install.py --cov=. --cov-report=xml

.github/workflows/mypy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
run: |
3636
python -m pip install --upgrade pip
3737
python -m pip install uv
38-
uv sync --extra test --extra chat
38+
uv sync --extra test --extra api
3939
- name: Type-checking package with mypy
4040
run: |
4141
# Run this mypy instance against our main package.

.github/workflows/tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
uv run --extra test --extra chat pytest --ignore tests/cli --cov=. --cov-report=xml
1+
uv run --extra test --extra api pytest --ignore tests/cli --cov=. --cov-report=xml

.github/workflows/tests_in_docker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Docker Compose
2929
run: docker compose -f .devcontainer/docker-compose.yml up -d
3030
- name: Run tests
31-
run: docker compose -f .devcontainer/docker-compose.yml run --rm -u root -v /home/runner/work/sotopia/sotopia:/workspaces/sotopia devcontainer /bin/sh -c "cd /workspaces/sotopia; ls; uv sync --extra test --extra chat; uv run pytest --ignore tests/cli --cov=. --cov-report=xml"
31+
run: docker compose -f .devcontainer/docker-compose.yml run --rm -u root -v /home/runner/work/sotopia/sotopia:/workspaces/sotopia devcontainer /bin/sh -c "cd /workspaces/sotopia; ls; uv sync --extra test --extra api; uv run pytest --ignore tests/cli --cov=. --cov-report=xml"
3232
- name: Upload coverage report to Codecov
3333
uses: codecov/[email protected]
3434
with:
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
## Overview
2+
3+
Evaluation dimensions are used to evaluate the quality of social interactions.
4+
In original Sotopia paper, there are 7 dimensions to evaluate the quality of social interactions, where we named them as `sotopia` evaluation dimensions:
5+
- believability
6+
- relationship
7+
- knowledge
8+
- secret
9+
- social rules
10+
- financial and material benefits
11+
- goal
12+
13+
The `SotopiaDimensions` can be used directly without initializing the database. It provides a set of predefined evaluation dimensions that are ready to use for evaluating social interactions. For example,
14+
15+
```python
16+
from sotopia.envs.parallel import ParallelSotopiaEnv
17+
from sotopia.envs.evaluators import EvaluationForTwoAgents, ReachGoalLLMEvaluator, RuleBasedTerminatedEvaluator, SotopiaDimensions
18+
19+
env = ParallelSotopiaEnv(
20+
env_profile=env_profile,
21+
model_name=model_names["env"],
22+
action_order="round-robin",
23+
evaluators=[
24+
RuleBasedTerminatedEvaluator(max_turn_number=20, max_stale_turn=2),
25+
],
26+
terminal_evaluators=[
27+
ReachGoalLLMEvaluator(
28+
model_names["env"],
29+
EvaluationForTwoAgents[SotopiaDimensions], # type: ignore
30+
# TODO check how to do type annotation
31+
),
32+
],
33+
)
34+
```
35+
36+
37+
However we observe under many use cases people may want to evaluate with customized evaluation metrics, so we provide a way to build custom evaluation dimensions.
38+
For a quick reference, you can directly check out the `examples/use_custom_dimensions.py`.
39+
40+
### CustomEvaluationDimension
41+
The [`CustomEvaluationDimension`](/python_API/database/evaluation_dimensions) is a class that can be used to create a custom evaluation dimension.
42+
There are four parameters:
43+
- name: the name of the dimension
44+
- description: the description of the dimension
45+
- range_low: the minimum score of the dimension (should be an integer)
46+
- range_high: the maximum score of the dimension (should be an integer)
47+
48+
### CustomEvaluationDimensionList
49+
The [`CustomEvaluationDimensionList`](/python_API/database/evaluation_dimensions) is a class that can be used to create a custom evaluation dimension list based on the existing dimensions. It helps one to group multiple dimensions together for a specific use case.
50+
There are two parameters:
51+
- name: the name of the dimension list
52+
- dimension_pks: the primary keys of the dimensions in the dimension list
53+
54+
### EvaluationDimensionBuilder
55+
The [`EvaluationDimensionBuilder`](/python_API/database/evaluation_dimensions) is a class that can be used to generate a custom evaluation dimension model based on the existing dimensions.
56+
57+
58+
## Usage
59+
### Initialize the database
60+
The default evaluation metric is still `SotopiaDimensions` in `sotopia.env.evaluators`.There is no `CustomEvaluationDimension` in the database by default. To initialize the database, please refer to `examples/use_custom_dimensions.py`.
61+
62+
63+
### Use the custom evaluation dimensions
64+
After you initialize your customized evaluation dimensions, you can choose to use any one of these methods provided below:
65+
66+
#### Method 1: Choose dimensions by names
67+
```python
68+
evaluation_dimensions = (
69+
EvaluationDimensionBuilder.select_existing_dimension_model_by_name(
70+
["transactivity", "verbal_equity"]
71+
)
72+
)
73+
```
74+
75+
#### Method 2: Directly choose the grouped evaluation dimension list
76+
```python
77+
evaluation_dimensions = (
78+
EvaluationDimensionBuilder.select_existing_dimension_model_by_list_name(
79+
"sotopia"
80+
)
81+
)
82+
```
83+
84+
#### Method 3: Build a custom evaluation dimension model temporarily
85+
We provide multiple ways to build a custom evaluation dimension model with `EvaluationDimensionBuilder`, specifically:
86+
- `generate_dimension_model`: build an evaluation dimension from existing dimension primary keys.
87+
- `generate_dimension_model_from_dict`: build an evaluation dimension from a dictionary that specifies the parameters of the `CustomEvaluationDimension`. For example
88+
```json
89+
[
90+
{
91+
"name": "believability",
92+
"description": "The believability of the interaction",
93+
"range_low": 0,
94+
"range_high": 10
95+
},
96+
...
97+
]
98+
```
99+
- `select_existing_dimension_model_by_name`: build an evaluation dimension from existing dimension names. For example `['believability', 'goal']`
100+
- `select_existing_dimension_model_by_list_name`: build an evaluation dimension from existing `CustomEvaluationDimensionList` list names. For example, directly use `sotopia`.
101+
102+
103+
After you get the evaluation dimension model, you can pass it as a parameter for the `Evaluator`, for example,
104+
```python
105+
evaluation_dimensions = (
106+
EvaluationDimensionBuilder.select_existing_dimension_model_by_list_name(
107+
"sotopia"
108+
)
109+
)
110+
terminal_evaluators=[
111+
ReachGoalLLMEvaluator(
112+
model_names["env"],
113+
EvaluationForTwoAgents[evaluation_dimensions], # type: ignore
114+
),
115+
],
116+
```

docs/pages/contribution/contribution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Please refer to [Dev Containers](https://containers.dev/supporting#editors) to s
133133

134134
You can also set up the development environment without Dev Containers. There are three things you will need to set up manually:
135135

136-
- Python and uv: Please start from an environment supporting Python 3.10+ and install uv using `pip install uv; uv sync --all-extra`.
136+
- Python and uv: Please start from an environment supporting Python 3.10+ and install uv using `pip install uv; uv sync --all-extras`. (Note that this will install all the extra dependencies)
137137
- Redis: Please refer to introduction page for the set up of Redis.
138138
- Local LLM (optional): If you don't have access to model endpoints (e.g. OpenAI, Anthropic or others), you can use a local model. You can use Ollama, Llama.cpp, vLLM or many others which support OpenAI compatible endpoints.
139139

docs/pages/examples/deployment.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Deploy Sotopia Python API to Modal
2+
We offer a script to deploy Sotopia Python API to [Modal](https://modal.com/).
3+
To do so, simply go to the `sotopia/sotopia/ui` directory and run the following command:
4+
```bash
5+
modal deploy sotopia/ui/modal_api_server.py
6+
```

docs/pages/index.mdx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export REDIS_OM_URL="redis://localhost:6379"
117117
```
118118
if you are developing Sotopia using uv, you can sync your dependency with
119119
```bash
120-
uv sync --extra examples --extra chat
120+
uv sync --extra examples --extra api
121121
```
122122
</AccordionContent>
123123
</AccordionItem>
@@ -144,13 +144,18 @@ or manual setup:
144144
<AccordionItem value="item-1">
145145
<AccordionTrigger>Docker is my thing.</AccordionTrigger>
146146
<AccordionContent>
147-
Please follow the [instruction](https://redis.io/docs/stack/get-started/install/docker/) to start a redis-stack server or use an existing server. You can also check [Q&A](/docs/troubleshooting.md) to initiate the redis server with the Sotopia data.
147+
Please follow the [instruction](https://redis.io/docs/stack/get-started/install/docker/) to start a redis-stack server or use an existing server. If you want to use the existing data in Sotopia, you can download the `dump.rdb` file from [here](https://cmu.box.com/shared/static/xiivc5z8rnmi1zr6vmk1ohxslylvynur). Feel free to check more datasets related to Sotopia [here](https://huggingface.co/collections/cmu-lti/sotopia-65f312c1bd04a8c4a9225e5b).
148+
149+
After downloading the `dump.rdb` file, make a `redis-data` folder in an desired `<your_path>` directory. And then you can start the server with the following command:
150+
```bash
151+
docker run -d --name redis-stack -p 6379:6379 -p 8001:8001 -v <your_path>/redis-data:/data/ redis/redis-stack:latest
152+
```
148153

149154
The `REDIS_OM_URL` need to be set before loading and saving agents:
150155
```bash
151156
conda env config vars set REDIS_OM_URL="redis://user:password@host:port"
152157
```
153-
</AccordionContent>
158+
</AccordionContent>
154159
</AccordionItem>
155160
<AccordionItem value="item-2">
156161
<AccordionTrigger>No, I don't want to use Docker.</AccordionTrigger>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# `evaluation_dimensions.py`
2+
3+
This module provides classes and utilities for defining and managing custom evaluation dimensions within the Sotopia environment. It includes classes for individual dimensions, lists of dimensions, and a builder for creating dimension models.
4+
5+
## Classes
6+
7+
### `CustomEvaluationDimension`
8+
9+
Represents a custom evaluation dimension with specific attributes such as name, description, and score range.
10+
11+
#### Attributes
12+
- `name`: `str`. The name of the dimension.
13+
- `description`: `str`. A brief description of the dimension.
14+
- `range_low`: `int`. The minimum score for the dimension.
15+
- `range_high`: `int`. The maximum score for the dimension.
16+
17+
### `CustomEvaluationDimensionList`
18+
19+
Groups multiple custom evaluation dimensions together.
20+
21+
#### Attributes
22+
- `name`: `str`. The name of the dimension list.
23+
- `dimension_pks`: `list[str]`. A list of primary keys for the dimensions included in the list.
24+
25+
### `EvaluationDimensionBuilder`
26+
27+
Provides utility methods to create and manage evaluation dimension models.
28+
29+
#### Methods
30+
- `create_range_validator(low: int, high: int)`: Creates a validator for score ranges.
31+
32+
**Arguments:**
33+
- `low`: `int`. The minimum score allowed.
34+
- `high`: `int`. The maximum score allowed.
35+
36+
- `build_dimension_model(dimension_ids: list[str])`: Builds a dimension model from primary keys.
37+
38+
**Arguments:**
39+
- `dimension_ids`: `list[str]`. A list of dimension primary keys.
40+
41+
- `build_dimension_model_from_dict(dimensions: list[dict[str, Union[str, int]]])`: Builds a dimension model from a dictionary.
42+
43+
**Arguments:**
44+
- `dimensions`: `list[dict[str, Union[str, int]]]`. A list of dictionaries specifying dimension attributes.
45+
46+
- `select_existing_dimension_model_by_name(dimension_names: list[str])`: Selects a dimension model by dimension names.
47+
48+
**Arguments:**
49+
- `dimension_names`: `list[str]`. A list of dimension names.
50+
51+
- `select_existing_dimension_model_by_list_name(list_name: str)`: Selects a dimension model by list name.
52+
53+
**Arguments:**
54+
- `list_name`: `str`. The name of the dimension list.

0 commit comments

Comments
 (0)