Simile
raw JSON → 0.5.4 verified Fri May 01 auth: no python
A Python SDK for interfacing with Simile AI agents in simulations. Version 0.5.4, pre-1.0 rapid development.
pip install simile Common errors
error ImportError: cannot import name 'Agent' from 'simile.agent' ↓
cause Import path changed in v0.5.0.
fix
Use
from simile import Agent. error AuthError: No API key provided ↓
cause Missing or empty SIMILE_API_KEY environment variable.
fix
Set the environment variable
SIMILE_API_KEY or pass api_key to Agent constructor. error TypeError: Agent.__init__() got an unexpected keyword argument 'model' ↓
cause `model` parameter removed in 0.6.0 (future).
fix
Use
AgentConfig(model='gpt-4') and pass as config to Agent. Warnings
breaking In v0.5.0, the import paths were flattened. `from simile import Agent` replaces `from simile.agent import Agent`. Old imports will break. ↓
fix Use top-level imports: `from simile import Agent, Simulation`.
gotcha API key must be set; either via `SIMILE_API_KEY` environment variable or `api_key` parameter. If missing, SDK will raise an `AuthError`. ↓
fix Set `SIMILE_API_KEY` env var or pass `api_key` explicitly.
deprecated The `model` parameter in `Agent` is deprecated since 0.5.2. Use `agent_config` with `AgentConfig` instead. ↓
fix Use `AgentConfig(model='gpt-4')` and pass it to `Agent(config=...)`.
Imports
- Agent wrong
from simile.agent import Agentcorrectfrom simile import Agent - Simulation wrong
from simile.simulation import Simulationcorrectfrom simile import Simulation - AgentConfig
from simile import AgentConfig
Quickstart
from simile import Agent, Simulation
# Create an agent
agent = Agent(
name="CustomerBot",
api_key=os.environ.get("SIMILE_API_KEY", ""),
model="gpt-4"
)
# Create a simulation
sim = Simulation(agents=[agent])
# Run a conversation
response = sim.run("Hello, how are you?")
print(response)