Skip to main content

Basic Usage

Signature

Configuration Options

'session' and 'request' are kept as deprecated aliases of 'context'.

Global (Default)

Single instance shared across all requests:

Context

New instance per execution context (combines session + request scope):

Using Providers

In Tools

In Resources

In Agents

Provider Dependencies

Providers can depend on other providers:

Registration

In Apps

In Server

In Plugins

Optional Dependencies

Use tryGet() for optional dependencies:

Provider Tokens

For interface-based injection, use tokens:

Factory Providers

Use factories for complex initialization:

Value Providers

Provide static values:

Full Example

ProviderRegistry

Provider registry API

@Plugin

Create plugins

@App

Application modules

@Tool

Define tools