-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# This demo servers as a minimal example of how to use the sotopia library. | ||
|
||
# 1. Import the sotopia library | ||
# 1.1. Import the `run_async_server` function: In sotopia, we use Python Async | ||
# API to optimize the throughput. | ||
import asyncio | ||
from sotopia.server import run_async_server | ||
# 1.2. Import the `UniformSampler` class: In sotopia, we use samplers to sample | ||
# the social tasks. | ||
from sotopia.samplers import UniformSampler | ||
|
||
# 2. Run the server | ||
asyncio.run(run_async_server( | ||
model_dict={"env": "gpt-4", "agent1": "gpt-3.5-turbo", "agent2": "gpt-3.5-turbo"}, | ||
sampler=UniformSampler() | ||
)) |