Skip to main content

Signature

Overview

Creates a new synthetic world scoped to a project. The world intercepts tool calls and returns generated responses instead of calling real services. Returns a SyntheticWorld instance that can be used as a context manager. When the context exits, the world is automatically destroyed.

Parameters

string
required
The project to scope the world to. Must be a project you own.
string
default:"schema_only"
Generation mode:
int | None
default:"None"
Seed for deterministic output. Same seed + same input = same response every time.
string | None
default:"None"
LLM model for response generation. When None, the backend picks a default.
dict | None
default:"None"
Error simulation config. When set, a percentage of calls will raise simulated errors.
Available codes: timeout, internal_error, rate_limit, not_found, bad_request.Failures are deterministic when a seed is set.
string | None
default:"None"
RL platform URL. Defaults to RDK_PLATFORM_URL env var or http://localhost:7878.
string | None
default:"None"
Bearer token for authentication. Defaults to RDK_API_KEY env var.
float
default:"30.0"
HTTP request timeout in seconds.

Returns

A SyntheticWorld instance.

Raises

  • ValueError — if no API key is provided or found in environment
  • httpx.HTTPStatusError — if the backend rejects the request (auth failure, project not found)

Examples

Minimal

With all options

Environment Variables

See Also