Skip to content

Commit

Permalink
Add minimalist_demo.py to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
ProKil committed Apr 4, 2024
1 parent 814d24a commit b548b4e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/minimalist_demo.py
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()
))

0 comments on commit b548b4e

Please sign in to comment.