Creates a new SessionBuilder.
Human-readable name for the session
Optionalstorage: XRayStorageOptional storage adapter for persistence
Adds a pre-built step directly to the session.
A complete XRayStep object
this for method chaining
Marks the session as failed.
Optionalerror: stringOptional error message to store in metadata
The final session data
Gets the session ID.
The session's unique identifier
Sets the session ID explicitly (overrides auto-generated ID).
Custom session ID
this for method chaining
Adds metadata to the session context.
Key-value pairs to store (e.g., reference product, user info)
this for method chaining
Starts the session and persists to storage if provided.
this for method chaining
Creates a new step builder for this session.
Step name (e.g., 'keyword_generation', 'apply_filters')
Step type for categorization (default: 'custom')
A StepBuilder instance for fluent configuration
Builder class for creating X-Ray sessions with a fluent API.
Example