Skip to content



Sessions are where you define model selection logic and model dispatch logic. Sessions are created by writing a TypeScript class that derives from Session.

Model selection logic

Selection logic defines how to select the correct model for a given request using metadata and business rules. This logic typically uses the getModel function to talk to the Model Registry.

Model dispatch logic

Dispatch logic defines how to actually execute prompts on the selected model or models. This logic uses the this.execute(program: Program, ...) Session method to talk to the Model Abstraction Layer.