Creates a session using either the new SharedSession or legacy ChatSession based on feature flags. This provides a migration path for existing code.
Usage
create_session(
model = NULL,
system_prompt = NULL,
tools = NULL,
hooks = NULL,
max_steps = 10,
...
)Examples
if (FALSE) { # \dontrun{
# Automatically uses SharedSession if feature enabled
session <- create_session(model = "openai:gpt-4o")
# Force legacy session
sdk_set_feature("use_shared_session", FALSE)
session <- create_session(model = "openai:gpt-4o")
} # }